I have changed the appearance of UIBarButtonItem and UINavigationBar titleTextAttributes to my custom Font along with color to white using Appearance Proxy in "applicationDidFinishLaunching". Every navigation title texts and BarButtonItems are using custom font provided.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
application.setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false)
UINavigationBar.appearance().barStyle = UIBarStyle.BlackTranslucent
UINavigationBar.appearance().barTintColor = NSFontAttributeName:SharedHelper.myCustomBarColor()
UINavigationBar.appearance().titleTextAttributes =[NSForegroundColorAttributeName:UIColor.whiteColor()]
UIBarButtonItem.appearance().tintColor = UIColor.whiteColor()
let attributes = [NSFontAttributeName:SharedHelper.customFontForBarButton()]
UIBarButtonItem.appearance().setTitleTextAttributes(attributes, forState: UIControlState.Normal)
return true
}
The problem comes when I use MFMailComposeViewController for sending email. The MFMailComposeViewController ignores the Font Attributes and reverted back to default fonts. In iPhone 5S simulator, I can see the custom font for a while but it reverts back to default one.
Shown for a while in iPhone Simulator 5S. ( I am trying to accomplish this )
Uses default font after few seconds.
Any help on this? Shouldn't the appearance proxy work for UIBarButton & NavigationBar of MFMailComposeViewController too or is there need of any coding for this?
I am using Swift and also tried using appearanceWhenContainedIn by Alexander using Bridge but didn't seems to work. My concern is to change the font of titleText and BarButtonItems ( cancel, send ) of MFMailComposeViewController.
Thanks in advance. Any help would be highly appreciated.