How to use conditions to switch view properties?

I am new of SwiftUI, write ugly codes like that...

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!
How to use conditions to switch view properties?
 
 
Q