Scenario: The user taps on a button on a view controller. The view controller is the topmost (obviously) in the navigation stack. The tap invokes a utility class method call
Shorthand way to do present the alert in Objective-C:
[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:alertController animated:YES completion:nil];
Where alertController
is your UIAlertController
object.
NOTE: You'll also need to make sure your helper class extends UIViewController