Created
June 9, 2022 09:10
-
-
Save meyusufdemirci/906c2777b58476481146300b699aaa5b to your computer and use it in GitHub Desktop.
What is New in SwiftUI, WWDC 22 Article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@State var changeLayout: Bool = false | |
var body: some View { | |
let layout = changeLayout ? AnyLayout(HStack()) : AnyLayout(VStack()) | |
VStack { | |
layout { | |
Text("First") | |
Text("Second") | |
} | |
Button { | |
self.changeLayout.toggle() | |
} label: { | |
Text("Change Layout") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment