Giter Club home page Giter Club logo

swiftforms's People

Contributors

alexbartisro avatar carlson avatar davidyao avatar designerken avatar evgeniyd avatar florentdouine avatar garynewby avatar hab avatar im47cn avatar mitchins avatar moathothman avatar mqshen avatar ortuman avatar osramek avatar padotj avatar posinglife avatar radimhalfar avatar rjsamson avatar vrwim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftforms's Issues

Form on ViewController

HI, Im using storyboards and my forms works with UITableViewController but I want my form on a ViewController, I can't make it work, always get:

2014-12-26 17:08:54.648 DashPress[56575:5932120] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "uow-b7-lA0-view-7XT-Sf-C3R" nib but didn't get a UITableView.'

Style FormSectionDescriptor ?

Thanks for such a robust class. I'm using a row's configuration to set style attributes of my form - like so:
row.configuration[FormRowDescriptor.Configuration.CellConfiguration] = ...

Is there a way to style the header labels for each FormSectionDescriptor ?

Inline Select (date, etc)

Are there any plans or suggestions for adding selectors like date and time inline (calendar app, etc), rather than sliding up from the bottom? I realize sliding from the bottom is the default functionality in iOS, and sliding down subsequent rows and displaying the selector directly beneath the field is not simple functionality to add. I've gone through the pain of doing this in the past. What are your thoughts on this functionality being part of this library?

Thanks for the great project.

unable to update the values of form cells

I have a scenario where a user may select auto-fill a form by copying a record. I can successfully retrieve the record, but I'm not sure how to go about setting the form row values and having those values reflected in the UI.

The approach I am using presently is to iterate over the rows in each section and setting row.value to my value.

Any tips would be greatly appreciated.

Sincerely,
@padotj

How can I make the picker disappear?

How can I make the picker disappear when tapping elswhere on the screen? (i.e. outside any other formcells)

usually something like:

`override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {

            self.view.endEditing(true)

        }`

works, but I don't know where to put it to get it work...
Any ideas?

btw: this is a great piece of coding! Thanks for sharing!

THX!
Kinzi

Customize FormSectionDescriptor

Is it possible to customize the FormSectionDescriptor for example setting the footer text to center and add a UIImageView?

Open modal UIViewController

XLForm can open modal UIViewController by clicking on a line in the form which has an arrow to the right.

Is it possible to do something like this with SwiftForms?

Preloaded text returning a null

I'm pushing data from one view controller to the FormViewController but the form returns a null when the text is prefilled. Is there a way around this?

var row: FormRowDescriptor! = FormRowDescriptor(tag: Static.emailTag, rowType: .Email, title: "Email")
row.configuration[FormRowDescriptor.Configuration.CellConfiguration] = ["textField.text" : "[email protected]", "textField.textAlignment" : NSTextAlignment.Right.rawValue]

screen shot 2015-06-20 at 11 53 30 pm

Cannot enter more than one character in a password field

Rows with .Password as RowType cannot handle more than one character. I have tested this on an iPhone 5, iPad retina and the simulator. I have not found a way to fix/circumvent this bug.

Tested on Xcode 6.1.1 and Yosemite 10.10.1; using SDK 8.1 on iOS 8.1.2

How do I init a subclass of FormViewController

I have a subclass SettingController: FormViewController. I do not use a Storyboard or interfacebuilder.

How can I init the subclass in code?

I tried

init() {
    super.init(style: UITableViewStyle.Grouped)
    self.form = getForm()
}

but this raised the error:

fatal error: use of unimplemented initializer 'init(nibName:bundle:)' for class 'Test.SettingController'

Why the class can't be recognized when i try to add a picker cell with two component?

I add a new swift file like 'FormPickerCell' named 'FormTwoComponentPickerCell'. I want to use picker with two components.
I extend FormRowType also as follows
enum FormRowType {
...
case Picker
case TwoComponentPicker
...
}

When i add this new class to FormViewController in function defaultCellClassForRowType like
Static.defaultCellClasses[FormRowType.TwoComponentPicker] = FormTwoComponentPickerCell.self

