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?