smallseo.info

FXForms

FXForms is an Objective-C library for easily creating table-based forms on iOS. It is ideal for settings pages, or user data entry tasks.

FXForms showing addtional fields after switching to Xcode 6

I have an app that I was building in Xcode 5 which uses FXForms to show three text inputs. After switching to Xcode 6 I now get six fields showing up with the last three labeled Hash, Description, and Debug Description.

//  SGESettingsForm.h

#import <Foundation/Foundation.h>
#import "FXForms.h"

@interface SGESettingsForm : NSObject <FXForm>

@property (nonatomic, copy) NSString *baseURI;
@property (nonatomic, copy) NSString *apiKey;
@property (nonatomic, copy) NSString *apiSecret;

@end

Only one view interacts with the form

@implementation SGESettingsViewController

- (id)init
{
    self = [super init];
    if (self)
    {
        self.form = [[SGESettingsForm alloc] init];
    }
    return self;
}

- (void)awakeFromNib
{
    // setup form
    self.form = self.formController.form = [[SGESettingsForm alloc] init];
    self.form.baseURI   = [SGESettingsStore baseURI];
    self.form.apiKey    = [SGESettingsStore apiKey];
    self.form.apiSecret = [SGESettingsStore apiSecret];

    // if no settings show alert with API instructions
    if (![SGESettingsStore isSettingsValid]) {
        [self showInstructions];
    }
}

- (IBAction)dismiss:(id)sender
{
    // resign first responder, fxform fields do not set their data bound values until you click out of them,
    // this will set them on clicking the 'Done' button
    [self.view endEditing:YES];

    // save settings
    [SGESettingsStore baseURI:self.form.baseURI
                       apiKey:self.form.apiKey
                    apiSecret:self.form.apiSecret];

    // if valid settings exit to log view otherwise show instructions
    if ([SGESettingsStore isSettingsValid]) {
        [self.presentingViewController dismissViewControllerAnimated:YES
                                                          completion:NULL];
    } else {
        [self showInstructions];
    }
}

//...

thanks!


Source: (StackOverflow)

FXForms boolean field Exception: EXC_BAD_ACCESS

I have a form as below

#import <Foundation/Foundation.h>
#import "FXForms.h"


@interface SettingsForm : NSObject <FXForm>

@property (nonatomic, copy) NSString *apsalarKey;
@property (nonatomic, copy) NSString *apsalarSecret;
@property (nonatomic, assign) BOOL apsalarIsActive;

@property (nonatomic, copy) NSString *kahunaKey;
@property (nonatomic, copy) NSString *kahunaUsername;
@property (nonatomic, copy) NSString *kahunaEmail;
@property (nonatomic, assign) BOOL kahunaIsActive;

@property (nonatomic, copy) NSString *googleAnalyticsTrackingId;
@property (nonatomic, assign) BOOL googleAnalyticsIsActive;


@end

with the following implementation

#import "SettingsForm.h"


@implementation SettingsForm

- (NSArray *)fields {
    return @[
            @{FXFormFieldKey : @"apsalarKey", FXFormFieldTitle : @"key", FXFormFieldHeader : @"Apsalar"},
            @{FXFormFieldKey : @"apsalarSecret", FXFormFieldTitle : @"secret"},
            @{FXFormFieldKey : @"apsalarIsActive", FXFormFieldTitle : @"active", FXFormFieldType: FXFormFieldTypeBoolean},

            @{FXFormFieldKey : @"kahunaKey", FXFormFieldTitle : @"secret", FXFormFieldHeader : @"Kahuna"},
            @{FXFormFieldKey : @"kahunaUsername", FXFormFieldTitle : @"username"},
            @{FXFormFieldKey : @"kahunaEmail", FXFormFieldTitle : @"email"},
            @{FXFormFieldKey : @"kahunaIsActive", FXFormFieldTitle : @"active", FXFormFieldType: FXFormFieldTypeBoolean},

            @{FXFormFieldKey : @"googleAnalyticsTrackingId", FXFormFieldTitle : @"id", FXFormFieldHeader : @"Google Analytics"},
            @{FXFormFieldKey : @"googleAnalyticsIsActive", FXFormFieldTitle : @"active", FXFormFieldType: FXFormFieldTypeBoolean},

            @{FXFormFieldTitle : @"Clear", FXFormFieldHeader : @"Clear Log", FXFormFieldAction : @"clearLogHandler:"},
    ];
}

@end

I reference the form in a controller and when I try to get a boolean field's value it throws Exception: EXC_BAD_ACCESS:

