I am trying to get the subviews of UIButtonBarStackView, so that I can find the right bar button and disable it. I am trying to hide share button in QLPreviewController with usdz files. I have subclassed QLPreviewController and I have this code in viewDidAppear. I can get the subviews till this point and these subviews of StackView returns empty array. Here is my code -
UINavigationController *navController = self.childViewControllers.firstObject;
for(UIView *toolbar in navController.view.subviews[2].subviews) {
if ([NSStringFromClass([toolbar class]) containsString:@"ContentView"]){
for(UIView * stackView in toolbar.subviews) {
if ([stackView isKindOfClass:[UIStackView class]]) {
//StackView subview is empty.
}
}
}
}
Any help is much appreciated. Thanks!