Search code examples
swiftuisplitviewcontrolleruiactivityindicatorview

Showing activity indicator using SplitlViewController


We are trying to show an activity indicator while loading table view data in the master view of our SplitViewController. This solution works well but only when viewing just the Master view. When in split view the indicator doesn't appear. How can you tweak this solution when showing the split view?


Solution

  • Trick was to reference self.splitViewController.view instead of self.view:

    let split = self.splitViewController!
    indicator.center = split.view.center
    split.view.addSubview(indicator)