- (IBAction)dismiss:(id)sender
{
    // resign first responder, fxform fields do not set their data bound values until you click out of them,
    // this will set them on clicking the 'Done' button
    [self.view endEditing:YES];

    // save settings
    NSLog(@"active %@", self.form.apsalarKey);
    NSLog(@"active %@", self.form.apsalarSecret);
    NSLog(@"active %@", self.form.apsalarIsActive);
    [SettingsStore setApsalarKey:self.form.apsalarKey
                          Secret:self.form.apsalarSecret
                          Active:self.form.apsalarIsActive];

The third log line is throwing the exception.

thanks!


Source: (StackOverflow)

FXForms data not appearing

I'm using FXForms for data entry in my iPhone app, and storing the data in a local SQLite database. A TableViewController uses that data to populate its tableview. When a row of the tableview is selected, an instance of my FXFormViewController class is created and assigned a form with the appropriate values for the given index path. However, when the view appears, the fields of the form are still blank, even though I've assigned each field its value from the database. I know I'm acquiring the correct values from the database - they're just not appearing in the form when the the form VC is pushed.

The table VC's didSelectRowAtIndexPath: method:

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

    let viewControllerForIndexPath = NewAccountFormVC()

    let existingForm = NewAccountForm()

    var sqlStatementForTitle = "SELECT AccountTitle FROM Accounts WHERE id = \(indexPath.row+1);"

    data.database.open()

    var textFMResultSet = data.database.executeQuery(sqlStatementForTitle, withArgumentsInArray: nil)

    var text = ""

    while textFMResultSet.next() == true {
        text = textFMResultSet.stringForColumn("AccountTitle")
    }

    existingForm.title = text

    var sqlStatementForBalance = "SELECT Balance FROM Accounts WHERE id = \(indexPath.row+1);"

    var balanceFMResultSet = data.database.executeQuery(sqlStatementForBalance, withArgumentsInArray: nil)

    var balance = 0.0

    while balanceFMResultSet.next() == true {
        balance = balanceFMResultSet.doubleForColumn("Balance")
    }

    existingForm.startingBalance = balance

    viewControllerForIndexPath.formController.form = existingForm

    self.navigationController?.pushViewController(viewControllerForIndexPath, animated: true)

}

My form VC code:

class NewAccountFormVC: FXFormViewController {

    let data = DBSingleton.sharedInstance

    override func viewDidLoad() {
        super.viewDidLoad()
        newAccountFormVCSetup()
    }


    func newAccountFormVCSetup() {

        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Save", style: .Done, target: self, action: "saveAndPop:")
    }
}

Source: (StackOverflow)

Using FXForms in Swift Project after Last iOS SDK 8.3 Update

My Swift App uses the FXForms Cocoa Pod

It's an OBJ-C framework I'm using with my Swift app. Everything compiled fine before last Xcode update. Now I am getting this error:

" Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MyApp.MyFile extraFields]: unrecognized selector sent to instance "

at the line below of FxForms.m file;

[fields addObjectsFromArray:[form extraFields] ?: @[]];

Any ideas?

Thanks for any help,


Source: (StackOverflow)

FXForms conditional fields

I have created a form with FXForms which contains a switch input and a text field input.

I've been trying to workout how to make the text field only visible if the switch statement is true, but with no success and can't find anything in the documentation.

What would be the best way to achieve this?


Source: (StackOverflow)

Find the selected indexPaths from FXForm library -ios

Im a newbie in iOS development. Im using FXForm to create a UITableview based form. Ive used FXFormFieldOptions field for multiple selection by setting the FXFormFieldType to bitfield. I need the index paths for selected options in the options list.

    @{FXFormFieldKey: @"language",
      FXFormFieldOptions: @[@"English", @"Spanish", @"French", @"Dutch"],FXFormFieldType:FXFormFieldTypeBitfield},

Could you provide some explanation or help please.


Source: (StackOverflow)

iOS : How to get value in FXForms

How can I get actual value of field which user is selected in field,

In this method I got only number of index which user selected, but I need the value (string) of that.

(void)submitRegistrationForm:(UITableViewCell *)cell
{
//we can lookup the form from the cell if we want, like this:
RegistrationForm *form = cell.field.form;

NSLog(@"Country : %d",form.selectYourCountry);

// How to get country name over here.

}

Thanks,


Source: (StackOverflow)

Using FXForms in Swift Project updated to iOS sdk 8.3

This is my first question on stack overflow so please excuse if I miss any mannerisms.....

My Swift App uses the FXForms Cocoa Pod

It's an OBJ-C framework I'm using with my Swift app. Everything compiled fine before updating Xcode today. Now I am getting this error:

"Objective-C method 'fields' provided by method 'fields()' conflicts with optional requirement method 'fields()' in protocol 'FXForm'e

Any ideas? Happy to provide source code, etc.

Thanks for any help,

ztb


Source: (StackOverflow)