Developer

Customizing the Logon UI

Change the appearance and behavior of the logon flow.

To use the customization options that 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
Decide whether to provide your own UIView subclass for the header and the footer views. This is the most flexible way to customize the screens. The UIView subclass can contain any layout and elements you want. To provide a custom UIView, use code similar to this:
- (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];
        }
        
    }
}
MAF provides a more basic customization option with the willRenderUIFromContext delegate. Use this delegate to provide localized titles and descriptions for any of the logon UI screens:
-(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.