0

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!

nOOb iOS
  • 1,384
  • 2
  • 19
  • 37
  • This stack overflow answer might point you in the right direction: https://stackoverflow.com/a/12719382/4102523 – tww0003 Nov 29 '18 at 16:51
  • This works brilliantly in normal QuickLook, but with AR Quicklook seems to have UIToolbarContainerView and UIButtonBarStackView. When I try getting the subviews of UIStackView, I am getting empty array. For that matter, I couldn't find any of those bar button or custom view (not sure) items like close, object/AR segment controller and share button. Seems to appear magically.. – nOOb iOS Nov 30 '18 at 11:12

0 Answers0