Created
April 9, 2020 04:15
-
-
Save JadenGeller/9aaa67e6b6f1692cb4c3b0958d2c652c to your computer and use it in GitHub Desktop.
Grid4x4 SwiftUI View
This file contains 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
struct Grid4x4<TopLeft: View, TopRight: View, BottomLeft: View, BottomRight: View>: View { | |
let topLeft: TopLeft | |
let topRight: TopRight | |
let bottomLeft: BottomLeft | |
let bottomRight: BottomRight | |
init(@ViewBuilder content: () -> TupleView<(TopLeft, TopRight, BottomLeft, BottomRight)>) { | |
(topLeft, topRight, bottomLeft, bottomRight) = content().value | |
} | |
var body: some View { | |
VStack { | |
HStack { | |
topLeft | |
topRight | |
} | |
HStack { | |
bottomLeft | |
bottomRight | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment