BuiltKeyStore Class Reference

Inherits from NSObject
Declared in BuiltKeyStore.h

Manage properties

– hasKey:

Checks whether the keystore has a given property

- (BOOL)hasKey:(NSString *)key

Parameters

key

The property to be checked

Return Value

true if key exists, false if not

Discussion

 //Obj-C
 BOOL hasKey = [builtApplication.keystore hasKey:@"key"];
 if (hasKey) {
    //Has Key
 } else {
    //Key not found
 }

 //Swift
 var hasKey:Bool = builtApplication.keystore.hasKey("key")
 if (hasKey) {
    //Has Key
 } else {
    //Key not found
 }

Declared In

BuiltKeyStore.h

– setObject:forKey:

  • Use this method to add a new key value pair in group.
- (void)setObject:(id)object forKey:(NSString *)key

Discussion

 //Obj-C
 id object = [builtApplication.keystore setObject:@"Hello" forKey:@"key"];

 //Swift
 var object = builtApplication.keystore.setObject("Hello", forKey:"key")
  • @param object object to set
  • @param key key to assign on.

Declared In

BuiltKeyStore.h

– objectForKey:

Gets the data for given property.

- (BUILT_NULLABLE id)objectForKey:(NSString *)key

Parameters

key

The object’s property

Return Value

The value for the key provided

Discussion

 //Obj-C
 id object = [builtApplication.keystore objectForKey:@"key"];

 //Swift
 var object = builtApplication.keystore.objectForKey("key")

Declared In

BuiltKeyStore.h

– removeObjectForKey:

Removes the data for given key form keystore.

- (void)removeObjectForKey:(NSString *)key

Discussion

 //Obj-C
 id object = [builtApplication.keystore removeObjectForKey:@"key"];

 //Swift
 var object = builtApplication.keystore.removeObjectForKey("key")
  • @param key Key which need to be removed.

Declared In

BuiltKeyStore.h

– removeAllObjects

Removes all the data form keystore.

- (void)removeAllObjects

Discussion

//Obj-C
id object = [builtApplication.keystore removeAllObjects];

//Swift
var object = builtApplication.keystore.removeAllObjects()

Declared In

BuiltKeyStore.h

Persist

– save

Save the data.

- (void)save

Discussion

 //Obj-C
 id object = [builtApplication.keystore save];

 //Swift
 var object = builtApplication.keystore.save()

Declared In

BuiltKeyStore.h