aidarsvd

CustomView

Sep 23rd, 2021
834
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  CustomView.swift
  3. //  Sapar
  4. //
  5. //  Created by Айдар Чакиев on 24/9/21.
  6. //
  7.  
  8. import SwiftUI
  9.  
  10. struct CustomView<Content: View>: View {
  11.     let content: Content
  12.     init(@ViewBuilder content: () -> Content) {
  13.         self.content = content()
  14.     }
  15.     var body: some View {
  16.         content
  17.     }
  18. }
  19.  
  20. struct CustomView_Previews: PreviewProvider {
  21.     static var previews: some View {
  22.         VStack{
  23.             CustomView {
  24.                 Text("Test")
  25.             }
  26.         }
  27.     }
  28. }
  29.  
RAW Paste Data