Jump to UIViewController in iOS custom View,
Jump to UIViewController in iOS custom View
Controller redirection in custom View can be implemented in multiple ways:
1 use Notification
Use Notification to open the Controller to be redirected in the parent Controller
2 use proxy
Notify parent controller to redirect Using proxy
3. Use closures
Same principle 2nd
4. Use the root controller of the Main Window
Get the root controller of the Main Window and use the root controller to open the Controller to be redirected.
Swift
Let nav = UIApplication. shared. keyWindow ?. RootViewController! UIViewController let feedVC = FeedBackViewController. init () nav. present (feedVC !, Animated: true, completion: nil)
OC
UIViewController * root = [UIApplication sharedApplication]. keyWindow. rootViewController; [root presentViewController: <# (nonnull UIViewController *) #> animated: YES completion: nil];