반응형
import SwiftUI
struct Variable: View {
let name = "nawon"
let age:Int = 20
let hasJob: Bool = true
let enkoDictionary = ["Apple":"사과", "Banana":"바나나", "Coconut":"코코넛"]
let houseAnimal: Set = ["🐶", "🐱","🐹"]
let farmAnimal: Set = ["🐻","🐼","🐮", "🐱","🐹"]
var body: some View {
VStack {
Text(name)
Text(name)
Text("hello, \(name) \(age) \(hasJob.description)")
Text(enkoDictionary["Apple"]!)
Text(houseAnimal.intersection(farmAnimal).description) //교집합
Text(houseAnimal.union(farmAnimal).description) //합집합
}
}
}
#Preview {
Variable()
}
반응형
'Swift' 카테고리의 다른 글
[Swift] url 자료 (0) | 2023.12.14 |
---|---|
[Swift] 구조체 및 preview (0) | 2023.12.14 |
[Swift] 변수와 text 문구 표시 및 Bool일때 (0) | 2023.11.27 |
[Swift] xcode 와 SF Symbols 설치 (0) | 2023.11.27 |
[Swift] Swift 애플 공식 문서 (0) | 2023.09.03 |