Search code examples
iosxcode6fxforms

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!


Solution

  • As @Erik's comment mentions this is fixed in the beta version of FXForms if you're using CocoaPods you can add it like so

    pod 'FXForms', :git => 'https://github.com/nicklockwood/FXForms.git'