Skip to content

Commit

Permalink
Updated to version 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Apr 7, 2014
1 parent 928d700 commit 642f119
Show file tree
Hide file tree
Showing 24 changed files with 962 additions and 39 deletions.
15 changes: 15 additions & 0 deletions Examples/CustomButtonExample/Classes/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// AppDelegate.h
// BasicExample
//
// Created by Nick Lockwood on 04/02/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end
25 changes: 25 additions & 0 deletions Examples/CustomButtonExample/Classes/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// AppDelegate.m
// BasicExample
//
// Created by Nick Lockwood on 04/02/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

#import "AppDelegate.h"
#import "LoginFormViewController.h"


@implementation AppDelegate

- (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(__unused NSDictionary *)launchOptions
{
//set up window
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[LoginFormViewController alloc] init]];
[self.window makeKeyAndVisible];
return YES;
}

@end
13 changes: 13 additions & 0 deletions Examples/CustomButtonExample/Classes/CustomButtonCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// CustomButtonCell.h
// CustomButtonExample
//
// Created by Nick Lockwood on 07/04/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

#import "FXForms.h"

@interface CustomButtonCell : FXFormBaseCell

@end
32 changes: 32 additions & 0 deletions Examples/CustomButtonExample/Classes/CustomButtonCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// CustomButtonCell.m
// CustomButtonExample
//
// Created by Nick Lockwood on 07/04/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

#import "CustomButtonCell.h"


@interface CustomButtonCell ()

@property (nonatomic, strong) IBOutlet UIButton *cellButton;

@end


@implementation CustomButtonCell

//note: we could override -awakeFromNib or -initWithCoder: if we wanted
//to do any customisation in code, but in this case we don't need to

//if we were creating the cell programamtically instead of using a nib
//we would override -initWithStyle:reuseIdentifier: to do the configuration

- (IBAction)buttonAction
{
if (self.field.action) self.field.action(self);
}

@end
41 changes: 41 additions & 0 deletions Examples/CustomButtonExample/Classes/CustomButtonCell.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="MPJ-MW-Lvu" customClass="CustomButtonCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="MPJ-MW-Lvu" id="uvY-Ih-8JN">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="WeG-za-goq">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.3921568627" green="0.7843137255" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<color key="tintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Submit">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="buttonAction" destination="MPJ-MW-Lvu" eventType="touchUpInside" id="6jh-m7-t7e"/>
</connections>
</button>
</subviews>
</tableViewCellContentView>
<connections>
<outlet property="cellButton" destination="WeG-za-goq" id="nLd-Xt-K19"/>
</connections>
</tableViewCell>
</objects>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.charcoaldesign.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
19 changes: 19 additions & 0 deletions Examples/CustomButtonExample/Classes/LoginForm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// LoginForm.h
// BasicExample
//
// Created by Nick Lockwood on 05/02/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

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


@interface LoginForm : NSObject <FXForm>

@property (nonatomic, copy) NSString *email;
@property (nonatomic, copy) NSString *password;
@property (nonatomic, assign) BOOL rememberMe;

@end
28 changes: 28 additions & 0 deletions Examples/CustomButtonExample/Classes/LoginForm.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// LoginForm.m
// BasicExample
//
// Created by Nick Lockwood on 05/02/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

#import "LoginForm.h"
#import "CustomButtonCell.h"


@implementation LoginForm

- (NSArray *)extraFields
{
return @[

//we declare our custom submit buytton cell as normal, but note that
//we have specified that we want to use our CustomButtonCell class
//instead of the default FXFormBaseCell

@{FXFormFieldCell: [CustomButtonCell class], FXFormFieldHeader: @"", FXFormFieldAction: @"submitLoginForm"},

];
}

@end
16 changes: 16 additions & 0 deletions Examples/CustomButtonExample/Classes/LoginFormViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// RootFormViewController.h
// BasicExample
//
// Created by Nick Lockwood on 25/03/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

#import "FXForms.h"

@interface LoginFormViewController : UIViewController <FXFormControllerDelegate>

@property (nonatomic, strong) IBOutlet UITableView *tableView;
@property (nonatomic, strong) FXFormController *formController;

@end
45 changes: 45 additions & 0 deletions Examples/CustomButtonExample/Classes/LoginFormViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// RootFormViewController.m
// BasicExample
//
// Created by Nick Lockwood on 25/03/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
//

#import "LoginFormViewController.h"
#import "LoginForm.h"


@implementation LoginFormViewController

- (void)viewDidLoad
{
[super viewDidLoad];

//set up form and form controller
self.formController = [[FXFormController alloc] init];
self.formController.tableView = self.tableView;
self.formController.delegate = self;
self.formController.form = [[LoginForm alloc] init];
}

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

//reload the table
[self.tableView reloadData];
}


//this is the action method for our submit button
//the methods escalate through the responder chain until
//they reach the AppDelegate

- (void)submitLoginForm
{
//now we can display a form value in our alert
[[[UIAlertView alloc] initWithTitle:@"Login Form Submitted" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil] show];
}

@end
30 changes: 30 additions & 0 deletions Examples/CustomButtonExample/Classes/LoginFormViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoginFormViewController">
<connections>
<outlet property="tableView" destination="uAa-wO-xUa" id="sz2-Ta-QLl"/>
<outlet property="view" destination="uAa-wO-xUa" id="5gq-pU-T6O"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="uAa-wO-xUa">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</view>
</objects>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

Loading

0 comments on commit 642f119

Please sign in to comment.