{"id":15132043,"url":"https://github.com/ortuman/swiftforms","last_synced_at":"2025-09-29T00:30:59.951Z","repository":{"id":21753857,"uuid":"25075831","full_name":"ortuman/SwiftForms","owner":"ortuman","description":"A small and lightweight library written in Swift that allows you to easily create forms.","archived":true,"fork":false,"pushed_at":"2021-02-23T09:15:25.000Z","size":5959,"stargazers_count":1324,"open_issues_count":35,"forks_count":210,"subscribers_count":68,"default_branch":"master","last_synced_at":"2025-09-21T16:06:41.384Z","etag":null,"topics":["carthage","cocoapods","dictionary","forms","selector-controllers","swift","swiftforms"],"latest_commit_sha":null,"homepage":null,"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/ortuman.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":"2014-10-11T11:38:02.000Z","updated_at":"2025-09-16T06:00:48.000Z","dependencies_parsed_at":"2022-08-17T19:50:11.215Z","dependency_job_id":null,"html_url":"https://github.com/ortuman/SwiftForms","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/ortuman/SwiftForms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortuman%2FSwiftForms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortuman%2FSwiftForms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortuman%2FSwiftForms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortuman%2FSwiftForms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ortuman","download_url":"https://codeload.github.com/ortuman/SwiftForms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortuman%2FSwiftForms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277450938,"owners_count":25819971,"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","status":"online","status_checked_at":"2025-09-28T02:00:08.834Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["carthage","cocoapods","dictionary","forms","selector-controllers","swift","swiftforms"],"created_at":"2024-09-26T04:02:27.616Z","updated_at":"2025-09-29T00:30:59.946Z","avatar_url":"https://github.com/ortuman.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Version](https://img.shields.io/badge/pod-1.8.4-orange.svg)](http://cocoadocs.org/docsets/SwiftForms)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n[![License](https://img.shields.io/badge/license-MIT-gray.svg)](http://cocoadocs.org/docsets/SwiftForms)\n[![Platform](https://img.shields.io/badge/platform-iOS-lightgrey.svg)](http://cocoadocs.org/docsets/SwiftForms)\n\nSwiftForms\n==========\n\nPurpose\n-------\nSwiftForms is a powerful and extremely flexible library written in Swift that allows to create forms by just defining them in a couple of lines. It also provides the ability to customize cells appearance, use custom cells and define your own selector controllers.\n\nHere is an screenshot from an example application using SwiftForms\n\n![Screenshot of Example application](SwiftFormsApplication/Example.gif)\n\nHow to create a form\n--------------------\n\nCreating a form using SwiftForms is pretty straightforward. All you need is to derive your controller from `FormViewController` and define a `FormDescriptor` instance along with its sections and rows. Here is an example of how to create a simple form to input an email and a user password.\n\n```swift\n\n// Create form instace\nvar form = FormDescriptor()\nform.title = \"Example form\"\n\n// Define first section\nvar section1 = FormSectionDescriptor()\n\nvar row = FormRowDescriptor(tag: \"name\", rowType: .Email, title: \"Email\")\nsection1.rows.append(row)\n\nrow = FormRowDescriptor(tag: \"pass\", rowType: .Password, title: \"Password\")\nsection1.rows.append(row)\n\n// Define second section\nvar section2 = FormSectionDescriptor()\n\nrow = FormRowDescriptor(tag: \"button\", rowType: .Button, title: \"Submit\")\nsection2.rows.append(row)\n\nform.sections = [section1, section2]\n\nself.form = form\n```\nTo see a more complex form definition you can take a look to the example application.\n\nCell appearance\n----------------------\n\nEvery row descriptor has a `configuration` dictionary that allows to customize cell's appearance and behavior. In order to change concrete visual aspects of a row simply set `row.configuration.cell.appearance` value to a dictionary containing custom key-value coding properties.\n\nHere's an example:\n\n```swift\nrow.configuration.cell.appearance = [\"titleLabel.font\" : UIFont.boldSystemFontOfSize(30.0), \"segmentedControl.tintColor\" : UIColor.redColor()]\n```\n\nCustom cells\n-----------------\n\nIn addition, it is possible to create 100% custom cells by deriving from `FormBaseCell` class. In that case, don't forget to override `configure` and `update` methods. First method will be called only once and after cell has been created, and the second one every time cell content should be refreshed.\n\nHere are the methods that help you to define custom cell behavior.\n```swift\nfunc configure() {\n    /// override\n}\n\nfunc update() {\n    /// override\n}\n\nclass func formRowCellHeight() -\u003e CGFloat {\n    return 44.0\n}\n\nclass func formViewController(formViewController: FormViewController, didSelectRow: FormBaseCell) {\n}\n```\nOnce you have defined your custom cell, and in order to use it for a concrete row, you'll have to set `FormRowDescriptor` cellClass property.\n\nCustom selector controllers\n-------------------------------------\n\nIn order to customize selector controller your class should conform to `FormSelector` protocol. That way you'll have access to the cell instance that pushed the controller, being able to alter its properties or setting it's row value accordingly to user interaction.\n\nAfter defining your class, don't forget to set `row.configuration.selection.controllerClass` value in the configuration dictionary to use your custom selector controller.\n\nRequirements\n---------------------\n\n* iOS 8.0 and above\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.\n\nCocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate SwiftForms into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\npod 'SwiftForms'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n\nSimply add the following line to your `Cartfile`:\n\n```\ngithub \"ortuman/SwiftForms\"\n```\n\nThen run:\n\n```bash\n$ carthage update\n```\n\nFor more information on [Carthage](https://github.com/Carthage/Carthage) see the [README](https://github.com/Carthage/Carthage/blob/master/README.md)\n\nCopyright\n---------\n\nSwiftForms is originally based on XLForm github project. (https://github.com/xmartlabs/XLForm)\n\nCheck LICENSE file for more details.\n\nContact\n-------\n\nIf you are using SwiftForms in your project and have any suggestion or question:\n\nMiguel Angel Ortuño, \u003cortuman@gmail.com\u003e\n\n[@ortuman](http://twitter.com/ortuman)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortuman%2Fswiftforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fortuman%2Fswiftforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortuman%2Fswiftforms/lists"}