Xcode says 'Use of unresolved identifier 'FormTwoComponentPickerCell''.
By the way, the new class added just the same as FormPickerCell except class name.

Could any one give me a hit? thanks.

Impossible to use programmatically

Have not been able to use this programmatically. I had to create the view controller in a storyboard to use it which was very frustrating.

Dynamic array of choices for .Picker

From the example in the docs you have to have a predetermined array of choices for the switch statement. Is it possible to have a dynamic array using a for loop or something?

Simulator can't be launched because it is already in use

Hi @ortuman,

first of all: Great lib, I wish it would work for me as it is really useful for setting up settings.

As soon as I start using your code (see below example), I can't restart the next debugging session anymore (Cmd + R). I'll get the following popup:

Uploading Screen Shot 2014-12-01 at 00.30.15.png . . .

Then I have to restart Simulator and Xcode in order to get it working again. This happens every time.

Also when I stop the session manually it crashes without exception.

I use the table view controller as a modal popup. The navbar buttons are linked with interface builder to the actions. Did you experience this behavior yourself already? Any idea? Thanks in advance.

import Foundation
import UIKit

class FilterViewController: FormViewController {

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        let form = FormDescriptor()

        let section1 = FormSectionDescriptor()

        section1.headerTitle = "Test"

        var row: FormRowDescriptor! = FormRowDescriptor(tag: "test", rowType: .Email, title: "Email")
        row.cellConfiguration = ["textField.placeholder" : "[email protected]", "textField.textAlignment" : NSTextAlignment.Right.rawValue]
        section1.addRow(row)

        form.sections = [section1]

        self.form = form
    }

    @IBAction func handleCancel() {
        println("close")
        dismissViewControllerAnimated(true, nil)
    }

    @IBAction func handleApply() {
        println("save")
        dismissViewControllerAnimated(true, nil)
    }

}

Why are values saved in arrays if allowsMultipleSelection is off?

This was causing some issues in my code, I think single values should be saved as that value. To fix just change
formCell.rowDescriptor.value = NSMutableArray(object: optionValue)
to
formCell.rowDescriptor.value = optionValue
in FormOptionsSelectorController.swift

CocoaPods support

@ortuman CocoaPods 0.36-pre adds support for Swift :)

It'd be great if SwiftForms can be submitted to CocoaPod's master repo, what do you think?

How to set picker value?

Hey, could you please tell me if there is a way to set a picker value to one of its options? If the picker itself were exposed I could use something like 'picker.selectRow', but I don't see it? Thank you!

Unset date picker value

Hi, thank you for great library! I'm trying to figure out how to unset already set date picker value. For example birthday in example form application. Thank you.

MultilineText getting null

Hi I have a form with 3 objects, .Email .MultipleSelector .MultilineText and a .Button.

If I only fill the MultiLineText I get Null on it, but If I fill any other I get the value from the MultiLineText

How to preload fields from database?

Instead of using the placeholder fields I would like to pre-fill the fields directly from the database. How would I do that? Thanks for the help.

ImagePicker Support

I will appreciate if you can add ImagePicker support from gallery and with camera just like FXForms

Cocoapods upgrade

How do I use this as a pod? I'm upgrading to Swift 2 and have no idea how to upgrade this also.

FormDescriptor#validateForm not public

FormDescriptor#validateForm is not public.

There does not seem to be a built-in way to validate fields based on FormRowDescriptor.Configuration.Required.

Is this intentional?

// SwiftForms/descriptors/FormDescriptor.swift

func validateForm() -> FormRowDescriptor! {
    for section in sections {
        for row in section.rows {
            if let required = row.configuration[FormRowDescriptor.Configuration.Required] as? Bool {
                if required && row.value == nil {
                    return row
                }
            }
        }
    }
    return nil
}

dynamic row addition?

Hi is there a simple way of adding form rows dynamically based on something picked in previous row?

Unwrapping optional error.

I just tried to use Swift Forms on a tableview without a navigation controller, and I got this error. Maybe we need to check for the UINavigationItem, before unwrapping the optional.
screen shot 2014-11-14 at 1 01 46 pm

