I am new of SwiftUI, write ugly codes like that...
How to use conditions to switch view properties gracefully?
Thanks!
Code Block swift let actionContentView = VStack { if UIDevice.current.userInterfaceIdiom == .phone { Spacer() } ... } ... return UIDevice.current.userInterfaceIdiom == .phone ? AnyView(VStack(spacing: 0) { settingContentView cameraContentView actionContentView }) : AnyView(ZStack(alignment: .top){ cameraContentView VStack (spacing:0) { settingContentView Spacer() actionContentView.padding(40) } }) ... return UIDevice.current.userInterfaceIdiom == .phone ? AnyView(GeometryReader(content: internalView(geometry:)) .background(BubbleBackground())) : AnyView(GeometryReader(content: internalView(geometry:)) .edgesIgnoringSafeArea(.all) .background(BubbleBackground()))
How to use conditions to switch view properties gracefully?
Thanks!