Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import SwiftUI
  2.  
  3. struct CustomVStack<Content: View>: View {
  4. let content: () -> Content
  5. init(@ViewBuilder content: @escaping () -> Content) {
  6. self.content = content
  7. }
  8.  
  9. var body: some View {
  10. VStack(spacing: 0) {
  11. content()
  12. }
  13. }
  14. }
  15.  
  16. struct CustomVStack_Previews: PreviewProvider {
  17. static var previews: some View {
  18. CustomVStack {
  19. Text("1")
  20. Text("2")
  21. Text("3")
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement