My app has many views and their respective controllers. Now I have a set of model classes with business logic in them. One of the model classes(subclass of NSObject) has the res
I am a little hesitant to disable interactions for the entire app - this is too aggressive and too intrusive, what happens when the view controller is inside a split view controller? Then both view controllers will be disabled!
Instead, you could create a clear-colored view controller and presented it modally, see example below for Swift 2:
private func TransparentViewController() -> UIViewController {
let transparentViewController = UIViewController(nibName: nil, bundle: nil)
transparentViewController.modalPresentationStyle = .OverCurrentContext
transparentViewController.modalTransitionStyle = .CrossDissolve
transparentViewController.view.backgroundColor = UIColor.clearColor()
return transparentViewController
}
And now you can present it from within your view controller, before presenting the HUD:
let transparentViewController = TransparentViewController()
self.presentViewController(transparentViewController, animated:false, completion: nil)
Hope this helps!