Using UIKit components in SwiftUI (UIViewRepresentable)

Опубликовано: 21 Февраль 2021
на канале: 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


Смотрите видео Using UIKit components in SwiftUI (UIViewRepresentable) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Swift and Tips 21 Февраль 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,018 раз и оно понравилось 113 людям.