NUISettings
public class NUISettings : NSObject
The style class settings class that provides a list of static functions for applying-style-related functionalities
-
The
NUISettingsinstanceDeclaration
Swift
public static var instance: NUISettings! -
Apply a specific stylesheet for theming with an given style sheet file name
Declaration
Swift
public static func initWithStylesheet(name: String) throwsParameters
nameThe style sheet file name
-
Append a specific stylesheet for theming with an given style sheet file name
Declaration
Swift
public static func appendStylesheet(name: String) throwsParameters
nameThe style sheet file name
-
Load a specific stylesheet for theming with an given full style sheet path
Declaration
Swift
public static func loadStylesheetByPath(path: String) throwsParameters
pathThe style sheet file full path
-
Load a specific stylesheet for theming with an given URL to the style sheet
Declaration
Swift
public static func loadStylesheetByURL(url: URL) throwsParameters
urlThe
URLto the style sheet -
Load a stylesheet as
Stringrepresetation of nss style sheet fileDeclaration
Swift
public static func loadStylesheetByString(content: String) throwsParameters
contentthe
Stringrepresentation of nss document -
Load all the style sheets set in
initWithStylesheetandappendStylesheetDeclaration
Swift
public static func reloadStylesheets() -
Reload a specific stylesheet on orientation changes
Declaration
Swift
public static func reloadStylesheetsOnOrientationChange(orientation: UIInterfaceOrientation) -> BoolParameters
orientationThe
UIInterfaceOrientationchangedReturn Value
true if orientation is changed and style sheet gets reloaded; otherwise, false
-
Check to see if auto update of the style sheet is enabled by checking if
autoUpdatePathis setDeclaration
Swift
public static func autoUpdateIsEnabled() -> BoolReturn Value
true if
autoUpdatePathis set -
Get the style sheet path for auto update
Declaration
Swift
public static func autoUpdatePath() -> String?Return Value
The path for auto updated style sheet
-
Set the auto update path for style sheet
Declaration
Swift
public static func setAutoUpdatePath(path: String)Parameters
pathThe path
-
Look for a given property in a given explicit style class.
Declaration
Swift
public static func hasProperty(property: String, withExplicitClass className: String) -> BoolParameters
propertyThe targeted property to be searched in the style class
classNameThe explicit style class
Return Value
true if found; otherwise, false
-
Look for a given property in a given style class(es).
Declaration
Swift
public static func hasProperty(property: String, withClass className: String) -> BoolParameters
propertyThe targeted property to be searched in the style class(es)
classNameThe targeted style class(es), which may contain more than one style class with “:” as separator
Return Value
true if found; otherwise, false
-
Look for font property in a given style class
Declaration
Swift
public static func hasFontPropertiesWithClass(className: String) -> BoolParameters
classNameThe given style class
Return Value
true if found; otherwise, false
-
Get a given property’s
Stringvalue in a given style class.Declaration
Swift
public static func get(property: String, withExplicitClass className: String) -> String?Parameters
propertyThe targeted property to be searched in the style class.
withExplicitClassThe targeted style class.
Return Value
The property
Stringvalue if found; otherwise, nil. -
Get a given property’s value in a given style class(es).
Declaration
Swift
public static func get(property: String, withClass className: String) -> String?Parameters
propertyThe targeted property to be searched in the style class(es)
classNameThe targeted style class(es), which may contain more than one style class with “:” as separator
Return Value
The property value if found; otherwise, nil.
-
Get a given property’s
Boolvalue in a given style class.Declaration
Swift
public static func getBoolean(property: String, withClass className: String) -> BoolParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
Boolvaluei f found; otherwise, nil. -
Get a given property’s
Floatvalue in a given style class.Declaration
Swift
public static func getFloat(property: String, withClass className: String) -> Float?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
Floatvalue if found; otherwise, nil. -
Get a given property’s
Intvalue in a given style class.Declaration
Swift
public static func getInteger(property: String, withClass className: String) -> Int?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
Intvalue if found; otherwise, nil. -
Get a given property’s
CGSizevalue in a given style class.Declaration
Swift
public static func getSize(property: String, withClass className: String) -> CGSize?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
CGSizevalue if found; otherwise, nil -
Get a given property’s
UIOffsetvalue in a given style class.Declaration
Swift
public static func getOffset(property: String, withClass className: String) -> UIOffset?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIOffsetvalue if found; otherwise, nil. -
Get a given property’s
UIEdgeInsetsvalue in a given style class.Declaration
Swift
public static func getEdgeInsets(property: String, withClass className: String) -> UIEdgeInsets?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIEdgeInsetsvalue if found; otherwise, nil. -
Get a given property’s
UITextBorderStylevalue in a given style class.Declaration
Swift
public static func getBorderStyle(property: String, withClass className: String) -> UITextBorderStyleParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UITextBorderStylevalue if found; otherwise, UITextBorderStyle.none. -
Get a given property’s
UITableViewCellSeparatorStylevalue in a given style class.Declaration
Swift
public static func getSeparatorStyle(property: String, withClass className: String) -> UITableViewCellSeparatorStyleParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UITableViewCellSeparatorStylevalue if found; otherwise, UITableViewCellSeparatorStyle.none. -
Get
UIFontvalue in a given style class.Declaration
Swift
public static func getFontWithClass(className: String) -> UIFont?Parameters
classNameThe targeted style class.
Return Value
The property
UIFontvalue if found; otherwise, UIFont.systemFontSize. -
Get
UIFontvalue in a given style class and a given baseUIFontDeclaration
Swift
public static func getFontWithClass(className: String, baseFont: UIFont?, withSuffix suffix: String? = nil) -> UIFontParameters
classNameThe targeted style class.
Return Value
The property
UIFontvalue if found; otherwise, baseFont with size set to UIFont.systemFontSize. -
Get a given property’s
UIColorvalue in a given style class.Declaration
Swift
public static func getColor(property: String, withClass className: String) -> UIColor?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIColorvalue if found; otherwise, nil. -
Get a given image property’s
UIColorvalue in a given style class.Declaration
Swift
public static func getColorFromImage(property: String, withClass className: String) -> UIColor?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIColorvalue if found; otherwise, nil. -
Get a given color property’s
UIImagevalue in a given style class.Declaration
Swift
public static func getImageFromColor(property: String, withClass className: String) -> UIImage?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIImagevalue if found; otherwise, nil. -
Get a given property’s
UIImagevalue in a given style class.Declaration
Swift
public static func getImage(property: String, withClass className: String) -> UIImage?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIImagevalue if found; otherwise, nil. -
Get a given property’s
UIView.ContentModevalue in a given style class.Declaration
Swift
public static func getContentMode(property: String, withClass className: String) -> UIView.ContentMode?Parameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIView.ContentModevalue if found; otherwise, nil. -
Get a given property’s
UIBarStylevalue in a given style class.Declaration
Swift
public static func getBarStyle(property: String, withClass className: String) -> UIBarStyleParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIBarStylevalue if found; otherwise, UIBarStyle.default. -
Get a given property’s
NSTextAlignmentvalue in a given style class.Declaration
Swift
public static func getTextAlignment(property: String, withClass className: String) -> NSTextAlignmentParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
NSTextAlignmentvalue if found; otherwise, NSTextAlignment.left. -
Get a given property’s
UIControlContentHorizontalAlignmentvalue in a given style class.Declaration
Swift
public static func getControlContentHorizontalAlignment( property: String, withClass className: String) -> UIControlContentHorizontalAlignmentParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIControlContentHorizontalAlignmentvalue if found; otherwise, UIControlContentHorizontalAlignment.left. -
Get a given property’s
UIControlContentVerticalAlignmentvalue in a given style class.Declaration
Swift
public static func getControlContentVerticalAlignment( property: String, withClass className: String) -> UIControlContentVerticalAlignmentParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIControlContentHorizontalAlignmentvalue if found; otherwise, UIControlContentVerticalAlignment.top. -
Get a given property’s
UIKeyboardAppearancevalue in a given style class.Declaration
Swift
public static func getKeyboardAppearance(property: String, withClass className: String) -> UIKeyboardAppearanceParameters
propertyThe targeted property to be searched in the style class.
classNameThe targeted style class.
Return Value
The property
UIKeyboardAppearancevalue if found; otherwise, UIKeyboardAppearance.default. -
Convert a list of style classes in a
Stringto an arrayDeclaration
Swift
public static func getClasses(className: String) -> [String]Parameters
classNameThe
Stringwhich contains a list of style classes with “:” as the separatorReturn Value
The
Stringarray that contains the style classes. Each item in the array has one style class. -
Set a list of views to be excluded in applying the style
Declaration
Swift
public static func setGlobalExclusions(array: [String])Parameters
arrayThe
Stringarray that contains a list of excluded views -
Get a list of views to be excluded in applying the style
Declaration
Swift
public static func getGlobalExclusions() -> [String]Return Value
The
Stringarray that contains a list of excluded views -
Get style sheet orientation name
Declaration
Swift
public static func stylesheetOrientation() -> String?Return Value
“landscape” or “portrait”
-
Get style sheet orientation name based on a given
UIInterfaceOrientationDeclaration
Swift
public static func stylesheetOrientationFromInterfaceOrientation(orientation: UIInterfaceOrientation) -> StringParameters
orientationThe
UIInterfaceOrientationto be determinedReturn Value
“landscape” if the given orientation is landscape; otherwise, “portrait”.
-
A String value for stylesheet’s name.
Declaration
Swift
public var stylesheetName: String? { get } -
Get the global
NUISettingsinstanceDeclaration
Swift
public static func getInstance() -> NUISettings -
Reset global color definitions from the nss file.
Declaration
Swift
public static func resetGlobalDefinitions() -
Reset style class definitions from the nss file.
Declaration
Swift
public static func resetStyleClassDefinitions() -
Reset both global and style class definitions from nss file.
Declaration
Swift
public static func reset()