{"id":18878692,"url":"https://github.com/oklemenz/okit","last_synced_at":"2025-04-14T18:32:24.690Z","repository":{"id":56921158,"uuid":"193877133","full_name":"oklemenz/OKit","owner":"oklemenz","description":"OKit - Model Based App Framework","archived":false,"fork":false,"pushed_at":"2020-01-07T19:10:04.000Z","size":35919,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T02:08:38.570Z","etag":null,"topics":["app","binding","inspectable","json","model","storyboard"],"latest_commit_sha":null,"homepage":"https://cocoapods.org/pods/OKit","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oklemenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-26T09:50:56.000Z","updated_at":"2024-03-29T23:03:07.000Z","dependencies_parsed_at":"2022-08-20T21:50:24.351Z","dependency_job_id":null,"html_url":"https://github.com/oklemenz/OKit","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklemenz%2FOKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklemenz%2FOKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklemenz%2FOKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklemenz%2FOKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oklemenz","download_url":"https://codeload.github.com/oklemenz/OKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248936897,"owners_count":21186121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app","binding","inspectable","json","model","storyboard"],"created_at":"2024-11-08T06:29:10.028Z","updated_at":"2025-04-14T18:32:19.679Z","avatar_url":"https://github.com/oklemenz.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OKit\n\n\u003e Easy to use application framework for Swift, to create apps based on models and storyboards with (almost) no code. \n\n**Core Features:**\n- Models and Entities\n- JSON storage (file, http)\n- Partials (partitions)\n- References\n- Complex Bindings\n- Invalidation\n- Data and Images (incl. inline)\n- Encryption\n- Application Shell\n- Slide-in menu\n- Settings\n- Face ID\n- Protection + Timeout\n- Theming (incl. dark theme)\n- Backups (secured)\n- Help Views\n- Re-use cells\n- Auto-key generation\n\n**Core Technologies:**\n- **Storyboard**: Application flow is designed with storyboards using model controllers and model controls\n- **Model**: Models are named data object and inherit from `Model`\n- **Model Entity**: Model entities are part of a model and inherit from `ModelEntity`\n- **Codable**: Models and model entities are automatically (de)serialized using `Codable` protocol\n- **Context**: Models and model entities can be used as context in model controllers and model controls\n- **Binding**: Model controller and model control properties can be bound to model binding paths \n- **KVC**: Key value coding is used to update model objects using `@objc` annotation\n- **Controller**: Model controllers are enabled for bindings and inherit from `ModelListTableController`,  `ModelDetailTableController` or subclasses\n- **Control**: Model controls and model cells are enabled for bindings, where latter inherits from  `ModelTableCell` or subclasses\n- **Inspectable**: Model controllers and model control are extended with `@IBInspectable` properties, maintainable in Interface Builder  \n\n## Usage\n\n### Installation: CocoaPods\n\nOKit is available through CocoaPods. To install it, add the following lines to your Podfile:\n\n```\n  use_frameworks!\n  pod 'OKit'\n```\n\n### Reference Example: Bookshop\n\nThe full-fledged OKit example project [Bookshop](/Examples/Bookshop) is available, showcasing every feature of the `OKit` framework.\n\n![OKit Demo Bookshop](okit_demo.gif) | \n--- |\n\n## Model\n\n### Model Definition\n\nThe model definition is based on Swift classes, inheriting from  `Model`, possibly including nested entities inheriting from `ModelEntity`.\nModel implicitly is also a (root) Model Entity and inherits all binding functionality.\n\n**The following Model types exists:**\n- `Model`: Model is read/stored as JSON to filesystem into `okit/data` folder of document directory using model name with `.json` extension \n- `ModelTransient`: Model is not read/stored (therefore handled transiently)\n- `ModelEncrypted`: Model is read/stored as encrypted binary to filesystem into `okit/data` folder of document directory using model name with `.json` extension  \n- `ModelHttp`: Model is read/stored as JSON via HTTP to configured endpoint (endpoint URL can be configured in `Info.plist` with key `OKitModelEndpointUrl`)\n- `ModelEncryptedHttp`: Model is read/stored as encrypted binary via HTTP to configured endpoint (endpoint URL can be configured in `Info.plist` with key `OKitModelEndpointUrl`)\n\n**Example:**\n\n```swift\n@objc(Shop)\nclass Shop: Model, Codable {\n    var id: String!\n    var books: [Book] = []\n}\n\n@objc(Book)\nclass Book: ModelEntity, Codable {\n    var id: String!\n    var name: String = \"\"\n    var date: Date = Date()\n    var marked: Bool = false\n    var icon: ModelImage?\n    var authors: [Author] = []\n}\n\n@objc(Author)\nclass Author: ModelEntity, Codable {\n    var id: String!\n    var name: String = \"\u003cNew Author\u003e\"\n}\n```\n\n**Explanations:**\n- `@objc` keyword shall be used, in order to allow dynamic instantiation and key-value-observing (KVO) by model controllers in Swift to support binding.\n- Models and model entities that shall be de(serialized) to JSON must conform to `Codable` protocol\n- Automatic JSON de(serialization) with `Codable` protocol does not work for inherited properties and need to be handled manually using  `Encoder` and `Decoder`  protocols\n- Property `var id: String!` is filled automatically with a UUID by framework, and is mandatory for supporting references to the model entities\n\n### Model Registration\n\nA model can be registered with the `Model` class and an optional name:\n \n```swift\nModel.initialize(window, secure: true) {\n    self.shop = Model.register(Shop.self)\n    self.catalog = Model.register(Catalog.self, \"catalog\")\n}\n```\n\nIf name is omitted, the model is registered as default model with the implicit name `default`.\nThe registration shall be done in  `application:didFinishLaunchingWithOptions` of `AppDelegate`.\nModel instances can be stored in the application context for later access.\n\n### Store Model\n\nA model can be stored calling `Model.store(...)` on the model instance:\n\n```swift\nModel.store(self.shop)\n```\n\n### Define Model State\n\nIn order to update all models together within a state, the following is registered:\n\n```swift\nModel.state() {\n    Model.store(self.shop)\n    Model.store(self.settings)\n}\n```\n\nThe state definition shall be done in  `application:didFinishLaunchingWithOptions` of `AppDelegate`.\nThis supports switching between encrypted/non-encrypted persistence and enables backup/import functionality.\n\n### Store Model State\n\nThe models state can be stored with: \n\n```swift\nModel.storeState()\n```\n\nStoring can be done e.g. in  `applicationDidEnterBackground` of `AppDelegate`.\n\n### Restore Model State\n\nThe models state can be restored with: \n\n```swift\nModel.restoreState()\n```\n\nStoring can be done e.g. in  `applicationWillEnterForeground` of `AppDelegate`.\n\n## Model Entity\n\nModel entities define the properties and corresponding types to be stored. Model entities conformable to `Codable` are serialized to and deserialized from JSON.  \nModel entities can again recursively contain array, map, set or single references of model entities again. Binding is supported for model entities to controllers and controls.  \n\n### Model Binding\n\nUI controllers and UI controls can be bound to model entities (context) using the following binding definitions:\n\n**Type** | **Syntax** | **Example** | **Description**\n--- | --- | --- | --- |\nConstant | # |  `#true` | Constants of type String, Bool, Int, Float, Double (cannot be combined with other types)\nLocalized Constant | % |  `%xyz` | Constants of type String interpreted as localized string key\nModel | \u003e |  `xyz\u003e` | Identifies model name, if omitted `default` model is used\nPath | / | `x/y` | Separates path segments\nAbsolute | / | `/x/y/z` | Processing starts from model root (ignoring current context)\nRelative | / | `x/y/z` | Processed relatively to the current context\nSelf | . | `/./` | Stays on current context\nParent | .. |  `/../` | Traverses parent relation relatively to current context\nRoot | \\\u003c or ~ |  `/~/` | Traverses to root relation (model) from current context\nBool Negation | ! |  `!/xy` | Negates value of binding in context of Boolean retrieval (only at front of binding allowed)\nReference | $ | `$xyz`| Identifies a reference context, i.e. the string value behind, is used to look up target context (model entity) using `ref()` function\nFunction | fn() | `xyz()`| Execute function on current context\nFunction with Parameter | fn(...) | `xyz(/a/b)` | Executes function on current context with parameter binding\nIndex | [] | `xy[0]/z`| Access current array context by index\nKeyPath | .@ | `a.b.c@avg.d` | Executes `KeyPath` expression on current context according to Swift language\nMultiple | , | `x/y,/a/b` | Executes multiple bindings separated by comma ','. Use  `getAll()` in code to fetch array of binding results\n\nA complex binding example looks as follows:\n\n`m1\u003e/a/$b/../c()/d[1]/e(/a)/f.g.@avg.h`\n\nTo use special binding characters in a text string, those characters could be escaped by using the unicode representation. \nE.g. a comma is represented by **\\u{002c}**.\n\n### Extension Function Binding \n\nFunctions and properties of core data types (e.g. Number, String, Date...) can be accessed within a binding:\n\nExamples:\n\n- `authors.@count/suffixPlural(#entry)`: The number returned by `@count` is suffixed by a translatable and pluralized string. \n- `%Price: ,price/round2, %EUR`: Multiple part binding adding the currency to the price value\n- `name/initial`: String extension to return the first character of name\n- `date/formatRelativeDate`: Date extension to format the date as relative date\n\nAny Swift/Obj-C type can be extended with additional function and properties, and be used in binding expressions.\n\n### Model Entity Invalidation\n\nUpdating a model entity by binding or respective `get`, `set`, `call` functions programatically, triggers an invalidation mechanism (unless `suppressInvalidate` is specified).\nThe invalidation notifies all bound controllers and controls for updating their content. \n\n### Model Entity Reuse \n\n- `ModelRef`: Reuse model entity for storing entity references\n- `ModelData`: Reuse model entity for storing arbitrary binary data. Data is stored separately according to model type (file, http, encrypted, transient) and read lazily\n- `ModelImage`: Reuse model entity for storing model images. Image data is stored separately according to model type (file, http, encrypted, transient) and read lazily\n- `ModelInlineData`: Reuse model entity for storing abitrary data. Data is stored inline into model entity JSON data\n- `ModelInlineImage`: Reuse model entity for storing model images. Image data is stored inline into model entity JSON data\n- `ModelSettings`: Reuse model entity for storing application model settings (e.g. theme, encryption, protection, ...)\n\n### Model Entity References\n\nA model entity can be referenced, by using model entity library `ModelRef`. \n\n**Example:**\n\n```swift\n@objc(Book)\nclass Book: ModelEntity, Codable {\n\n    var id: String!\n    var name: String = \"\"\n    var author: ModelRef = ModelRef()\n    \n}\n```\n\nModel entity `Book` references the model entity `Author` by its key (`ID`). Author is therefore not stored as composition, but only the \nreference key is stored as foreign key in Book. Both entities must be in the same model entity partial (see next section) \nin order be able to resolve the reference lazily via property `book.author.ref`.\n\n### Model Entity Partials\n\nA model partitioning (partials) can be established by inheriting from `ModelPartial` and by implementing the `sync` and `store` functions.  \n\n**Example:**\n\n```swift\n@objc(GroupDefer)\nclass GroupDefer: ModelPartial, Codable {\n    var id: String!\n    var name: String = \"\" {\n        didSet {\n            group?.name = name\n        }\n    }\n    var group: Group? {\n        get {\n            return try? retrieve(Group.self)\n        }\n        set {\n            assign(newValue)\n        }\n    }\n\n    override func sync(entity: ModelEntity) {\n        name = (entity as! Group).name\n    }\n\n    override func store() {\n        try? store(group)\n    }\n}\n\n@objc(Group)\nclass Group: ModelEntity, Codable {\n    var id: String!\n    var name: String = \"\"\n}\n```\n\nEntity `Group` is resolved lazily within partial `GroupDefer` by reading/storing from a different URL. \nFunction `sync` and `didSet` can be used to two-way sync properties available in both entities (e.g. `name`).\nFunction  `store` is called to store the partition data.\n\n### Model Entity Lifecycle Hooks\n\n#### Managed Hook\n\nCallback function `managed` can be overridden to implement lifecycle hook, when model entity is part of a context, \ni.e. parent entity or collection property of parent entity. \n\n```swift\nopen dynamic func managed(_ context: Any? = nil) {\n    // ...\n}\n```\n\nContext can be the parent entity or a collection of the parent entity.\n\n#### Unmanaged Hook\n\nCallback function `unmanaged` can be overridden to implement lifecycle hook, when model entity is removed from a context.\n\n```swift\nopen dynamic func unmanaged(_ context: Any? = nil) {\n    // ...\n}\n```\n\nContext can be the parent entity or a collection of the parent entity.\n\n## Storyboards/Controllers\n\nUser-Interfaces are built with storyboards, using standard `View Controllers` and `Table View Controller` by setting the following model classes as custom class:\n\n- `ModelListTableController`: Represents a list controller of model entities\n- `ModelDetailTableController`: Represents the details controller of a model entity\n- `ModelSelectionTableController`: Displays a selection list controller for selecting single or multiple model entities\n- `ModelApplicationController`: Represents the application environment for slide-in menu and protection support\n- `ModelMenuTableController`: Represents the menu controller visible in the slide-in menu container\n- `ModelSettingsTableController`: Represents the settings controller, to show model settings\n- `ModelBackupTableController`: Represents the backup controller, to create and import backups\n- `ModelSecureBackupTableController`: Represents the secure backup controller, to create and import secure backups\n\nModel controllers have `@IBInspectable` properties defined, that are interpreted by Interface Builder to enhance the Attributes Inspector side pane.\n\nModel controllers can inherit from `ModelBaseTableController` to get common binding functionality. \nOf course, each model controller can be further sub-classed for more use-case specific functionality.\n\nEven usage of storyboards are recommended, UIs can also be built programmatically using the model controllers directly in code.\n\n### Storyboard Identifiers \n\n#### Model Cell\n\nAlways use cell identifier `model` for dynamic prototype cells using model classes in storyboard. \n\n#### Model Segue\n\nAlways use segue identifier `model` for segue between model table and model detail table in storyboard.\n\n## \\\u003cabstract\\\u003e Model Base Table\n\nThe model base table controller contains binding logic, etc., common to all model controllers.\n\nThe following `@IBInspectable` properties exist on the model table `ModelBaseTableController`:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ncontextPath | Context path for bindings | Yes | Controller | ModelEntity |\npromptPath | Binding path to navigation prompt | Yes | Navigation Item | String |\ntitlePath | Binding path to navigation title | Yes | Navigation Item | (Attributed)String |\ntitleTap | Binding path to navigation title tap | Yes | Navigation Item | Function |\ntitleCount | Binding path to navigation title count number | Yes | Navigation Item | Int |\nsubTitlePath | Binding path to navigation sub-title | Yes | Navigation Item | (Attributed)String |\nsubTitleObject | Binding path to navigation sub-title object name | Yes | Navigation Item | String |\nsubTitleObjectPlural | Binding path to navigation sub-title object plural name | Yes | Navigation Item | String |\nsubTitleSwap | Binding path to flag, specifying if title and sub-title are swapped | Yes | Navigation Item | Bool | #false\nedit | Binding path to flag, controlling edit button visibility | Yes | Navigation Bar | Bool | #true\neditEnabled | Binding path to flag, controlling table row editing support | Yes | Table Row | Bool | #true\neditInherit | Binding path to flag, specifying if editing state is inherited from preceding controller | Yes | Controller | Bool | #false\neditAlways | Binding path to flag, specifying if editing state is always enabled | Yes | Controller | Bool | #false\nhelp | Binding path to flag, controlling the help button visibility | Yes | Navigation Bar | Bool | #true\nforceUpdate | Binding path to flag, specifying if table is updated on invalidation, although modification was triggered from this controller | Yes | Controller | Bool | #true\n\n## Model List Table\n\nThe model list table controller  `ModelListTableController` displays a list of model entities in a table view controller.\n\nThe following `@IBInspectable` properties exist on the model table `ModelListTableController`:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ntype | Binding path to list type | No | Controller | String |\ntypeName | Binding path to list type name | No | Controller | String |\ndataPath | Binding path to table data | Yes | Table | Array\\\u003cModelEntity\\\u003e, Set\\\u003cModelEntity\\\u003e  |\nrowSort | Binding path to property, table data is sorted by | Yes | Table | String | \nrowSortAsc | Binding path to flag, specifying if data is sorted ascending | Yes | Table | Bool | #true\ngroup | Binding path to property, table data is grouped by | Yes | Table | String |\ngroupName | Binding path to a property representing a readable name for the group property | Yes | Table | String |\ngroupSort | Binding path to a flag, specifying if the groups are sorted | Yes | Table | Bool | #true\ngroupSortAsc | Binding path to a flag, specifying if the groups are sorted ascending | Yes | Table | Bool | #true\nreorder | Binding path to a flag, specifying if reordering is allowed for table | Yes | Table | String | #false\nreorderEnabled | Binding path to a flag, specifying if reordering is allowed for a table row | Yes | Table Row | String | #true\ntap | Binding path to row tap | Yes | Table Row | Function |\ntapEdit | Binding path to row tap in edit mode | Yes | Table Row | Function |\nselectPath  | Binding path to multiple selection event during editing | Yes | Table Row | Function |\nrefresh | Binding path to flag, controlling visibility of refresh control | Yes | Table | Bool | #true\nsearch | Binding path to flag, controlling visibility of search bar | Yes | Search Bar | Bool | #true\nsearchPath | Binding path to property used for searching in entity | Yes | Search Bar | String | description\nsearchFilterPath | Binding path to property used for filtering in entity | Yes | Search Bar | String | \nsearchFilters | Multipart binding path to search bar scope buttons | Yes | Search Bar | String |\nindex | Binding path to flag, controlling visibility of A-Z index | Yes | Table | Bool | #false\nadd | Binding path to flag, controlling visibility of add button | Yes | Navigation Bar | Bool | #true\naddAppend | Binding path to flag, specifying if new entries are appended or inserted at top | Yes | Navigation Bar | Bool | #false\naddName | If non-empty, it enables a \"new entry\" dialog, where the property specifies the text field label | No | Controller | String |\naddNav | Binding path to flag, specifying if detail navigation to newly created entity is triggered | Yes | Controller | Bool | #false\nnavEnabled | Binding path to flag, specifying if navigation is allowed for table row | Yes | Table Row | Bool | #true\ndelete | Binding path to flag, specifying if row deletion is allowed for table | Yes | Table | Bool | #true\ndeleteEnabled | Binding path to flag, specifying if row deletion is allowed for table row | Yes | Table Row | Bool | #true \ndeletePrompt | Binding path to flag, controlling visibility of a delete prompt dialog | Yes | Controller | Bool | #true\nmore | Binding path to flag, specifying if more button in row is available for table | Yes | Table | Bool | #false\nmoreEnabled | Binding path to flag, specifying if more button in row is available for table row | Yes | Table Row | Bool | #true\nmoreTap | Binding path to more button tap | Yes | Table Row | Function |\nmoreActions | Multipart binding path to more action-sheet action names | Yes | Action Sheet | String |\nmoreActionsEnabled | Multipart binding path to more action-sheet actions enablement | Yes | Action Sheet | Bool |\nmoreActionsTap | Multipart binding path to more action sheet actions tap | Yes | Action Sheet | Function |\nquickName | Binding path to quick action name | Yes | Table | String |\nquickImage | Binding path to quick action image | Yes | Table | UIImage |\nquickEnabled | Binding path to flag, specifying if quick action is enabled for table row | Yes | Table Row | Bool | #true\nquickTap | Binding path to quick button tap | Yes | Table Row | Function |\nautoDeselect | Binding path to flag, specifying if row is auto deselected after tap | Yes | Table Row | Bool | #true\nforceListUpdate | Binding path to flag, specifying if list table is updated on invalidation, although modification was triggered from this controller | Yes | Controller | Bool | #false\nactivityTop | Binding path to activity indicator top margin value | Yes | Table | Float | #20.0\nactivity | Binding path to activity indicator visibility | Yes | Table | Bool | #false\n\n## Model Detail Table\n\nThe model detail table controller `ModelDetailTableController` displays details of one model entity in a table view controller.\n\nThe following `@IBInspectable` properties exist on the model table `ModelDetailTableController`:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nsectionHeaders | Multipart binding path to section headers | Yes | Table | String | \nsectionFooters | Multipart binding path to section footers | Yes | Table | String |\ntap | Binding path to row tap | Yes | Table Row | Function |\ntapEdit | Binding path to row tap in edit mode | Yes | Table Row | Function |\naccyTap | Binding path to accessory tap | Yes | Table Row | Function |\naccyEditTap | Binding path to accessory tap in edit mode | Yes | Table Row | Function |\nautoDeselect | Binding path to flag, specifying if row is auto deselected after tap | Yes | Table Row | Bool | #true\nsectionsShowDisplay | Multipart binding path to flags, controlling section visibility | Yes | Table | Bool | \nsectionsShowEdit | Multipart binding path to flags, controlling section visibility in edit mode | Yes | Table | Bool |\n\n## Model Selection Table (Model List Table)\n\nThe model selection table controller  `ModelSelectionTableController` displays a list of model entities for selecting a single or multiple model entities in a table view controller.\n\nThe following `@IBInspectable` properties exist on the model table `ModelSelectionTableController`:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nrefType | Binding path to selection reference type | No | Controller | String |\nrefTypeName | Binding path to selection reference type name | No | Controller | String |\nselectionContextPath | Binding path to selection context | Yes | Controller | ModelEntity |  \nselectionPath | Binding path to selection references in selection context | Yes | Controller | ModelRef, Array\\\u003cModelRef\\\u003e, Set\\\u003cModelRef\\\u003e |\nselectAppend | Binding path to flag, specifying if selection references are appended or inserted at top | Yes | Controller | Bool | #false\nunique | Binding path to flag, specifying if same entity can be selected multiple times | Yes | Controller | Bool | #true\nunselect | Binding path to flag, specifying if selecting an already selected entity does unselect it | Yes | Controller | Bool | #true\nclear | Binding path to flag, specifying if clear button is available | Yes | Navigation Bar | Bool | #true\nclose | Binding path to flag, specifying if close button is available | Yes | Navigation Bar | Bool | #true\nautoClose | Binding path to flag, specifying if selection does auto-close selection table | Yes | Controller | Bool | #false\n\n## Model Application \n\nThe model application controller `ModelApplicationController` displays the application environment including content and slide-in menu area.\nIt shows the model menu table and controls content display based on storyboard identifier.  \n\nThe following `@IBInspectable` properties exist on the model table `ModelApplicationController`:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nstoryboardName | Default storyboard name | No | Controller | String | Main\nmenuIdentifier | Storyboard controller identifier for menu | No | Controller | String | menu\nhomeIdentifier | Storyboard controller identifier for home/default content | No | Controller | String | home\npopGesture | Flag to specify if interactive pop gesture is allowed on content controller  | No | Controller | Bool | false  \ncontextPath | Context path for bindings | Yes | Controller | ModelEntity |\nthemeName | Binding path to theme name | Yes | Controller | String | \nencryption | Binding path to encryption flag | Yes | Controller | Bool | #true\nprotection | Binding path to protection flag | Yes | Controller | Bool | #true\nprotectionTimeout | Binding path to  protection timeout (in minutes) | Yes | Controller | Int | #5\nprotectionCover | Binding path to protection cover visibility flag | Yes | Controller | Bool | #true\nprotectionImage | Binding path to protection cover image | Yes | Controller | UIImage |\nprotectionText | Binding path to protection cover text | Yes | Controller | String |\nmenuHideStatusBar | Binding path to flag, specifying if status bar is hidden when  | Yes | Controller | String |\n\n### Protection\n\nApplication can be protected by Face ID, if activated in the model settings. When protection is active a protection cover is shown, to hide sensitive application data below, when leaving the application. The protection timeout specified in minutes, if a re-authentication with Face ID is needed to suspend protection cover.\n\n## Model Menu Table (Model List Table)\n\nThe model menu table controller `ModelMenuTableController` displays the menu in the model application controller. \nIt is used to show content via storyboard identifier, depending on the menu selection.\n\nThe following `@IBInspectable` properties exist on the model table `ModelMenuTableController`:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nstoryboardName | Default storyboard name | No | Controller | String | Main\nidentifier | Storyboard controller identifier for default target navigation  | No | Controller | String |\nrowIdentifier | Storyboard controller identifier for row accessory tap | No | Cell | String |\nhideMenu | Flag to specify, if menu is closed after navigation | No | Cell | Bool | true\n\n### Model Menu Bar Button Item\n\nA `UIBarButtonItem` representing a menu button (incl. burger icon), that can be used out-of-the box.\n\n## Menu Settings Table (Model Detail Table)\n\nThe model settings table controller `ModelSettingsTableController` displays the model settings in the model application controller.\nModel detail table controller bindings against the  `ModelSettings` entity shall use `ModelSettingsTableController` base class, \nas settings invalidation for theme, encryption, protection, etc. is then handled automatically. \n\n## Model Backup Table\n\nThe model backup table  `ModelBackupTableController` displays a list of model backups. Furthermore, new backups can be created, or existing backups can be deleted. During backup all models are exported. Selecting a backup triggers the import of an existing backup, which overrides the current models after showing a confirmation popup.\n\nBackups are stored in `okit/backup` folder of document directory. \n\n### Model Secure Backup Table\n\nThe model secure backup table  `ModelSecureBackupTableController`  enables a security popup, for entering the passcode for backup creation and backup import:  \n\n```swift\nopen func dataToBackup(sourceURL: URL, targetURL: URL, name: String, password: String) throws -\u003e Bool\n```\nFunction `dataToBackup` e.g. can be overridden in sub-class to create and copy a password-protected zip file.\n\n```swift\nopen func backupToData(sourceURL: URL, targetURL: URL, name: String, password: String) throws -\u003e Bool\n```\n\nExports are temporarily stored in `okit/export` folder of document directory, to be further processed by backup logic.\nFunction `backupToData` e.g. can be overridden in sub-class to extract password-protected zip file and copy to target.\n\n## Model Theming\n\nA built-in theming concept is available. Central class is `ModelTheme`. There are two out-of-the box themes:\n\n- `ModelTheme.defaultTheme`: iOS default theme\n- `ModelTheme.darkTheme`: A default dark theme provided by framework\n\n### Custom Theme\n\nOwn custom themes can be created and registered in the `ModelTheme` class with function:\n\n```swift\npublic static func register(theme: ModelTheme, name: String)\n```\n\nThemes can be set at the model application using model binding or by explicitly using `func applyTheme(_ theme: ModelTheme?)`. \n\n## Model Controls\n\n### \\\u003cabstract\\\u003e Model View\n\nAbstract base class for view-based controls, supporting model binding.\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ncontextPath | Context path for bindings | Yes | Control | ModelEntity |\n\n### Model Help View\n\nA help view can be connected to `IBOutlet helpView` for list and detail model controller. It handles displaying of modal help view and discarding. \nHelp view content can be statically modeled in storyboard or dynamically by sub-classing model help view.\n\n### Model Label\n\nBindable representation of an `UILabel`\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ncontextPath | Context path for bindings | Yes | Label | ModelEntity |\ntextPath | Binding path to label text | Yes | Label | (Attributed)String |\nshowPath | Binding path to label visibility | Yes | Label | Bool |\n\n### Model Button\n\nBindable representation of an `UIButton`\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ncontextPath | Context path for bindings | Yes | Button | ModelEntity |\niconPath | Binding path to button icon | Yes | Button | UIImage |\ntitlePath | Binding path to button title | Yes | Button | String |\ntapPath | Binding path to button tap | Yes | Button | Function |\nshowPath | Binding path to button visibility | Yes | Button | Bool |\nenabledPath | Binding path to label enabled state | Yes | Button | Bool |\n\n### Model Bar Button Item\n\nBindable representation of an `UIBarButtonItem`. \nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ncontextPath | Context path for bindings | Yes | Bar Button Item | ModelEntity |\ntapPath | Binding path to tap | Yes | Bar Button Item | Function |\nenabledPath | Binding path to enabled state | Yes | Bar Button Item | Bool | \n\n### Model Menu Bar Button Item\n\nA `UIBarButtonItem` representing a menu button (inc. burger icon), that can be used out-of-the box.\n\n## Model Cells\n\n### Table Cell\n\nBindable representation of an `UITableViewCell`.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ncontextPath | Context path for bindings | Yes | Cell | ModelEntity |\npath | Binding path to text label text | Yes | Text Label | (Attributed)String |\ndetailPath | Binding path to detail text label text | Yes | Detail Text Label | (Attributed)String |\nimagePath | Binding path to image view image | Yes | Image View | UIImage |\nribbonColor | Context path for cell ribbon color | Yes | Cell | Color |\neditPath | Binding path to text label text in edit mode | Yes | Text Label | (Attributed)String |\neditDetailPath | Binding path to detail text label text in edit mode | Yes | Detail Text Label | (Attributed)String |\neditImagePath | Binding path to image view image in edit mode | Yes | Image View | UIImage |\neditRibbonColor | Context path for cell ribbon color in edit mode| Yes | Cell | UIColor | \naccyPath | Binding path to accessory type | Yes | Cell Accessory Type | AccessoryType, Int |\naccyIcon | Binding path to accessory view button icon | Yes | Cell Accessory View Button | UIImage |\naccyText | Binding path to accessory view button text | Yes | Cell Accessory View Button | String |\naccyTap | Binding path to accessory view tap | Yes | Cell Accessory View  | Function |\naccyShow | Binding path to accessory view visibility | Yes | Cell Accessory View | Bool | #true\naccyEnabled | Binding path to accessory view button enablement | Yes | Cell Accessory View Button | Bool | #true\naccyEditPath | Binding path to accessory type in edit mode | Yes | Cell Accessory Type | AccessoryType, Int |\naccyEditIcon | Binding path to accessory view button icon in edit mode | Yes | Cell Accessory View Button | UIImage |\naccyEditText | Binding path to accessory view button text in edit mode | Yes | Cell Accessory View Button | String |\naccyEditTap | Binding path to accessory view tap in edit mode | Yes | Cell Accessory View  | Function |\naccyEditShow | Binding path to accessory view visibility in edit mode | Yes | Cell Accessory View | Bool | #true\naccyEditEnabled | Binding path to accessory view button enablement in edit mode | Yes | Cell Accessory View Button | Bool | #true\nheightDisplay | Binding path to cell height | Yes | Cell | Float |\nheightEdit | Binding path to cell height in edit mode | Yes | Cell | Float |\nheightSelect | Binding path to cell height in select mode | Yes | Cell | Float | \nshowDisplay | Binding path to cell visibility | Yes | Cell | Bool | #true\nshowEdit | Binding path to cell visibility in edit mode | Yes | Cell | Bool | #true\nselectNextRow | Binding path to next (positive) / previous (negative) cell index to delegate selection | Yes | Cell | Int | \nselectNextAccent | Binding path to accent coloring during next row selection | Yes | Cell | Bool | #true\n\n### \\\u003cabstract\\\u003e Edit Cell (Table Cell)\n\nBindable representation of an editable  `UITableViewCell`.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nreadOnly | Binding to control read-only state | Yes | Control | Bool | #false\ncontrolInDisplay | Binding to show/hide control in display mode  | Yes | Control | Bool | #true\n\n### Switch Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UISwitch` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nonPath | Binding path to switch isOn property | Yes | Switch | Bool |\n\n### Text Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UITextField` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ntextPath | Binding path to text field text | Yes | Text Field | String |\nplaceholder | Binding path to text field placeholder | Yes | Text Field | String | \nsecure | Binding path to text field secure text entry | Yes | Text Field | Bool | #false\n\n### Date Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UIDatePicker` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ndatePath | Binding path to date control date | Yes | Date Picker | Date |\nminDatePath | Binding path to date control minimum date | Yes | Date Picker | Date |\nmaxDatePath | Binding path to date control maximum date | Yes | Date Picker | Date |\nmodePath | Binding path to date control mode | Yes | Date Picker | UIDatePicker.Mode, Int | #2\n\n### Multiline Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UITextView` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ntextPath | Binding path to text view text | Yes | Text View | String |\nplaceholder | Binding path to text view placeholder  | Yes | Text View | String |\n\n### Segment Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UISegmentedControl` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nsegmentsPath | Multipart binding path to segments | Yes | Segmented Control | String |\nselectIndexPath | Binding path to segment selection index | Yes | Segmented Control | Int |\nwidth | Binding path to control width | Yes | Segmented Control | Float | #200\n\n### Picker Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UIPickerView` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\ndataPath | Binding path to picker data | Yes | Picker View | Array\\\u003cModelEntity\\\u003e, Set\\\u003cModelEntity\\\u003e | \nnamePath | Binding path to picker data row name property | Yes | Picker View Row | String | \nselectionPath | Binding path to picker selection | Yes | Picker View | Int |\n\n### Slider Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UISlider` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nvaluePath | Binding path to value | Yes | Slider | Float |\nminValuePath | Binding path to minimum value | Yes | Slider | Float | #0\nmaxValuePath | Binding path to maximum value | Yes | Slider | Float | #1\nminImagePath | Binding path to minimum value image | Yes | Slider | UIImage |  \nmaxImagePath | Binding path to maximum value image | Yes | Slider | UIImage |\nwidth | Binding path to control width | Yes | Slider | Float | #150\n\n### Stepper Cell (Edit Cell)\n\nBindable representation of an  `UITableViewCell` containing an `UIStepper` control.\nThe following `@IBInspectable` properties exist:\n\n**Name** | **Description** | **Bindable** | **Context** | **Type** | **Default**\n--- | --- | --- | --- | --- | --- |\nvaluePath | Binding path to value | Yes | Stepper | Double |\nminValuePath | Binding path to minimum value | Yes | Stepper | Double | #0\nmaxValuePath | Binding path to maximum value | Yes | Stepper | Double | #100\nstepValuePath | Binding path to step value | Yes | Stepper | Double |  #1\n\n## Model Help View\n\nA help view can be connected to `IBOutlet helpView`.\n\n## Model Inheritance\n\nAny model entities, controllers and controller can be inherited and functions overridden to change default behavior, as most definitions are marked as `open` and `public`. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklemenz%2Fokit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foklemenz%2Fokit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklemenz%2Fokit/lists"}