전체 글
-
#14. 커스텀 탭뷰(CustomTabView)SwiftUI 앱만들기 2022. 7. 8. 12:02
#1. MyCustomTabView import SwiftUI enum TabIndex{ case home, cart, profile } struct MyCustomTabView: View { @State var tabIndex : TabIndex @State var largerScale : CGFloat = 1.4 //Icon 크기 변경 //MyView 뷰로 이동 func changeMyView(tabIndex: TabIndex ) -> MyView{ switch tabIndex { case .home: return MyView(title: "Home", bgColor: Color.green) case .cart: return MyView(title: "CART", bgColor: Color.purpl..
-
#13. 탭뷰(TabView)SwiftUI 앱만들기 2022. 7. 7. 18:08
#1. MyTabView import SwiftUI struct MyTabView: View { var body: some View { TabView{ //보여질 화면 MyView(title: "1번", bgColor: Color.green) .tabItem{ Image(systemName: "airplane") Text("1번") } .tag(0) MyView(title: "2번", bgColor: Color.orange) .tabItem{ Image(systemName: "flame.fill") Text("2번") } .tag(1) MyView(title: "3번", bgColor: Color.blue) .tabItem{ Image(systemName: "doc.fill") Text("3번") } ...
-
#12-1. 지오메트리 프록시 위치 잡는 3가지 방법SwiftUI 앱만들기 2022. 7. 7. 17:51
import SwiftUI enum Index{ case one, two, three } struct MyGeometryReaderVStack: View { @State var index: Index = .one //#3. 중앙에 위치하기... 지오메트리 프록시를 매개변수로 CGPoint를 반환하는 클로져 let centerPosition : (GeometryProxy) -> CGPoint = { proxy in return CGPoint(x: proxy.frame(in: .local).midX, y: proxy.frame(in: .local).midY) } var body: some View { GeometryReader { geomtry in VStack(spacing:0) { Button(actio..