To present the MAF Logon UI, adjust your root view controller; however, do not change your root view controller interface.
#import "ViewController.h" #import "MyLogonHandler.h" #import "AppDelegate.h" @interface ViewController () @property (nonatomic, retain) MyLogonHandler *logonHandler; @end; @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; AppDelegate* appDelegate = [[UIApplication sharedApplication] delegate]; self.logonHandler = appDelegate.logonHandler; self.logonHandler.logonUIViewManager.parentViewController = self; } @end
The view controller (MainViewController.m) is only responsible for setting the self reference as the parentViewController property of the MAFLogonUIViewManager. The Logon UI is presented using the parentViewController reference.
You can now run the project to see the default MAF logon UI. The Logon UI appears if you call the logon selector on the Logon Manager from the appdelegate when the application becomes active.