Programmatically setting a value for MultipleSelector

Hey, I am trying to set a value using a MultipleSelector row, and can't figure out how to select one of the values by doing something such as row.value = "example"

In my code its for the purpose of editing an item after creating it.

In the example:

row = FormRowDescriptor(tag: Static.categories, rowType: .MultipleSelector, title: "Categories")
row.configuration[FormRowDescriptor.Configuration.Options] = [0, 1, 2, 3, 4]
row.configuration[FormRowDescriptor.Configuration.AllowsMultipleSelection] = true
row.configuration[FormRowDescriptor.Configuration.TitleFormatterClosure] = { value in
switch( value ) {
case 0:
return "Restaurant"
case 1:
return "Pub"
case 2:
return "Shop"
case 3:
return "Hotel"
case 4:
return "Camping"
default:
return nil
}
} as TitleFormatterClosure

if I was to do:
row.titleForOptionValue("Restaurant");
or row.titleForOptionValue(0);
or row.value = "Restaurant"
or row.title = "Restaurant"
Then the selected option still shows up as nothing

How can I get it so that it displays one of the options by default when the form loads?

Thanks

How to attach action to button?

Hi,
I haven't found a way to attach any action to a tap of a FormButtonCell (and the example adds a button but doesn't react to it being tapped).
Shouldn't there be an option to attach a closure or a selector to it somewhere?
Thank you!

Cannot make changes after using row.value

Hi, great plugin. I am using something similar to the category list to have multiple selections, I would like to have some or all checked since the form will be in edit mode. It works great for setting the selected but I can no longer make any changes to the field. The following is my row for my medical app. I appreciate any help.

I am using swift 1.2 with xcode 6.3.2 and targeted for ios 8 >

    row = FormRowDescriptor(tag: Static.incidents, rowType: .MultipleSelector, title: "Incidents")
    row.configuration[FormRowDescriptor.Configuration.Options] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
    row.configuration[FormRowDescriptor.Configuration.AllowsMultipleSelection] = true
    row.value = [4,8]
    row.configuration[FormRowDescriptor.Configuration.TitleFormatterClosure] = { value in
        switch( value ) {
        case 1:
            return "Meds - missed or refused to take"
        case 2:
            return "Missed meal / ate little or nothing"
        case 3:
            return "Unmanaged urinary incontinence"
        case 4:
            return "Unmanaged bowel incontinence"
        case 5:
            return "Stumble/near-fall"
        case 6:
            return "Fall"
        case 7:
            return "Alcohol/substance abuse during visit"
        case 8:
            return "Emergency room visit"
        case 9:
            return "Violent behavior, struck caregiver, pulled hair"
        case 10:
            return "Unable to rise (new event)"
        case 11:
            return "Unable to go up/down stairs (new event)"
        case 12:
            return "Notable increase in bathroom trips"
        case 13:
            return "Notable decline in ADL capacity"
        case 14:
            return "Increased confusion"
        case 15:
            return "Increased agitation or combativeness"
        case 16:
            return "Increased listlessness or depression"
        default:
            return nil
        }
        } as TitleFormatterClosure

    // row.value = [4,8] <-- Tried here too but same result....
    section2.addRow(row)

Code Sign error: No code signing identities found: No valid signing identities

Hello guys, i'm having this issue and i really dont know how to fix it!, any idea?

Check dependencies

Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found.
CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.4'

Thank you

How to use programmatically with custom init?

I need to pass a value on init, and instantiate the FormViewController subclass in code.

I have this in my subclass:

init(UUID: String)
{
super.init(nibName: nil, bundle: nil);
self.UUID = UUID
self.loadForm()
}

required init(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
}

It calls the custom init, but I get this error:

assertion failed: self.form property MUST be assigned!: file /Users/ransom/jobs/sendcontact/sendcontact-ios/SwiftForms/SwiftForms/Source/controllers/FormViewController.swift, line 62

Is use of a storyboard required? Is there some other super.init i can call?

If I call super.init(syle: .Grouped) I get this error:

fatal error: use of unimplemented initializer 'init(nibName:bundle:)' for class 'SendContact.CardFormController'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.