To be able to use the customization options MAF Logon UI provides, implement MAFLogonUICustomizationDelegate in one of your classes.
#import <UIKit/UIKit.h> #import "MAFLogonNGDelegate.h" #import "MAFLogonUICustomizationDelegate.h" @interface MAFLogonNGSampleViewController : UIViewController <MAFLogonNGDelegate, MAFLogonUICustomizationDelegate> @end
- (void) willRenderHeaderFooterFromCustomContext:(MAFLogonUICustomizationContext*)aCustomContext{
// the current screen can be determined using aCustomContext.screenType property
if (([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)) {
if (UIDeviceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])){
aCustomContext.headerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPhone_landscape_header"]] autorelease] ;
aCustomContext.footerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPhone_landscape_footer"]] autorelease];
}
else{
aCustomContext.headerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPhone_portrait_header"]] autorelease] ;
aCustomContext.footerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPhone_portrait_footer"]] autorelease];
}
}
else{
if (UIDeviceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])){
aCustomContext.headerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPad_landscape_header"]] autorelease] ;
aCustomContext.footerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPad_landscape_footer"]] autorelease];
}
else{
aCustomContext.headerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPad_portrait_header"]] autorelease] ;
aCustomContext.footerView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iPad_portrait_footer"]] autorelease];
}
}
}
-(void)willRenderUIFromUIContext:(MAFLogonUIContext *)aUIContext{
aUIContext.title=[NSString stringWithFormat:@"Custom Title"];
aUIContext.headerTitle=[NSString stringWithFormat:@"Custom Header Title"];
aUIContext.headerDescription=[NSString stringWithFormat:@"Custom Header Description"];
aUIContext.footerDescription=[NSString stringWithFormat:@"Custom Footer Description"];
}
You
can also check which screen is presented, and perform the customization per
screen.