Classes
The following classes are available globally.
-
This class functions as a cell that, given an array of objects, will generate an SCArrayOfObjectsSection detail view that’s displayed when the cell is tapped.
The cell can also be optionally bound to an object and generate an additional SCObjectSection detail view when the cell is tapped while the table is in edit mode.
See
SCObjectCell, SCObjectSection, SCArrayOfObjectsSection.Declaration
Objective-C
@interface SCArrayOfObjectsCell : SCCustomCell { SCDataStore *dataStore; SCDataFetchOptions *dataFetchOptions; BOOL allowAddingItems; BOOL allowDeletingItems; BOOL allowMovingItems; BOOL allowEditDetailView; BOOL allowRowSelection; BOOL autoSelectNewItemCell; BOOL displayItemsCountInBadgeView; SCTableViewCell *placeholderCell; SCTableViewCell *addNewItemCell; BOOL addNewItemCellExistsInNormalMode; BOOL addNewItemCellExistsInEditingMode; SCSectionActions *_detailSectionActions; }
-
This class functions as a table view model that is able to represent an array of any kind of objects and automatically generate its cells from these objects. In addition, ‘SCArrayOfObjectsModel’ generates its detail views from the properties of the corresponding object in its items array. Objects in the items array need not all be of the same object type, but they must all decend from NSObject.
‘SCArrayOfItemsModel’ will automatically generate a set of SCArrayOfObjectsSection(s) if the sectionHeaderTitleForItem modelAction is implemented, otherwise it will only generate a single SCArrayOfObjectsSection.
See moreDeclaration
Objective-C
@interface SCArrayOfObjectsModel : SCArrayOfItemsModel { NSString *searchPropertyName; }
-
This class functions as an SCTableViewModel section that is able to represent an array of any kind of objects and automatically generate its cells from these objects. In addition, ‘SCArrayOfObjectsSection’ generates its detail views from the properties of the corresponding object in its items array. Objects in the items array need not all be of the same object type, but they must all decend from NSObject. If more than one type of object is present in the items array, then their respective class definitions should be added to the itemsClassDefinitions set.
See
SCObjectSection, SCObjectCell.Declaration
Objective-C
@interface SCArrayOfObjectsSection : SCArrayOfItemsSection
-
SCArrayStore is an SCDataStore subclass that encapsulates NSArray memory storage, providing means for the SC framework to communicate with this array storage to fetch, add, update and remove data objects.
Note
It is very rare when you’ll need to create an SCArrayStore instance yourself, as it’s typically automatically created for you when you use data definitions such as SCClassDefinition and SCDictionaryDefinition. For example, when you use the SCArrayOfObjectsSection initializer method called [SCArrayOfObjectsSection sectionWithHeaderTitle:items:itemsDefinition:], SCArrayOfObjectsSection automatically sets its dataStore property by calling your itemsDefinition’s [SCDataDefinition generateCompatibleDataStore:] method.
Note
For more information on data stores, check out the SCDataStore base class documentation.
Declaration
Objective-C
@interface SCArrayStore : SCDataStore
-
This class provides as a badge view similar to the one used by iPhone’s mail application to display the number of messages in an inbox. SCBadgeView is typically used by SCTableViewCell to display these kind of badges.
Sample use: SCTableViewCell *cell = [SCTableViewCell cellWithText:@“Number of pending tasks”]; cell.badgeView.text = @“50”;
See also: SCTableViewCell
Declaration
Objective-C
@interface SCBadgeView : UILabel
-
This class hosts a set of cell action blocks. Once an action is set to a desired code block, it will execute the block as soon as the action occurs.
See
SCSectionActions, SCModelActions.Declaration
Objective-C
@interface SCCellActions : NSObject
-
This class functions as a means to further extend the definition of user-defined classes. Using class definitions, classes like SCObjectCell and SCObjectSection will be able to better generate user interface elements that truly represent the properties of their bound objects. For more information, please refer to SCDataDefinition.
Upon creation, SCClassDefinition will (optionally) automatically generate all the property definitions for the given class. From there, the user will be able to customize the generated property definitions, add new definitions, or remove generated definitions.
Sample use: // Extend the definition of ‘Task’ (user defined class) SCClassDefinition *taskDef = [SCClassDefinition definitionWithClass:[Task class] propertyNamesString:@“Task Details:(name,description,category,dueDate);Task Status:(completed)”]; SCPropertyDefinition *namePropertyDef = [taskDef propertyDefinitionWithName:@“name”]; namePropertyDef.required = TRUE; SCPropertyDefinition *descPropertyDef = [taskDef propertyDefinitionWithName:@“description”]; descPropertyDef.type = SCPropertyTypeTextView; SCPropertyDefinition *categoryPropertyDef = [taskDef propertyDefinitionWithName:@“category”]; categoryPropertyDef.type = SCPropertyTypeSelection; NSArray *categoryItems = [NSArray arrayWithObjects:@“Home”, @“Work”, @“Other”, nil]; categoryPropertyDef.attributes = [SCSelectionAttributes attributesWithItems:categoryItems allowMultipleSelection:NO allowNoSelection:NO];
See
SCDataDefinition.Declaration
Objective-C
@interface SCClassDefinition : SCDataDefinition
-
SCCoreDataFetchOptions further extends the SCDataFetchOptions subclass to control how data is fetched from SCCoreDataStore.
Note
For more information on fetch options, check out the SCDataFetchOptions documentation.Declaration
Objective-C
@interface SCCoreDataFetchOptions : SCDataFetchOptions { NSString *_orderAttributeName; }
-
SCCoreDataStore is an SCDataStore subclass that encapsulates Core Data persistent storage, providing means for the SC framework to communicate with this storage to fetch, add, update and remove data objects.
Note
It is very rare when you’ll need to create an SCCoreDataStore instance yourself, as it’s typically automatically created for you when you use the SCEntityDefinition data definition. For example, when you use the SCArrayOfObjectsSection initializer method called [SCArrayOfObjectsSection sectionWithHeaderTitle:entityDefinition:], SCArrayOfObjectsSection automatically sets its dataStore property by calling your entityDefinition’s [SCDataDefinition generateCompatibleDataStore:] method.
Note
For more information on data stores, check out the SCDataStore base class documentation.
Declaration
Objective-C
@interface SCCoreDataStore : SCDataStore
-
This class functions as a means to further extend the definition of user-defined data structures, such as classes and Core Data entities. This enables the framework to automatically generate user interfaces that accurately resemble these structures.
‘SCDataDefinition’ mainly consists of one or more property definitions of type SCPropertyDefinition. The property definitions can be placed in one or more property groups that will control how the properties are grouped when the user interface is generated. If no property groups are assigned, all property definitions are placed in a single defaultPropertyGroup.
See also: SCClassDefinition, SCDictionaryDefinition, SCEntityDefinition, SCWebServiceDefinition
Warning
This is an abstract base class and should never be directly instantiated.Declaration
Objective-C
@interface SCDataDefinition : NSObject <SCibInitialization> { NSMutableArray *propertyDefinitions; NSString *keyPropertyName; NSString *titlePropertyName; NSString *titlePropertyNameDelimiter; NSString *descriptionPropertyName; SCPropertyGroup *defaultPropertyGroup; SCPropertyGroupArray *propertyGroups; BOOL requireEditingModeToEditPropertyValues; }
-
This class is used to control how data is fetched from SCDataStore. SCDataFetchOptions can be configured to have the data sorted, filtered, and/or returned in batches.
Sample use: SCArrayOfObjectsModel *myObjectsModel = …; myObjectsModel.dataFetchOptions.sort = TRUE;
See also: SCDataStore, SCCoreDataFetchOptions, SCWebServiceFetchOptions
See moreDeclaration
Objective-C
@interface SCDataFetchOptions : NSObject { BOOL _sort; NSString *_sortKey; BOOL _sortAscending; BOOL _filter; NSPredicate *_filterPredicate; NSUInteger _batchSize; NSUInteger _batchStartingOffset; NSUInteger _batchCurrentOffset; }
-
SCDataStore is an abstract base class that can encapsulate any kind of data storage, providing means for the SC framework to communicate with this storage to fetch, add, update and remove data.
Several SCDataStore subclasses have been implemented to enable the SC framework to communicate with Core Data, web services, iCloud storage, and even NSUserDefaults storage. Feel free to subclass SCDataStore to enable any kind of data storage not currently implemented by framework.
Sample use: // Display all the TaskEntity objects SCCoreDataStore *coreDataStore = [SCCoreDataStore storeWithManagedObjectContext:context defaultEntityDefinition:TaskEntityDef]; SCArrayOfObjectsSection *tasksSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:@“Task Objects” dataStore:coreDataStore]; [self.tableViewModel addSection:tasksSection];
See also: SCArrayStore, SCCoreDataStore, SCWebServiceStore, SCiCloudStore, SCUserDefaultsStore
Note
At initialization time, SCDataStore must be assigned at least one default SCDataDefinition that fully defines its stored data objects.
Warning
SCDataStore is an abstract base class and should not be directly instantiated.
Declaration
Objective-C
@interface SCDataStore : NSObject { SCStoreMode _storeMode; NSObject *_storedData; SCDataDefinition *_defaultDataDefinition; NSMutableDictionary *_dataDefinitions; NSMutableArray *_uninsertedObjects; NSObject *_boundObject; NSString *_boundPropertyName; SCDataDefinition *_boundObjectDefinition; NSDictionary *_defaultsDictionary; }
-
Undocumented
See moreDeclaration
Objective-C
@interface SCMissingFrameworkDataDefinition : SCDataDefinition
-
Undocumented
See moreDeclaration
Objective-C
@interface SCMissingFrameworkDataStore : SCDataStore
-
This class functions as a means to represent the definition of an NSDate class.
This class is typically used when you need to work with a collection of NSDate objects in classes like SCArrayOfObjectsSection and SCArrayOfObjectsModel. The class automatically generates only one property definition representing how the NSDate automatically generated UI should be defined.
See moreDeclaration
Objective-C
@interface SCDateDefinition : SCDataDefinition
-
This class is used to specify options for automatically generated detail view controllers.
Use this class to specify options such has how the automatically generated detail views are presented, their navigation bar type, their title, and/or their table view style.
Sample use: SCArrayOfObjectsModel *myObjectsModel = …; myObjectsModel.detailViewControllerOptions.presentationMode = SCPresentationModeModal;
See moreDeclaration
Objective-C
@interface SCDetailViewControllerOptions : NSObject
-
This class functions as a means to further extend the key definitions of an NSMutableDictionary.
Using dictionary definitions, classes like SCObjectCell and SCObjectSection will be able to better generate user interface elements that truly represent the keys of their bound mutable dictionaries.
Sample use: // Define the dictionary using SCDictionaryDefinition SCDictionaryDefinition *dictionaryDef = [SCDictionaryDefinition definitionWithDictionaryKeyNamesString:@“key1;key2;key3”]; [dictionaryDef propertyDefinitionWithName:@“key2”].type = SCPropertyTypeSwitch; [dictionaryDef propertyDefinitionWithName:@“key3”].type = SCPropertyTypeSlider;
// Create some sample data NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; [dictionary setValue:@“Text” forKey:@“key1”]; [dictionary setValue:[NSNumber numberWithBool:YES] forKey:@“key2”]; [dictionary setValue:[NSNumber numberWithFloat:0.7f] forKey:@“key3”];
// Generate sections for the dictionary [self.tableViewModel generateSectionsForObject:dictionary withDefinition:dictionaryDef];
See
SCPropertyDefinition.Declaration
Objective-C
@interface SCDictionaryDefinition : SCDataDefinition
-
This class functions as a means to further extend the definition of user-defined Core Data entities. Using entity definitions, classes like SCObjectCell and SCObjectSection will be able to better generate user interface elements that truly represent the properties of their bound objects.
SCEntityDefinition mainly consists of one or more property definitions of type SCPropertyDefinition. Upon creation, SCEntityDefinition will (optionally) automatically generate all the property definitions for the given entity. From there, the user will be able to customize the generated property definitions, add new definitions, or remove generated definitions.
Sample use: // Extend the definition of ‘TaskEntity’ (user defined Core Data entity) SCEntityDefinition *taskDef = [SCEntityDefinition definitionWithEntityName:@“TaskEntity” managedObjectContext:context propertyNamesString:@“Task Details:(name,description,category,dueDate);Task Status:(completed)”]; SCPropertyDefinition *namePropertyDef = [taskDef propertyDefinitionWithName:@“name”]; namePropertyDef.required = TRUE; SCPropertyDefinition *descPropertyDef = [taskDef propertyDefinitionWithName:@“description”]; descPropertyDef.type = SCPropertyTypeTextView; SCPropertyDefinition *categoryPropertyDef = [taskDef propertyDefinitionWithName:@“category”]; categoryPropertyDef.type = SCPropertyTypeSelection; NSArray *categoryItems = [NSArray arrayWithObjects:@“Home”, @“Work”, @“Other”, nil]; categoryPropertyDef.attributes = [SCSelectionAttributes attributesWithItems:categoryItems allowMultipleSelection:NO allowNoSelection:NO];
See
SCPropertyDefinition.Declaration
Objective-C
@interface SCEntityDefinition : SCDataDefinition
-
SCExpandCollapseCell is a special cell class that, once tapped, collapses its owner section’s contents into a single cell. When tapped again, it will expand the section’s contents to their original state.
Sample use: mySection.expandCollapseCell = [SCExpandCollapseCell cellWithExpandText:@“Expand Section” collapseText:@“Collapse Section” ownerSectionExpanded:FALSE];
See also: SCTableViewSection
Note
SCExpandCollapseCell is always displayed at the top of the section.Declaration
Objective-C
@interface SCExpandCollapseCell : SCCustomCell
-
SCFetchItemsCell is a special cell that is automatically displayed by an SCArrayOfItemsSection when more section items need to be fetched. This is typically the case when the section’s dataFetchOptions property has specified a batchSize for the fetched items.
Sample use: myArrayOfObjectsSection.dataFetchOptions.batchSize = 10; myArrayOfObjectsSection.fetchItemsCell.textLabel.text = @“Load next batch”;
See also: SCArrayOfItemsSection
Note
SCExpandCollapseCell is always displayed at the bottom of the section.Declaration
Objective-C
@interface SCFetchItemsCell : SCCustomCell { UIActivityIndicatorView *_activityIndicator; BOOL _autoFetchItems; BOOL _autoHide; }
-
This class defines a set of internal helper methods
See moreDeclaration
Objective-C
@interface SCUtilities : NSObject
-
This class defines a tabel view model center.
Important
This class is usually only used internally by the framework.Declaration
Objective-C
@interface SCModelCenter : NSObject { CFMutableSetRef modelsSet; }
-
This special view provides an accessory view that automatically appears on top of the keyboard, providing navigation functionality between the different text controls. The view provides ‘Next’, ‘Previous’, and ‘Done’ buttons. It also provides a special ‘Clear’ button for cells such as SCDateCell.
Sample use: self.tableViewModel.inputAccessoryView.rewind = FALSE;
See also: SCTableViewModel
See moreDeclaration
Objective-C
@interface SCInputAccessoryView : UIView
-
This class hosts a set of model action blocks. Once an action is set to a desired code block, it will execute the block as soon as the action occurs.
See
SCSectionActions, SCCellActions.Declaration
Objective-C
@interface SCModelActions : NSObject
-
This class functions as a means to represent the definition of an NSNumber class.
This class is typically used when you need to work with a collection of NSNumber objects in classes like SCArrayOfObjectsSection and SCArrayOfObjectsModel. The class automatically generates only one property definition representing how the NSNumber automatically generated UI should be defined.
See moreDeclaration
Objective-C
@interface SCNumberDefinition : SCDataDefinition
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeObjectSelection, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCObjectSelectionAttributes : SCSelectionAttributes
-
Undocumented
See moreDeclaration
Objective-C
@interface SCPluginUtilities : NSObject + (id)objectForPluginDictionary:(NSDictionary *)pluginDictionary; @end
-
This class is an abstract base class that represents a set of SCPropertyDefinition attributes.
Each subclass of ‘SCPropertyAttributes’ is used to extend the definition of an SCPropertyDefinition instance according to its respective type. Set the attributes property of an SCPropertyDefinition instance to a subclass to be able to further customize the user interface element that will be generated for this property definition.
Note
You should never make instances of this class. Use subclasses instead.Declaration
Objective-C
@interface SCPropertyAttributes : NSObject { UIImageView *imageView; NSArray *imageViewArray; BOOL expandContentInCurrentView; SCSectionActions *_expandedContentSectionActions; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeTextView, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCTextViewAttributes : SCPropertyAttributes { CGFloat minimumHeight; CGFloat maximumHeight; BOOL editable; BOOL autoResize; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeTextField, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCTextFieldAttributes : SCPropertyAttributes { NSString *placeholder; BOOL secureTextEntry; UITextAutocorrectionType autocorrectionType; UITextAutocapitalizationType autocapitalizationType; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeNumericTextField, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCNumericTextFieldAttributes : SCTextFieldAttributes { NSNumber *minimumValue; NSNumber *maximumValue; BOOL allowFloatValue; NSNumberFormatter *numberFormatter; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeSlider, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCSliderAttributes : SCPropertyAttributes { float minimumValue; float maximumValue; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeSegmented, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCSegmentedAttributes : SCPropertyAttributes { NSArray *segmentTitlesArray; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeDate, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCDateAttributes : SCPropertyAttributes { NSDateFormatter *dateFormatter; UIDatePickerMode datePickerMode; BOOL displayDatePickerAsInputAccessoryView; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeSelection, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCSelectionAttributes : SCPropertyAttributes { SCDataStore *selectionItemsStore; SCDataFetchOptions *selectionItemsFetchOptions; BOOL allowMultipleSelection; BOOL allowNoSelection; NSUInteger maximumSelections; BOOL autoDismissDetailView; BOOL hideDetailViewNavigationBar; BOOL allowAddingItems; BOOL allowDeletingItems; BOOL allowMovingItems; BOOL allowEditingItems; NSObject *placeholderuiElement; NSObject *addNewObjectuiElement; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeObject, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCObjectAttributes : SCPropertyAttributes { SCDataDefinition *objectDefinition; }
-
This class is used to extend the definition of an ‘SCPropertyAttributes’ instance of type SCPropertyTypeArrayOfObjects, thus allowing further customization of the generated control by the user.
See moreDeclaration
Objective-C
@interface SCArrayOfObjectsAttributes : SCPropertyAttributes { SCDataDefinition *defaultObjectsDefinition; SCDataFetchOptions *objectsFetchOptions; BOOL allowAddingItems; BOOL allowDeletingItems; BOOL allowMovingItems; BOOL allowEditingItems; NSObject *placeholderuiElement; NSObject *addNewObjectuiElement; BOOL addNewObjectuiElementExistsInNormalMode; BOOL addNewObjectuiElementExistsInEdtingMode; SCSectionActions *_sectionActions; }
-
This class functions as a property definition for SCDataDefinition.
Every property definition should set a property type that determines which user interface element should be generated for the property. In addition, the generated user interface element can be further customized using the property’s attributes.
See
SCPropertyType, SCPropertyAttributes, SCClassDefinition, SCEntityDefinition, SCDictionaryDefinition.Declaration
Objective-C
@interface SCPropertyDefinition : NSObject { SCDataDefinition *ownerDataStuctureDefinition; SCDataType dataType; BOOL dataReadOnly; NSString *name; NSString *title; SCPropertyType type; SCPropertyAttributes *attributes; SCPropertyType editingModeType; SCPropertyAttributes *editingModeAttributes; BOOL required; BOOL autoValidate; BOOL existsInNormalMode; BOOL existsInEditingMode; BOOL existsInCreationMode; BOOL existsInDetailMode; }
-
This class functions as a property definition for SCDataDefinition that will generate a custom user inteface element (e.g.: custom cell).
‘SCCustomPropertyDefinition’ does not have to represent a property that actually exists in its class (unlike an SCPropertyDefiniton), and is often used in a structure definition as a placeholder for custom user interface element generation.
See
SCPropertyDefinition.Declaration
Objective-C
@interface SCCustomPropertyDefinition : SCPropertyDefinition
-
This class functions as a way to define a property definition group that is used to generate a corresponding user interface element that groups these properties (e.g.: a table view section).
Property definitions are added to this class using their NSString ‘name’ property.
See
SCPropertyDefinition, SCClassDefinition.Declaration
Objective-C
@interface SCPropertyGroup : NSObject { NSString *headerTitle; NSString *footerTitle; NSMutableArray *propertyDefinitionNames; }
-
Declaration
Objective-C
@interface SCPropertyGroupArray : NSObject { NSMutableArray *propertyGroups; }
-
This special view provides table views with the common pull-to-refresh functionality.
Once pull-to-refresh is enabled in the table view model, this view will automatically handle displaying the pull messsage, inform the model that the table view needs refreshing, and return back to normal state after the table view has done refreshing its contents.
Sample use: self.tableViewModel.enablePullToRefresh = TRUE; self.tableViewModel.pullToRefreshView.pullStateText = @“Pull to refresh tasks”; self.tableViewModel.pullToRefreshView.releaseStateText = @“Release to refresh tasks”; self.tableViewModel.pullToRefreshView.loadingStateText = @“Loading new tasks…”;
See also: SCTableViewModel
See moreDeclaration
Objective-C
@interface SCPullToRefreshView : UIView { UIScrollView *_boundScrollView; id _target; SEL _startLoadingAction; }
-
This class functions as a means to simplify creating view controllers dedicated to searching data within a table view.
In addition to all the features provided by its SCViewController superclass, SCSeachViewController conveniently provides a UISearchBar control and a UITableView control aligned under each other. In addition, SCSearchViewController defaults to automatically displaying a UISearchDisplayController when a search is performed.
Note
Both the UISearchBar and UITableView controls can still be created in Interface Builder and assigned to their respective outlets. In case no outlets are assigned, SCSearchViewController will automatically create the missing control(s).Declaration
Objective-C
@interface SCSearchViewController : SCViewController { UISearchBar *_searchBar; }
-
This class hosts a set of section action blocks. Once an action is set to a desired code block, it will execute the block as soon as the action occurs.
See
SCCellActions, SCModelActions.Declaration
Objective-C
@interface SCSectionActions : NSObject
-
This class functions as a means to represent the definition of an NSString class.
This class is typically used when you need to work with a collection of NSString objects in classes like SCArrayOfObjectsSection and SCArrayOfObjectsModel. The class automatically generates only one property definition representing how the NSString automatically generated UI should be defined.
See moreDeclaration
Objective-C
@interface SCStringDefinition : SCDataDefinition
-
This class functions as a cell for SCTableViewSection. SCTableViewCell is extensively subclassed to create cells with special controls such as UITextField and UISlider.
SCTableViewCell provides the user with the infrastructure to access the cell’s value using the Bound Object method. This works by binding the cell to an object, called the bound object, and to a property of this object, called the bound property. The cell initializes its value from the value of the bound property, and when its values changes, it sets the property back automatically.
Please note that even though a cell value is not applicable to SCTableViewCell itself, SCTableViewCell still provides the bound object functionality as a framework to all its subclasses to use.
See moreDeclaration
Objective-C
@interface SCTableViewCell : UITableViewCell <SCViewControllerDelegate, SCTableViewControllerDelegate> { NSString *reuseId; BOOL configured; SCTableViewModel *activeDetailModel; SCTableViewModel *ownerTableViewModel; SCTableViewSection *ownerSection; id ownerViewControllerDelegate; SCDataType boundPropertyDataType; BOOL _isCustomBoundProperty; CGFloat _height; BOOL editable; BOOL movable; BOOL selectable; BOOL enabled; BOOL autoDeselect; BOOL autoResignFirstResponder; UITableViewCellEditingStyle cellEditingStyle; SCBadgeView *badgeView; BOOL leadingSwipePerformsFirstActionWithFullSwipe; BOOL trailingSwipePerformsFirstActionWithFullSwipe; NSArray *detailCellsImageViews; BOOL valueRequired; BOOL autoValidateValue; BOOL commitChangesLive; BOOL needsCommit; BOOL beingReused; BOOL customCell; BOOL isSpecialCell; SCDetailViewControllerOptions *detailViewControllerOptions; NSString *themeStyle; }
-
This class functions as a base class for all user defined custom cells.
The following is a summary of each control that can be automatically bound, in addition to the corresponding boundObject property value type that it must be associated with:
- UILabel: NSString, NSNumber, NSDate
- UITextField: NSString, NSNumber, NSDate
- UITextView: NSString, NSNumber, NSDate
- UISlider: NSNumber, NSString
- UISegmentedControl: NSNumber, NSString
- UISwitch: NSNumber
- UIImage: NSString
Declaration
Objective-C
@interface SCCustomCell : SCTableViewCell <UITextViewDelegate, UITextFieldDelegate> { BOOL _pauseControlEvents; NSMutableDictionary *_objectBindings; BOOL _autoResize; BOOL _showClearButtonInInputAccessoryView; }
-
This class functions as a base class for all cells that require user controls to be present inside their content view.
See moreDeclaration
Objective-C
@interface SCControlCell : SCCustomCell { BOOL _boundValueLoaded; UIColor *_initialControlColor; CGFloat maxTextLabelWidth; CGFloat controlIndentation; CGFloat controlMargin; BOOL showClearButtonInInputAccessoryView; }
-
This class functions as a cell with a UILabel control. The bound property of this cell can be of any type the decends from NSObject.
See moreDeclaration
Objective-C
@interface SCLabelCell : SCControlCell
-
This class functions as a cell with a UITextView control. The bound property of this cell must be of type NSString.
See moreDeclaration
Objective-C
@interface SCTextViewCell : SCControlCell { CGFloat minimumHeight; CGFloat maximumHeight; }
-
This class functions as a cell with a UITextField control. The bound property of this cell must be of type NSString.
See moreDeclaration
Objective-C
@interface SCTextFieldCell : SCControlCell
-
This class functions as a cell with a UITextField control with numeric values. The bound property of this cell must be of type NSNumber, int, float, or double. SCNumericTextFieldCell defines its own validation rules according to the following criteria:
- Value is valid only if it’s a numeric value.
- If minimumValue is not nil, then value is only valid if it’s greater than or equal to this value.
- If maximumValue is not nil, then value is only valid if it’s less than or equal to this value.
- If allowFloatValue is FALSE, then value is only valid if it’s an integer value.
Declaration
Objective-C
@interface SCNumericTextFieldCell : SCTextFieldCell { NSNumber *minimumValue; NSNumber *maximumValue; BOOL allowFloatValue; BOOL displayZeroAsBlank; NSNumberFormatter *numberFormatter; }
-
This class functions as a cell with a UISlider control. The bound property of this cell must be of type NSNumber, int, float, or double.
See moreDeclaration
Objective-C
@interface SCSliderCell : SCControlCell
-
This class functions as a cell with a UISegmentedControl. The bound property of this cell must be of type NSNumber, int, or NSString.
See moreDeclaration
Objective-C
@interface SCSegmentedCell : SCControlCell
-
This class functions as a cell with a UISwitch control. The bound property of this cell must be of type NSNumber or BOOL.
See moreDeclaration
Objective-C
@interface SCSwitchCell : SCControlCell
-
This class functions as a cell that provides the end-user with a UIDatePicker to choose a date with. The bound property of this cell must be of type NSDate.
See moreDeclaration
Objective-C
@interface SCDateCell : SCLabelCell <SCViewControllerDelegate> { UITextField *_pickerField; UIViewController *_activePickerDetailViewController; UIDatePicker *datePicker; NSDateFormatter *dateFormatter; BOOL displaySelectedDate; }
-
This class functions as a cell that provides the end-user with an automatically generated detail view of type UIImagePickerController to pick an image with. As soon as the image is picked, it will be saved to the Documents folder using either an auto generated name from the current time stamp, or a name provided through SCTableViewModelDelegate or the cell’s actions. The bound property of this cell must be of type NSString, and will be bound to the name of the selected image. Once an image is selected, tapping an SCImagePickerCell will display the image in a detail view. To select a different image, the table view must be put in edit mode (make sure UITableView’s allowsSelectionDuringEditing property is TRUE). Alternatively, make sure that displayClearImageButtonInDetailView property is TRUE, and the user will be able to tap a “Clear Image” button to clear the selected image.
See moreDeclaration
Objective-C
@interface SCImagePickerCell : SCCustomCell <UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate, SCViewControllerDelegate, UIScrollViewDelegate> { UIImage *cachedImage; UIPopoverController *popover; UIImagePickerController *imagePickerController; NSString *placeholderImageName; NSString *placeholderImageTitle; BOOL displayImageNameAsCellText; BOOL askForSourceType; UIButton *clearImageButton; BOOL displayClearImageButtonInDetailView; BOOL autoPositionClearImageButton; BOOL autoPositionImageView; CGRect textLabelFrame; CGRect imageViewFrame; NSString *selectedImageName; }
-
This class functions as a cell that provides the end-user with an automatically generated detail view of options to choose from, much like the Ringtone selection cell in the iPhone’s sound settings. The selection items are provided in the form of an array of NSStrings, called the items array. ‘SCSelectionCell’ can be configured to allow multiple selection and to allow no selection at all. the bound property of this cell must be of type NSNumber, NSString, or NSMutableSet. If allowMultipleSelection is TRUE, then only NSString and NSMutableSet property types are allowed.
See
SCSelectionSection.Declaration
Objective-C
@interface SCSelectionCell : SCLabelCell { SCDataStore *selectionItemsStore; SCDataFetchOptions *selectionItemsFetchOptions; BOOL allowMultipleSelection; BOOL allowNoSelection; NSUInteger maximumSelections; BOOL autoDismissDetailView; BOOL hideDetailViewNavigationBar; BOOL allowAddingItems; BOOL allowDeletingItems; BOOL allowMovingItems; BOOL allowEditDetailView; BOOL displaySelection; NSString *delimeter; NSMutableSet *selectedItemsIndexes; SCTableViewCell *placeholderCell; SCTableViewCell *addNewItemCell; }
-
This class functions as a cell that provides the end-user with an automatically generated detail view of objects to choose from.
The selection items are provided in the form of an array of NSObjects, called the items array. ‘SCObjectSelectionCell’ 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 cell must be of type NSObject, otherwise it must be of type NSMutableSet.
See
SCObjectSelectionSection.Declaration
Objective-C
@interface SCObjectSelectionCell : SCSelectionCell { SCDataDefinition *intermediateEntityDefinition; }
-
This class functions as a cell that is able to automatically generate a detail view with cells generated from a given bound object’s properties.
If the bound object is given without an extended class definition (SCClassDefinition), then the cells will only be generated for properties of type NSString and NSNumber, and will be either of type SCTextFieldCell or SCNumericTextFieldCell, respectively. If an SCClassDefinition is provided for the bound object, a full fledged detail view of cells will be generated.
When SCObjectCell is selected by the end-user, a detail view optionally fires up to to give the user the ability to edit the object’s properties.
See
SCObjectSection, SCArrayOfObjectsSection.Declaration
Objective-C
@interface SCObjectCell : SCCustomCell { NSString *boundObjectTitleText; }
-
This class functions as a means to simplify development with SCTableViewModel.
SCTableViewController conveniently provides several ready made navigation bar types based on SCNavigationBarType, provided that it is a subview of a navigation controller. SCTableViewController also defines placeholders for a tableView and a tableViewModel that the user can allocate and assign. If a tableViewModel is defined, SCTableViewController also connects its doneButton (if present) to tableViewModel’s commitButton automatically.
In addition, SCTableViewController fully manages memory warnings and makes sure the assigned table view is released once a memory warning occurs and reloaded once the view controller is loaded once more.
Finally, SCTableViewController provides several useful actions (SCTableViewControllerActions) that notify the delegate object of events like the view appearing or disappearing.
See moreDeclaration
Objective-C
@interface SCTableViewController : UITableViewController <UISplitViewControllerDelegate, UIPopoverControllerDelegate>
-
This class hosts a set of view controller action blocks. Once an action is set to a desired code block, it will execute the block as soon as the action occurs.
SCTableViewControllerAction_Block syntax: action = ^(SCTableViewController *viewController) { // Your code here };
See moreDeclaration
Objective-C
@interface SCTableViewControllerActions : NSObject
-
This class is the master mind behind all of Sensible TableView’s functionality.
Sensible TableView provides an alternative easy way to create sophisticated table views very quickly. The sophistication of these table views can range from simple text cells, to cells with controls, to custom cells that get automatically generated from your own classes. SCTableViewModel also automatically generates detail views for common tasks such as selecting cell values or creating new objects. Using SCTableViewModel, you can easily create full functioning applications in a matter of minutes.
SCTableViewModel is designed to be loosely coupled with your user interface elements. What this means is that you can use SCTableViewModel with Apple’s default UITableView or with any of your custom UITableView subclasses. Similarly, you can use SCTableViewModel with any UIViewController, or any of its subclasses, including UITableViewController or your own subclasses.
Architecture:
An SCTableViewModel defines a table view model with several sections, each section being of type SCTableViewSection. Each SCTableViewSection can contain several cells, each cell being of type SCTableViewCell.
See moreDeclaration
Objective-C
@interface SCTableViewModel : NSObject <UITableViewDataSource, UITableViewDelegate, UIScrollViewDelegate, SCInputAccessoryViewDelegate> { NSIndexPath *lastReturnedCellIndexPath; SCTableViewCell *lastReturnedCell; NSIndexPath *lastVisibleCellIndexPath; id target; SEL action; SCTableViewModel *masterModel; SCTableViewModel *activeDetailModel; UITableView *_tableView; UIBarButtonItem *editButtonItem; BOOL autoResizeForKeyboard; BOOL keyboardShown; CGFloat keyboardOverlap; SCInputAccessoryView *_inputAccessoryView; NSMutableArray *sections; NSArray *sectionIndexTitles; BOOL autoGenerateSectionIndexTitles; BOOL autoSortSections; BOOL hideSectionHeaderTitles; BOOL lockCellSelection; NSInteger tag; BOOL enablePullToRefresh; SCTableViewCell *activeCell; NSIndexPath *activeCellIndexPath; UIResponder *activeCellControl; UIBarButtonItem *commitButton; BOOL swipeToDeleteActive; SCModelActions *_modelActions; SCSectionActions *_sectionActions; SCCellActions *_cellActions; SCTheme *_theme; }
-
This class subclasses SCTableViewModel to represent an array of any kind of items and will automatically generate its cells from these items. ‘SCArrayOfItemsModel will automatically generate a set of SCArrayOfItemsSection(s) if the sectionHeaderTitleForItem modelAction is implemented, otherwise it will only generate a single SCArrayOfItemsSection.
Warning
This is an abstract base class, you should never make any direct instances of it.
See
SCArrayOfStringsModel, SCArrayOfObjectsModel, SCArrayOfStringsSection, SCArrayOfObjectsSection.
Declaration
Objective-C
@interface SCArrayOfItemsModel : SCTableViewModel <SCTableViewControllerDelegate, UISearchBarDelegate, UISearchResultsUpdating> { SCArrayOfItemsSection *tempSection; NSArray *filteredArray; SCDataStore *dataStore; SCDataFetchOptions *dataFetchOptions; BOOL _loadingContents; BOOL sectionsInSync; NSMutableArray *items; BOOL autoFetchItems; BOOL itemsInSync; UITableViewCellAccessoryType itemsAccessoryType; BOOL allowAddingItems; BOOL allowDeletingItems; BOOL allowMovingItems; BOOL allowEditDetailView; BOOL allowRowSelection; BOOL autoSelectNewItemCell; SCDetailViewControllerOptions *detailViewControllerOptions; SCDetailViewControllerOptions *newItemDetailViewControllerOptions; UISearchBar *searchBar; }
-
This class functions as a table view model that is able to represent an array of string items and automatically generate its cells from these items. The class inherits all its funtionality from its superclass: SCArrayOfItemsModel, except that its items array can only contain items of type NSString. ‘SCArrayOfStringsModel will automatically generate a set of SCArrayOfStringsSection(s) if the sectionHeaderTitleForItem modelAction is implemented, otherwise it will only generate a single SCArrayOfStringsSection.
See moreDeclaration
Objective-C
@interface SCArrayOfStringsModel : SCArrayOfObjectsModel
-
This class functions as a model that is able to provide selection functionality. The cells in this model represent different items that the end-user can select from, and they are generated from NSStrings in its items array. Once a cell is selected, a checkmark appears next to it, similar to Apple’s Settings application where a user selects a Ringtone for their iPhone. The section can be configured to allow multiple selection and to allow no selection at all.
Since this model is based on SCArrayOfStringsModel, it supports automatically generated sections and automatic search functionality.
There are three ways to set/retrieve the section’s selection:
- Through binding an object to the model, and specifying a property name to bind the selection index result to. The bound property must be of type NSMutableSet if multiple selection is allowed, otherwise it must be of type NSNumber or NSString.
Through the selectedItemsIndexes or selectedItemIndex properties.
See
SCSelectionSection.
Declaration
Objective-C
@interface SCSelectionModel : SCArrayOfStringsModel { BOOL boundToNSNumber; BOOL boundToNSString; NSIndexPath *lastSelectedRowIndexPath; NSObject *boundObject; SCDataStore *boundObjectStore; NSString *boundPropertyName; BOOL allowMultipleSelection; BOOL allowNoSelection; NSUInteger maximumSelections; BOOL autoDismissViewController; NSMutableSet *_selectedItemsIndexes; }
-
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.Declaration
Objective-C
@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 section for SCTableViewModel. Every ‘SCTableViewSection’ can contain any number of SCTableViewCell(s).
See moreDeclaration
Objective-C
@interface SCTableViewSection : NSObject { SCTableViewModel *_ownerTableViewModel; NSObject *boundObject; SCDataStore *boundObjectStore; NSString *boundPropertyName; BOOL commitChangesLive; BOOL commitCellChangesLive; NSString *headerTitle; CGFloat headerHeight; UIView *headerView; NSString *footerTitle; CGFloat footerHeight; UIView *footerView; SCSectionActions *sectionActions; NSMutableArray *cells; SCCellActions *cellActions; NSArray *cellsImageViews; SCExpandCollapseCell *expandCollapseCell; SCDetailViewControllerOptions *detailViewControllerOptions; SCDetailViewControllerOptions *newItemDetailViewControllerOptions; NSString *themeStyle; NSString *firstCellThemeStyle; NSString *evenCellsThemeStyle; NSString *oddCellsThemeStyle; NSString *lastCellThemeStyle; }
-
This class functions as an SCTableViewModel section that is able to automatically generate its cells from a given bound object’s properties. If the bound object is given without an extended class definition (SCClassDefinition), then cells will only be generated for properties of type NSString and NSNumber, and will be either of type SCTextFieldCell or SCNumericTextFieldCell, respectively. If an SCClassDefinition is provided for the bound object, a full fledged section of cells will be generated.
@note: For your convenience, the tag property of each generated cell will have a number corresponding to the index of it’s corresponding property in bound object.
See
SCArrayOfObjectsSection, SCObjectCell.Declaration
Objective-C
@interface SCObjectSection : SCTableViewSection { SCPropertyGroup *propertyGroup; }
-
This class functions as an SCTableViewModel section that is able to represent an array of any kind of items and automatically generate its cells from these items. The section is also able to handle all end-user interaction with the generated cells, including adding, editing, deleting, and moving the cells. When cells are added or edited, detail views are automatically generated for this purpose. To enable adding cells, the class’ user should set the addButtonItem property of the section to a valid UIBarButtonItem, the section then will automatically add new items when the button is tapped.
When adding new items to the array, the section starts by first asking the model’s data source to provide a new item using its tableViewModel:newItemForArrayOfItemsSectionAtIndex: SCTableViewModelDataSource protocol method.
This class is an abstract base class. Subclasses of this class must override the buildDetailTableModel method. This method should return a model for the detail view to display.
Warning
This is an abstract base class, you should never make any direct instances of it.
See
SCArrayOfStringsSection, SCArrayOfObjectsSection.
Declaration
Objective-C
@interface SCArrayOfItemsSection : SCTableViewSection <SCViewControllerDelegate, SCTableViewControllerDelegate> { BOOL _isFetchingItems; BOOL itemsInSync; SCTableViewModel *activeDetailModel; NSMutableArray *cellReuseIdentifiers; NSObject *tempItem; SCDataStore *dataStore; SCDataFetchOptions *dataFetchOptions; BOOL autoFetchItems; UITableViewCellAccessoryType itemsAccessoryType; BOOL allowAddingItems; BOOL allowDeletingItems; BOOL allowMovingItems; BOOL allowEditDetailView; BOOL allowRowSelection; BOOL skipNewItemDetailView; BOOL autoSelectNewItemCell; NSString *cellIdentifier; UIBarButtonItem *addButtonItem; SCTableViewCell *placeholderCell; SCTableViewCell *addNewItemCell; BOOL addNewItemCellExistsInNormalMode; BOOL addNewItemCellExistsInEditingMode; }
-
This class functions as an SCTableViewModel section that is able to represent an array of string items and automatically generate its cells from these items. The class inherits all its funtionality from its superclass: SCArrayOfItemsSection, except that its items array can only contain items of type NSString.
See moreDeclaration
Objective-C
@interface SCArrayOfStringsSection : SCArrayOfObjectsSection
-
This class functions as an SCTableViewModel section that is able to provide selection functionality. The cells in this section represent different items that the end-user can select from, and they are generated from NSStrings in its items array. Once a cell is selected, a checkmark appears next to it, similar to Apple’s Settings application where a user selects a Ringtone for their iPhone. The section can be configured to allow multiple selection and to allow no selection at all.
There are three ways to set/retrieve the section’s selection:
- Through binding an object to the section, and specifying a property name to bind the selection index result to. The bound property must be of type NSMutableSet if multiple selection is allowed, otherwise it must be of type NSNumber or NSString.
- Through binding a key to the section and setting/retrieving through the ownerTableViewModel modelKeyValues property.
Through the selectedItemsIndexes or selectedItemIndex properties.
See
SCSelectionCell.
Declaration
Objective-C
@interface SCSelectionSection : SCArrayOfStringsSection { BOOL boundToNSNumber; BOOL boundToNSString; NSIndexPath *lastSelectedRowIndexPath; BOOL allowMultipleSelection; BOOL allowNoSelection; NSUInteger maximumSelections; BOOL autoDismissViewController; NSMutableSet *_selectedItemsIndexes; }
-
This class functions as a section that provides the end-user with an automatically generated list objects to choose from.
The selection items are provided in the form of an array of NSObjects, called the items array. ‘SCObjectSelectionSection’ 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 section must be of type NSObject, otherwise it must be of type NSMutableSet.
See
SCObjectSelectionCell.Declaration
Objective-C
@interface SCObjectSelectionSection : SCArrayOfObjectsSection { NSIndexPath *lastSelectedRowIndexPath; NSMutableSet *selectedItemsIndexes; BOOL allowMultipleSelection; BOOL allowNoSelection; NSUInteger maximumSelections; BOOL autoDismissViewController; SCDataDefinition *intermediateEntityDefinition; }
-
The SCTheme class enables CSS-like styling of UIView (or any of its subclasses). Using CSS-like text files, any UIView property with a supported data type can be set. Key-path property format is fully supported (e.g. layer.cornerRadius: 5). All pointer data types accept nil as value (e.g. backgroundView: nil;).
Supported property data types:
Data Type -> Format in .sct file
NSString* -> A string between single or double quotes. Example: detailTextLabel.text: “Hello World!”;
CGFloat -> A normal number. Example: height: 60;
BOOL -> Possible values: TRUE, FALSE, YES, NO. All case insensitive. Example: clipsToBounds: NO;
UIColor* -> Any UIColor color name constructor. Example: backgroundColor: blueColor; or rgb(redValue, greenValue, blueValue, optionalAlphaValue) Example: backgroundColor: rgb(100, 0, 255); or #hexValue Example: backgroundColor: #CC33FF or A string containing an image resource. Example: backgroundColor: “background.png”;
CGColorRef -> Format identical to UIColor. Example: layer.borderColor: redColor;
CGRect -> CGRect(x, y, width, height) Example: textLabel.frame: CGRect(10, 10, 180, 30);
CGSize -> CGSize(width, height) Example: textLabel.shadowColor: darkGrayColor; textLabel.shadowOffset: CGSize(1, 1);
UIImage* -> A string containing the image resource. Example: backgroundImage: “background.png” or A string containing the image resource and capInsets(top, left, bottom, right). Example: backgroundImage: “background.png” capInsets(0,0,0,0)
UIFont* -> Font name and size separated by a space. A good resource for font names is: http://iosfonts.com/ Example: textLabel.font: Courier-Bold 12;
UIView* -> A string containing an image resource that will be loaded into a UIImageView. Example: backgroundView: “background.png”;
UITableViewCellSeparatorStyle Any valid UITableViewCellSeparatorStyle constant. Example: separatorStyle: UITableViewCellSeparatorStyleNone;
Sample theme file: MyTheme.sct UINavigationBar { backgroundImage: “navbar-background.png”; }
UITableView { backgroundView: “leather-background.png”; }
SCTableViewSection { firstCellThemeStyle: firstCell; oddCellsThemeStyle: oddCell; evenCellsThemeStyle: evenCell; lastCellThemeStyle: lastCell; }
firstCell { backgroundView: “firstCell-background.png”; selectedBackgroundView: “selectedFirstCell-background.png”; }
oddCell { backgroundView: “oddCell-background.png”; selectedBackgroundView: “selectedOddCell-background.png”; }
evenCell { backgroundView: “evenCell-background.png”; selectedBackgroundView: “selectedEvenCell-background.png”; }
lastCell { backgroundView: “lastCell-background.png”; selectedBackgroundView: “selectedLastCell-background.png”; }
Sample code needed to use the above theme file: self.tableViewModel.theme = [SCTheme themeWithPath:@“MyTheme.sct”];
See moreDeclaration
Objective-C
@interface SCTheme : NSObject
-
This class functions as a means to define NSUserDefaults 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 NSUserDefaults.
Sample use: // Create the user defaults definition SCUserDefaultsDefinition *userDefaultsDef = [SCUserDefaultsDefinition definitionWithUserDefaultsKeyNamesString: @“Login Details:(username,password):Will be automatically signed in”]; SCPropertyDefinition *passwordDef = [userDefaultsDef propertyDefinitionWithName:@“password”]; passwordDef.attributes = [SCTextFieldAttributes attributesWithPlaceholder:nil secureTextEntry:YES autocorrectionType:UITextAutocorrectionTypeNo autocapitalizationType:UITextAutocapitalizationTypeNone];
// Generate the UI for the user defaults [self.tableViewModel generateSectionsForUserDefaultsDefinition:userDefaultsDef];
See
SCPropertyDefinition.Declaration
Objective-C
@interface SCUserDefaultsDefinition : SCDictionaryDefinition
-
SCUserDefaultsStore is an SCDataStore subclass that encapsulates the NSUserDefaults storage, providing means for the SC framework to communicate with this storage to fetch, add, update and remove user defaults.
Note
It is very rare when you’ll need to create an SCUserDefaultsStore instance yourself, as it’s typically automatically created for you when you use SCUserDefaultsDefinition. For example, when you use the SCTableViewModel method called [SCTableViewModel generateSectionsForUserDefaultsDefinition:], the model automatically sets its sections’ dataStore property by calling your userDefaultsDefinition’s [SCDataDefinition generateCompatibleDataStore:] method.
Note
For more information on data stores, check out the SCDataStore base class documentation.
Declaration
Objective-C
@interface SCUserDefaultsStore : SCDataStore
-
This class functions as a means to simplify development with SCTableViewModel.
SCViewController conveniently provides several ready made navigation bar types based on SCNavigationBarType, provided that it is a subview of a navigation controller. ‘SCViewController’ also defines placeholders for a tableView and a tableViewModel that the user can allocate and assign. If a tableViewModel is defined, SCViewController also connects its doneButton (if present) to tableViewModel’s commitButton automatically.
In addition, SCViewController fully manages memory warnings and makes sure the assigned table view is released once a memory warning occurs and reloaded once the view controller is loaded once more.
Finally, SCViewController provides several useful actions (SCViewControllerActions) and delegate methods (SCViewControllerDelegate) that notify the delegate object of events like the view appearing or disappearing.
Note
You do NOT have to use ‘SCViewController’ in order to be able to use SCTableViewModel, but it’s highly recommended that you do so whenever you need a UIViewController.Declaration
Objective-C
@interface SCViewController : UIViewController <UISplitViewControllerDelegate, UIPopoverControllerDelegate> { UITableView *_tableView; }
-
This class hosts a set of view controller action blocks. Once an action is set to a desired code block, it will execute the block as soon as the action occurs.
SCViewControllerAction_Block syntax: action = ^(SCViewController *viewController) { // Your code here };
See moreDeclaration
Objective-C
@interface SCViewControllerActions : NSObject