SCPropertyDefinition

@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.

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.

Creation and Initialization

  • Allocates and returns an initialized ‘SCPropertyDefinition’ given a property name. *

    • - parameter: propertyName The name of the property.

    Declaration

    Objective-C

    + (instancetype)definitionWithName:(NSString *)propertyName;
  • Allocates and returns an initialized ‘SCPropertyDefinition’ given a property name, title, and type. *

    • - parameter: propertyName The name of the property.
    • - parameter: propertyTitle The title of the property. Property titles are used by user interface elements to generate labels associated with the generated controls.
    • - parameter: propertyType The property type determines which user interface element will be generated for the property.

    Declaration

    Objective-C

    + (instancetype)definitionWithName:(NSString *)propertyName
                                 title:(NSString *)propertyTitle
                                  type:(SCPropertyType)propertyType;
  • Returns an initialized ‘SCPropertyDefinition’ given a property name. *

    • - parameter: propertyName The name of the property.

    Declaration

    Objective-C

    - (instancetype)initWithName:(NSString *)propertyName;
  • Returns an initialized ‘SCPropertyDefinition’ given a property name, title, and type. *

    • - parameter: propertyName The name of the property.
    • - parameter: propertyTitle The title of the property. Property titles are used by user interface elements to generate labels associated with the generated controls.
    • - parameter: propertyType The property type determines which user interface element will be generated for the property.

    Declaration

    Objective-C

    - (instancetype)initWithName:(NSString *)propertyName
                           title:(NSString *)propertyTitle
                            type:(SCPropertyType)propertyType;

Configuration

  • The owner data structure definition of the property definition. *

    • - warning: This property gets set automatically by the framework, you should never set this property manually.

    Declaration

    Objective-C

    @property (nonatomic, weak) SCDataDefinition *ownerDataStuctureDefinition;
  • The name of the property associated with the property definition.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *name;
  • The title of the property. Property titles are used by user interface elements to generate labels associated with the generated controls.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *title;
  • The type of the property. Property types determines which user interface element will be generated for the property.

    Declaration

    Objective-C

    @property (nonatomic) SCPropertyType type;
  • The attibutes set associated with the type of the property. Property attributes gives the user the ability to further customize the user interface element that will be generated for the given property type.

    Declaration

    Objective-C

    @property (nonatomic, strong) SCPropertyAttributes *attributes;
  • The set of cell action blocks.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SCCellActions *cellActions;
  • The type of the property while in editing mode. Property types determines which user interface element will be generated for the property while in editing mode.

    Note

    If not set (or set to SCPropertyTypeUndefined), the value set in the “type” property is used in editing mode.

    Declaration

    Objective-C

    @property (nonatomic) SCPropertyType editingModeType;
  • The attibutes set associated with the editingModetype of the property. Property attributes gives the user the ability to further customize the user interface element that will be generated for the given property editingModetype.

    Declaration

    Objective-C

    @property (nonatomic, strong) SCPropertyAttributes *editingModeAttributes;
  • Set to TRUE if property is a required property. Default: FALSE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL required;
  • Set to TRUE if the property value should be automatically validated by the user interface element before commiting it to the property. If the user chooses to provide custom validation using either the cell’s actions, or the model’s SCTableViewModelDelegate, they should set this property to FALSE. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL autoValidate;
  • If set to TRUE, a user interface is generated for the property when the owning control is in Normal Mode, otherwise, no UI is generated in that mode. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL existsInNormalMode;
  • If set to TRUE, a user interface is generated for the property when the owning control is in Editing Mode, otherwise, no UI is generated in that mode. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL existsInEditingMode;
  • If set to TRUE, a user interface is generated for the property when the UI is generated for a newly created object, otherwise, no UI is generated. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL existsInCreationMode;
  • If set to TRUE, a user interface is generated for the property when the UI is generated for an existing object, otherwise, no UI is generated. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL existsInDetailMode;

Custom UI

  • The class of the custom user interface element the property will generate. Set this property to override the standard user interface element generated by the property’s ‘type’. *

    • - note: No need to set if ‘uiElementNibName’ contains a valid value.

    Declaration

    Objective-C

    @property (nonatomic, strong) Class uiElementClass;
  • The Nib name of the custom user interface element the property will generate. Set this property to override the standard user interface element generated by the property’s ‘type’. *

    • - note: Do not include the ‘.xib’ extension when providing the nib name.
    • - note: If the NIB is a SwiftPM resource then the name should use a PACKAGE_TARGET_Name format.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *uiElementNibName;
  • This dictionary specifies how each of the uiElementClass or uiElementNibName custom controls binds itself to the definition’s properties. Each dictionary key should be the tag string value of one of the uiElement’s custom controls, and the value should be the name of the definition’s property that is bound to that control.

    Warning

    IMPORTANT: All control tags must be greater than zero.

    Note

    This property can be used interchangibly with objectBindingsString

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDictionary *objectBindings;
  • This string specifies how each of the uiElementClass or uiElementNibName custom controls binds itself to the definition’s properties. The string should consist of a colon separated pair of control’s tag and the property name, while each pair should be separated by a semi-colon.

    Example bindings string: NSString *bindingsString = @“1:firstName;2:lastName”;

    Warning

    IMPORTANT: All control tags must be greater than zero.

    Note

    This property can be used interchangibly with objectBindings

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *objectBindingsString;

Internal