简体   繁体   中英

How can I show an activity indicator on a UITabBarController

I have a UITabBarController with multiple nav vcs. How can I show an activity indicator on the current visible vc from the tab bar controller's viewDidLoad ?

Objective-C

UIViewController *currentVisibleViewController = [self.tabBarController.viewControllers objectAtIndex:self.tabBarController.selectedIndex];

//Add ActivityIndicator on currentVisibleViewController.view

Swift-3

let currentVisibleViewController = self.tabBarController?.viewControllers?[(self.tabBarController?.selectedIndex)!]
//Add ActivityIndicator on currentVisibleViewController.view

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM