1

I need to get a button from the SwiftUI view that is wrapped in UIHostingController. In UIKit we simply could check the type in this way:

for (id subview in subviews) {
   if ([subview isKindOfClass:[UIButton class]]) {
      //do code for UIKit 
   }
}

How should handle this for the SwiftUI view that added as a view in UIViewController?

Mac3n
  • 4,189
  • 3
  • 16
  • 29
  • 1
    That's not very good approach. Would you explain where do you need that? And show your code. I believe there is also direct way to work with your controls, if needed. – Asperi Oct 28 '20 at 04:53
  • It seems a better way to handle the view indirectly by handling the data in SwiftUI – leorider Oct 28 '20 at 08:27

0 Answers0