ConfigReader
@interface ConfigReader : NSObject
Interface to the values stored in the Config.plist resource file
-
Return singleton instance
Declaration
Objective-C
+ (ConfigReader *)getInstanceWith:(NSBundle *)app_bundle ConfigFile:(NSString *)filename;
Swift
class func getInstanceWith(app_bundle: NSBundle!, configFile filename: String!) -> ConfigReader!
Return Value
ConfigReader singleton
-
Return string value with specified key from Config.plist, or default value if not specified in the file
Declaration
Objective-C
- (NSString *)stringForKey:(NSString *)key defaultValue:(NSString *)defaultValue;
Swift
func stringForKey(key: String!, defaultValue: String!) -> String!
Parameters
key
specified key from Config.plist
defaultValue
default value if not specified in the file
Return Value
string value for specified key
-
Return integer value with specified key from Config.plist, or default value if not specified in the file
Declaration
Objective-C
- (NSInteger)integerForKey:(NSString *)key defaultValue:(NSInteger)defaultValue;
Swift
func integerForKey(key: String!, defaultValue: Int) -> Int
Parameters
key
specified key from Config.plist
defaultValue
default value if not specified in the file
Return Value
integer value for specified key
-
Return long integer value with specified key from Config.plist, or default value if not specified in the file
Declaration
Objective-C
- (NSInteger)LongIntegerForKey:(NSString *)key defaultValue:(NSInteger)defaultValue;
Swift
func LongIntegerForKey(key: String!, defaultValue: Int) -> Int
Parameters
key
specified key from Config.plist
defaultValue
default value if not specified in the file
Return Value
long integer value for specified key
-
Return unsigned integer value with specified key from Config.plist, or default value if not specified in the file
Declaration
Objective-C
- (unsigned int)unsignedIntegerForKey:(NSString *)key defaultValue:(unsigned int)defaultValue;
Swift
func unsignedIntegerForKey(key: String!, defaultValue: UInt32) -> UInt32
Parameters
key
specified key from Config.plist
defaultValue
default value if not specified in the file
Return Value
unsigned integer value for specified key
-
Return unsigned long integer value with specified key from Config.plist, or default value if not specified in the file
Declaration
Objective-C
- (unsigned long)unsignedLongIntegerForKey:(NSString *)key defaultValue:(unsigned long)defaultValue;
Swift
func unsignedLongIntegerForKey(key: String!, defaultValue: UInt) -> UInt
Parameters
key
specified key from Config.plist
defaultValue
default value if not specified in the file
Return Value
unsigned long integer value for specified key
-
Return floating-point value with specified key from Config.plist, or default value if not specified in the file
Declaration
Objective-C
- (double)doubleForKey:(NSString *)key defaultValue:(double)defaultValue;
Swift
func doubleForKey(key: String!, defaultValue: Double) -> Double
Parameters
key
specified key from Config.plist
defaultValue
default value if not specified in the file
Return Value
floating-point value for specified key
-
Return boolean value with specified key from Config.plist, or default value if not specified in the file
Declaration
Objective-C
- (BOOL)boolForKey:(NSString *)key defaultValue:(BOOL)defaultValue;
Swift
func boolForKey(key: String!, defaultValue: Bool) -> Bool
Parameters
key
specified key from Config.plist
defaultValue
default value if not specified in the file
Return Value
fboolean value for specified key