SCiCloudKeyValueDefinition Class Reference
Inherits from | SCDictionaryDefinition : SCDataDefinition : NSObject |
Declared in | SCiCloudKeyValueDefinition.h |
Overview
This class functions as a means to define iCloud key-value fields that the framework can automatically generate a user interface for. As with all other types of binding, once the UI is generated, the framework will also be responsible for automatically reading and writing the values to iCloud.
Sample use: // Create the iCloud key-value definition SCiCloudKeyValueDefinition iCloudDef = [SCiCloudKeyValueDefinition definitionWithiCloudKeyNamesString: @“Login Details:(username,password):Will be automatically signed in”]; SCPropertyDefinition passwordDef = [iCloudDef propertyDefinitionWithName:@“password”]; passwordDef.attributes = [SCTextFieldAttributes attributesWithPlaceholder:nil secureTextEntry:YES autocorrectionType:UITextAutocorrectionTypeNo autocapitalizationType:UITextAutocapitalizationTypeNone];
// Generate the UI for the iCloud keys
[self.tableViewModel generateSectionsForiCloudKeyValueDefinition:iCloudDef];
Class Methods
definitionWithiCloudKeyNames:
Allocates and returns an initialized SCiCloudKeyValueDefinition given the iCloud key names.
+ (instancetype)definitionWithiCloudKeyNames:(NSArray *)keyNames
Parameters
- keyNames
An array of the user defaults key names. All array elements must be of type NSString.
Discussion
By default, all property definitions generated for the given keyNames will have a type of SCPropertyTypeTextField. This can be fully customized after initialization.
Declared In
SCiCloudKeyValueDefinition.h
definitionWithiCloudKeyNames:keyTitles:
Allocates and returns an initialized SCiCloudKeyValueDefinition given the iCloud key names and their titles.
+ (instancetype)definitionWithiCloudKeyNames:(NSArray *)keyNames keyTitles:(NSArray *)keyTitles
Parameters
- keyNames
An array of the user defaults key names. All array elements must be of type NSString.
- keyTitles
An array of titles to the keys in keyNames. All array elements must be of type NSString.
Discussion
By default, all property definitions generated for the given keyNames will have a type of SCPropertyTypeTextField. This can be fully customized after initialization.
Declared In
SCiCloudKeyValueDefinition.h
definitionWithiCloudKeyNamesString:
Allocates and returns an initialized SCiCloudKeyValueDefinition given the iCloud key names string.
+ (instancetype)definitionWithiCloudKeyNamesString:(NSString *)keyNamesString
Parameters
- keyNamesString
A string with the key names separated by semi-colons. Example string: @“firstName;lastName”. Property groups can also be defined in the string using the following format: @“Personal Details:(firstName, lastName); Address:(street, state, country)”. The group title can also be ommitted to create a group with no title. For example: @“:(firstName, lastName)”.
Key names string syntax options: @“key1;key2;key3;…” @“group1 header:(key1, key2,…):group1 footer;group2…”
Discussion
By default, all property definitions generated for the given keyNames will have a type of SCPropertyTypeTextField. This can be fully customized after initialization.
Declared In
SCiCloudKeyValueDefinition.h
Instance Methods
initWithiCloudKeyNames:
Returns an initialized ‘SCiCloudKeyValueDefinition’ given the iCloud key names.
- (instancetype)initWithiCloudKeyNames:(NSArray *)keyNames
Parameters
- keyNames
An array of the user defaults key names. All array elements must be of type NSString.
Discussion
By default, all property definitions generated for the given keyNames will have a type of SCPropertyTypeTextField. This can be fully customized after initialization.
Declared In
SCiCloudKeyValueDefinition.h
initWithiCloudKeyNames:keyTitles:
Returns an initialized ‘SCiCloudKeyValueDefinition’ given the iCloud key names and their titles.
- (instancetype)initWithiCloudKeyNames:(NSArray *)keyNames keyTitles:(NSArray *)keyTitles
Parameters
- keyNames
An array of the user defaults key names. All array elements must be of type NSString.
- keyTitles
An array of titles to the keys in keyNames. All array elements must be of type NSString.
Discussion
By default, all property definitions generated for the given keyNames will have a type of SCPropertyTypeTextField. This can be fully customized after initialization.
Declared In
SCiCloudKeyValueDefinition.h
initWithiCloudKeyNamesString:
Returns an initialized SCiCloudKeyValueDefinition given the iCloud key names string.
- (instancetype)initWithiCloudKeyNamesString:(NSString *)keyNamesString
Parameters
- keyNamesString
A string with the key names separated by semi-colons. Example string: @“firstName;lastName”. Property groups can also be defined in the string using the following format: @“Personal Details:(firstName, lastName); Address:(street, state, country)”. The group title can also be ommitted to create a group with no title. For example: @“:(firstName, lastName)”.
Key names string syntax options: @“key1;key2;key3;…” @“group1 header:(key1, key2,…):group1 footer;group2…”
Discussion
By default, all property definitions generated for the given keyNames will have a type of SCPropertyTypeTextField. This can be fully customized after initialization.
Declared In
SCiCloudKeyValueDefinition.h