SCObjectSelectionModel
@interface SCObjectSelectionModel : SCArrayOfObjectsModel {
NSIndexPath *lastSelectedRowIndexPath;
NSObject *boundObject;
SCDataStore *boundObjectStore;
NSString *boundPropertyName;
NSMutableSet *selectedItemsIndexes;
BOOL allowMultipleSelection;
BOOL allowNoSelection;
NSUInteger maximumSelections;
BOOL autoDismissViewController;
}
This class functions as a model that provides the end-user with an automatically generated list of objects to choose from.
The selection items are provided in the form of an array of NSObjects, called the items array. ‘SCObjectSelectionModel’ can be configured to allow multiple selection and to allow no selection at all. If allow multiple selection is disabled, then the bound property name of this model must be of type NSObject, otherwise it must be of type NSMutableSet.
See
SCObjectSelectionSection.-
Undocumented
Declaration
Objective-C
NSIndexPath *lastSelectedRowIndexPath
-
Undocumented
Declaration
Objective-C
NSObject *boundObject
-
Undocumented
Declaration
Objective-C
SCDataStore *boundObjectStore
-
Undocumented
Declaration
Objective-C
NSString *boundPropertyName
-
Undocumented
Declaration
Objective-C
NSMutableSet *selectedItemsIndexes
-
Undocumented
Declaration
Objective-C
BOOL allowMultipleSelection
-
Undocumented
Declaration
Objective-C
BOOL allowNoSelection
-
Undocumented
Declaration
Objective-C
NSUInteger maximumSelections
-
Undocumented
Declaration
Objective-C
BOOL autoDismissViewController
-
Returns an initialized ‘SCObjectSelectionModel’ given a table view, bound object, a bound property name, and a selection items store.
- - parameter: tableView The model’s table view.
- - parameter: object The object the model will bind to.
- - parameter: propertyName The model’s bound property name corresponding to the object selection. If multiple selection is allowed, then property must be of an NSMutableSet type, otherwise, property must be of type NSObject and cannot be a readonly property.
- - parameter: store The store containing the selection objects.
Declaration
Objective-C
- (instancetype)initWithTableView:(UITableView *)tableView boundObject:(NSObject *)object selectedObjectPropertyName:(NSString *)propertyName selectionItemsStore:(SCDataStore *)store;
-
Returns an initialized ‘SCObjectSelectionModel’ given a table view, bound object, a bound property name, and an array of selection items.
- - parameter: tableView The model’s table view.
- - parameter: object The object the model will bind to.
- - parameter: propertyName The model’s bound property name corresponding to the object selection. If multiple selection is allowed, then property must be of an NSMutableSet type, otherwise, property must be of type NSObject and cannot be a readonly property.
- - parameter: selectionItems An array of the items that the user will choose from. All items must be of an NSObject type and all items must be instances of the same class.
- - parameter: definition The definition of the selection items.
Declaration
Objective-C
- (instancetype)initWithTableView:(UITableView *)tableView boundObject:(NSObject *)object selectedObjectPropertyName:(NSString *)propertyName items:(NSArray *)selectionItems itemsDefintion:(SCDataDefinition *)definition;
-
The model’s bound object.
Declaration
Objective-C
@property (nonatomic, strong) NSObject *boundObject;
-
The model’s bound object store.
Declaration
Objective-C
@property (nonatomic, strong) SCDataStore *boundObjectStore;
-
The model’s bound property name.
Declaration
Objective-C
@property (nonatomic, copy) NSString *boundPropertyName;
-
The model’s bound value.
Declaration
Objective-C
@property (nonatomic, strong) NSObject *boundValue;
-
This property reflects the current model selection. You can set this property to define the model’s selection.
Note
In case of no selection, this property will be set to an NSNumber of value -1.Declaration
Objective-C
@property (nonatomic, copy) NSNumber *selectedItemIndex;
-
This property reflects the current model selection(s). You can add index(es) to the set to define the section’s selection.
Declaration
Objective-C
@property (nonatomic, readonly) NSMutableSet *selectedItemsIndexes;
-
If TRUE, the model allows multiple selection. Default: FALSE.
Declaration
Objective-C
@property (nonatomic) BOOL allowMultipleSelection;
-
If TRUE, the model allows no selection at all. Default: FALSE.
Declaration
Objective-C
@property (nonatomic) BOOL allowNoSelection;
-
The maximum number of items that can be selected. Set to zero to allow an infinite number of selections. Default: 0.
- - note: Only applicable when allowMultipleSelection is TRUE.
Declaration
Objective-C
@property (nonatomic) NSUInteger maximumSelections;
-
If TRUE, the model automatically dismisses the current view controller when a value is selected. Default: FALSE.
Declaration
Objective-C
@property (nonatomic) BOOL autoDismissViewController;