반응형
import SwiftUI
struct Variable: View {
let name = "nawon"
var body: some View {
VStack {
Text(name)
Text(name)
Text("hello, \(name)")
}
}
}
#Preview {
Variable()
}
import SwiftUI
struct Variable: View {
let name = "nawon"
let age:Int = 20
let hasJob: Bool = true
var body: some View {
VStack {
Text(name)
Text(name)
Text("hello, \(name) \(age) \(hasJob.description)")
}
}
}
#Preview {
Variable()
}
\(hasJob.description) 하면 true / false 텍스트로 표시해준다
반응형
'Swift' 카테고리의 다른 글
[Swift] url 자료 (0) | 2023.12.14 |
---|---|
[Swift] 구조체 및 preview (0) | 2023.12.14 |
[Swift] 교집합, 합집합, [String:String] (0) | 2023.11.27 |
[Swift] xcode 와 SF Symbols 설치 (0) | 2023.11.27 |
[Swift] Swift 애플 공식 문서 (0) | 2023.09.03 |