I have a file called CustomAppearances.swift that works with Custom Appearances. In it, I have this code:
import Foundation
/*
Custom Appearance structure. Contains all attributes and methods required to apply custom appearance who are not related to a component or a class.
- parameter navFont: The font style used in the navigation bar title
*/
struct CustomAppearance {
static let navFont = UIFont(name: "SF-UI-Text-Light", size: 17.0)
func applyCustomAppearanceToNavigationBar() {
UINavigationBar.appearance().translucent = false
UINavigationBar.appearance().barTintColor = UIColor.whiteColor()
UINavigationBar.appearance().tintColor = UIColor.blackColor()
UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: navFont!, NSForegroundColorAttributeName: UIColor.blackColor() ]
}
}
I get an error that says "navFont can't be used on instance of type 'Custom Appearances.'"
Is there a fix for this? This is the app I was planning on submitting with my WWDC scholarship application.
Thanks.