I want to include some third party code (specifically https://github.com/ortuman/SwiftForms) in my XCode 6 + Swift project. How do I do that?
2 Answers
Simply add the source .swift files to your project, (drag and drop to the file tree on the left hand side of Xcode - you can see the file tree here).
The files you'll need are here.
As stated on the github page: Swift projects is currently not supported by Cocoapods. Until support is available you should just clone the repository and drag the source folder into your project to use SwiftForms.
Once you have the source .swift files presenet in your Xcode project you can create a form as described in the documentation:
"Creating 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."
// Create form instace
let form = FormDescriptor()
form.title = "Example form"
// Define first section
let section1 = FormSectionDescriptor()
var row: FormRowDescriptor! = FormRowDescriptor(tag: "name", rowType: .Email, title: "Email")
section1.addRow(row)
row = FormRowDescriptor(tag: "pass", rowType: .Password, title: "Password")
section1.addRow(row)
// Define second section
let section2 = FormSectionDescriptor()
row = FormRowDescriptor(tag: "button", rowType: .Button, title: "Submit")
section2.addRow(row)
form.sections = [section1, section2]
self.form = form