This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun ProductDetails.showLog() { | |
Timber.d("ProductDetails") | |
Timber.d(" productId : ${this.productId}") | |
Timber.d(" productType : ${this.productType}") | |
Timber.d(" title : ${this.title}") | |
Timber.d(" name : ${this.name}") | |
Timber.d(" description : ${this.description}") | |
this.subscriptionOfferDetails?.forEachIndexed { index, offer -> | |
Timber.d(" subscriptionOfferDetails") | |
Timber.d(" index : $index") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun SettingsScreen( | |
modifier: Modifier = Modifier, | |
viewModel: SettingsViewModel = hiltViewModel() | |
) { | |
val on = viewModel.on.collectAsState() | |
LazyColumn{ | |
items(10) { | |
OutlinedCard( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct Sample: View { | |
@State private var data: Data = .init() | |
private let urlStrings = [ | |
"https://i.imgur.com/05S3yYZ.png", | |
"https://i.imgur.com/REuN9RR.png" // removed | |
] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct Fruit: Identifiable, Equatable { | |
let id = UUID() | |
let name: String | |
let color: Color | |
} | |
struct DraggableList: View { | |
@State private var fruits: [Fruit] = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct SpeechBubble: View { | |
var count: Int | |
var body: some View { | |
HStack(spacing: 0) { | |
Rectangle() | |
.fill(.red) | |
.rotationEffect(.degrees(45)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
// 【SwiftUI】アニメーションの書き方 | |
// https://zenn.dev/maochanz/articles/b3f2b0dcf949c5 | |
//【SwiftUI】トランジションの書き方 | |
// https://zenn.dev/maochanz/articles/0bcd4bfaa43a0d | |
struct AnimatedMessage: View { | |
var text: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct TestTransition: View { | |
@State private var active = false | |
var body: some View { | |
VStack { | |
if active { | |
Image(systemName: "face.smiling") | |
.font(.system(size: 100)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct TextAnimationView: View { | |
@State private var scale = false | |
@State private var rotation = false | |
@State private var opacity = false | |
@State private var offset = false | |
var body: some View { | |
VStack { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import SwiftData | |
struct PreviewOneModelView<Model: PersistentModel, Content: View>: View { | |
var content: (Model) -> Content | |
@Query private var models: [Model] | |
var body: some View { | |
content(models.first!) | |
} |
NewerOlder