Using UIKit components in SwiftUI (UIViewRepresentable)

Published: 21 February 2021
on channel: Swift and Tips
3,018
113

Hello guys, welcome to another video! Today we going to talk about UIViewRepresentable. The bridge to reuse UIKit components in our SwiftUI Code. In this first part, we'll explore the requirements to conform UIViewRepresentable and a simple demo to understand the idea using UIActivityIndicatorView.

Content:
0:00 - Intro
1:00 - We want to use a UIView component in SwiftUI
1:25 - Create a struct confirming UIViewRepresentable
2:28 - Requirements for UIViewRepresentable
4:36 - Wrapping UIActivityIndicatorView within UIViewRepresentable
8:30 - Using a UIViewRepresentable in a SwiftUI view
9:57 - Showing delegates in action
11:03 - Ending

Source:
https://developer.apple.com/documenta...
https://developer.apple.com/tutorials...


Source code showed in the video: https://github.com/pitt500/swift-and-...

Other videos in the channel:
State management in SwiftUI:    • State Management in SwiftUI  
Understand your view, without seeing your preview:    • Tip: Understand your view without see...  

Don't forget to subscribe to the channel, like it, and follow me on social media:

Twitter:
  / swiftandtips  
  / pitt500  

Finally, ask me for a video you would like to see next 😄!

Credits:
Music by Wataboi from https://pixabay.com/
Video edited with LumaFusion


Watch video Using UIKit components in SwiftUI (UIViewRepresentable) online without registration, duration hours minute second in high quality. This video was added by user Swift and Tips 21 February 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,018 once and liked it 113 people.