[SwiftUI] DarkMode, Divider, sheet, fullScreenCover, alert, TabView
·
iOS
1. DarkMode Assets - Color Set에서 LightMode와 DarkMode에서의 색상을 설정할 수 있음 2. Divider VStack{ Divider() HStack{ Image(systemName: "heart") Divider() .frame(height: 30) Text("Pado") Divider() .frame(height: 30) } Divider() .background(.red) .frame(height: 30) HStack{ Image(systemName: "heart") Divider() .frame(height: 30) Text("Pado") Divider() .frame(height: 30) } Divider() } Divider() : 구분선을 추가한다. .f..
[SwiftUI] @State, padding, frame
·
iOS
1. @State struct ContentView: View { @State var name: String = "" var body: some View { VStack { Text("Hi \(name)") Button{ name = "Pado" }label: { Text("Click") } } } } @State 변수가 바뀌면 화면을 다시 그린다. 2. padding VStack { Image(systemName: "heart") .resizable() .aspectRatio(contentMode: .fit) .frame(width: 100) .padding([.bottom, .top], 100) .background(.yellow) .foregroundColor(.red) Image(systemNam..
[SwiftUI] List, Section, Spacer, Color
·
iOS
1. List List{ HStack{ Image(systemName: "heart") Text("PADO") } HStack{ Image(systemName: "heart.fill") Text("ARI") } HStack{ Image(systemName: "bolt") Text("WAVE") } } 뷰들을 리스트로 만들어준다. 2. Section List{ Section{ HStack{ Image(systemName: "heart") Text("PADO") } HStack{ Image(systemName: "heart.fill") Text("ARI") } HStack{ Image(systemName: "bolt") Text("WAVE") } } header: { Text("A Class") } foot..