Update project with credit card support

This commit is contained in:
Roman Efimov
2013-03-07 14:56:24 -06:00
parent 67d7e278fe
commit 887eeae6d8
6 changed files with 296 additions and 103 deletions

View File

@@ -0,0 +1,32 @@
//
// REFormattedNumberField.h
// REFormattedNumberField
//
// Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface REFormattedNumberField : UITextField
@property (copy, nonatomic) NSString *format;
@end

View File

@@ -0,0 +1,107 @@
//
// REFormattedNumberField.m
// REFormattedNumberField
//
// Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import "REFormattedNumberField.h"
@implementation REFormattedNumberField
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:(CGRect)frame];
if (self) {
self.keyboardType = UIKeyboardTypeNumberPad;
self.format = @"X";
[self addTarget:self action:@selector(formatInput:) forControlEvents:UIControlEventEditingChanged];
}
return self;
}
- (NSString *)string:(NSString *)string withNumberFormat:(NSString *)format
{
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\D" options:NSRegularExpressionCaseInsensitive error:NULL];
NSString *stripped = [regex stringByReplacingMatchesInString:string options:0 range:NSMakeRange(0, string.length) withTemplate:@""];
NSMutableArray *patterns = [[NSMutableArray alloc] init];
NSMutableArray *separators = [[NSMutableArray alloc] init];
[patterns addObject:@0];
NSInteger maxLength = 0;
for (NSInteger i = 0; i < [format length]; i++) {
NSString *character = [format substringWithRange:NSMakeRange(i, 1)];
if ([character isEqualToString:@"X"]) {
maxLength++;
NSNumber *number = [patterns objectAtIndex:patterns.count - 1];
number = @(number.integerValue + 1);
[patterns replaceObjectAtIndex:patterns.count - 1 withObject:number];
} else {
[patterns addObject:@0];
[separators addObject:character];
}
}
if (stripped.length > maxLength)
stripped = [stripped substringToIndex:maxLength];
NSString *match = @"";
NSString *replace = @"";
NSMutableArray *expressions = [[NSMutableArray alloc] init];
for (NSInteger i = 0; i < patterns.count; i++) {
NSString *currentMatch = [match stringByAppendingString:@"(\\d+)"];
match = [match stringByAppendingString:[NSString stringWithFormat:@"(\\d{%d})", ((NSNumber *)[patterns objectAtIndex:i]).integerValue]];
NSString *template;
if (i == 0) {
template = [NSString stringWithFormat:@"$%i", i+1];
} else {
template = [NSString stringWithFormat:@"%@$%i", [separators objectAtIndex:i-1], i+1];
}
replace = [replace stringByAppendingString:template];
[expressions addObject:@{@"match": currentMatch, @"replace": replace}];
}
NSString *result = [stripped copy];
for (NSDictionary *exp in expressions) {
NSString *match = [exp objectForKey:@"match"];
NSString *replace = [exp objectForKey:@"replace"];
NSString *modifiedString = [stripped stringByReplacingOccurrencesOfString:match
withString:replace
options:NSRegularExpressionSearch
range:NSMakeRange(0, stripped.length)];
if (![modifiedString isEqualToString:stripped])
result = modifiedString;
}
return result;
}
- (void)formatInput:(UITextField *)textField
{
self.text = [self string:textField.text withNumberFormat:_format];
}
@end

View File

@@ -127,6 +127,13 @@ static inline NSString *RECreditCardType(NSString *creditCardNumber)
return _creditCardField;
}
- (void)flipCreditCardImageViewBack:(UITextField *)textField
{
if ((textField.tag == 1 || textField.tag == 2) && !_cvvField.isFirstResponder) {
[UIView transitionFromView:_creditCardBackImageView toView:_currentImageView duration:0.4 options:UIViewAnimationOptionTransitionFlipFromRight completion:nil];
}
}
#pragma mark -
#pragma mark UISwitch events
@@ -154,9 +161,9 @@ static inline NSString *RECreditCardType(NSString *creditCardNumber)
[_expirationDateField becomeFirstResponder];
__typeof(&*self) __weak weakSelf = self;
[UIView animateWithDuration:0.1 animations:^{
weakSelf.creditCardField.x = -120;
weakSelf.expirationDateField.x = CGRectGetMaxX(_creditCardField.frame);
weakSelf.cvvField.x = CGRectGetMaxX(_expirationDateField.frame);
weakSelf.creditCardField.frame = CGRectMake(-120, weakSelf.creditCardField.frame.origin.y, weakSelf.creditCardField.frame.size.width, weakSelf.creditCardField.frame.size.height);
weakSelf.expirationDateField.frame = CGRectMake(CGRectGetMaxX(_creditCardField.frame), weakSelf.expirationDateField.frame.origin.y, weakSelf.expirationDateField.frame.size.width, weakSelf.expirationDateField.frame.size.height);
weakSelf.cvvField.frame = CGRectMake(CGRectGetMaxX(_expirationDateField.frame), weakSelf.cvvField.frame.origin.y, weakSelf.cvvField.frame.size.width, weakSelf.cvvField.frame.size.height);
}];
}
@@ -164,9 +171,9 @@ static inline NSString *RECreditCardType(NSString *creditCardNumber)
if (textField.tag == 0) {
__typeof(&*self) __weak weakSelf = self;
[UIView animateWithDuration:0.1 animations:^{
weakSelf.creditCardField.x = 0;
weakSelf.expirationDateField.x = 320;
weakSelf.cvvField.x = 320;
weakSelf.creditCardField.frame = CGRectMake(0, weakSelf.creditCardField.frame.origin.y, weakSelf.creditCardField.frame.size.width, weakSelf.creditCardField.frame.size.height);
weakSelf.expirationDateField.frame = CGRectMake(320, weakSelf.expirationDateField.frame.origin.y, weakSelf.expirationDateField.frame.size.width, weakSelf.expirationDateField.frame.size.height);
weakSelf.cvvField.frame = CGRectMake(320, weakSelf.cvvField.frame.origin.y, weakSelf.cvvField.frame.size.width, weakSelf.cvvField.frame.size.height);
}];
}
}
@@ -190,11 +197,7 @@ static inline NSString *RECreditCardType(NSString *creditCardNumber)
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
[self performBlock:^{
if ((textField.tag == 1 || textField.tag == 2) && !_cvvField.isFirstResponder) {
[UIView transitionFromView:_creditCardBackImageView toView:_currentImageView duration:0.4 options:UIViewAnimationOptionTransitionFlipFromRight completion:nil];
}
} afterDelay:0.1];
[self performSelector:@selector(flipCreditCardImageViewBack:) withObject:textField afterDelay:0.1];
return YES;
}

View File

@@ -34,7 +34,7 @@
return nil;
_backgroundImages = [[NSMutableDictionary alloc] init];
_textFieldFont = [UIFont systemFontOfSize:12];
_textFieldFont = [UIFont systemFontOfSize:15];
_cellHeight = 44;
return self;

View File

@@ -7,6 +7,24 @@
objects = {
/* Begin PBXBuildFile section */
30DB066A16E934AD006C9530 /* RETableViewBoolCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB064916E934AD006C9530 /* RETableViewBoolCell.m */; };
30DB066B16E934AD006C9530 /* RETableViewCreditCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB064B16E934AD006C9530 /* RETableViewCreditCardCell.m */; };
30DB066C16E934AD006C9530 /* RETableViewNumberCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB064D16E934AD006C9530 /* RETableViewNumberCell.m */; };
30DB066D16E934AD006C9530 /* RETableViewStringCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB064F16E934AD006C9530 /* RETableViewStringCell.m */; };
30DB066E16E934AD006C9530 /* RETableViewTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB065116E934AD006C9530 /* RETableViewTextCell.m */; };
30DB066F16E934AD006C9530 /* REBoolItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB065416E934AD006C9530 /* REBoolItem.m */; };
30DB067016E934AD006C9530 /* RECreditCardItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB065616E934AD006C9530 /* RECreditCardItem.m */; };
30DB067116E934AD006C9530 /* RENumberItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB065816E934AD006C9530 /* RENumberItem.m */; };
30DB067216E934AD006C9530 /* REStringItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB065A16E934AD006C9530 /* REStringItem.m */; };
30DB067316E934AD006C9530 /* RETextItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB065C16E934AD006C9530 /* RETextItem.m */; };
30DB067416E934AD006C9530 /* REActionBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB065E16E934AD006C9530 /* REActionBar.m */; };
30DB067516E934AD006C9530 /* RETableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB066016E934AD006C9530 /* RETableViewCell.m */; };
30DB067616E934AD006C9530 /* RETableViewCellStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB066216E934AD006C9530 /* RETableViewCellStyle.m */; };
30DB067716E934AD006C9530 /* RETableViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB066416E934AD006C9530 /* RETableViewItem.m */; };
30DB067816E934AD006C9530 /* RETableViewManager.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 30DB066516E934AD006C9530 /* RETableViewManager.bundle */; };
30DB067916E934AD006C9530 /* RETableViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB066716E934AD006C9530 /* RETableViewManager.m */; };
30DB067A16E934AD006C9530 /* RETableViewSection.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB066916E934AD006C9530 /* RETableViewSection.m */; };
30DB067E16E934C5006C9530 /* REFormattedNumberField.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DB067D16E934C5006C9530 /* REFormattedNumberField.m */; };
30EF93B316E039B800B84981 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30EF93B216E039B800B84981 /* UIKit.framework */; };
30EF93B516E039B800B84981 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30EF93B416E039B800B84981 /* Foundation.framework */; };
30EF93B716E039B800B84981 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30EF93B616E039B800B84981 /* CoreGraphics.framework */; };
@@ -18,20 +36,44 @@
30EF93C916E039B800B84981 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 30EF93C816E039B800B84981 /* Default-568h@2x.png */; };
30EF93F216E039D500B84981 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF93F116E039D500B84981 /* RootViewController.m */; };
30EF93F816E03D1F00B84981 /* ControlsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF93F716E03D1F00B84981 /* ControlsViewController.m */; };
30EF941316E3C34300B84981 /* RETableViewBoolCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF93FD16E3C34300B84981 /* RETableViewBoolCell.m */; };
30EF941416E3C34300B84981 /* RETableViewStringCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF93FF16E3C34300B84981 /* RETableViewStringCell.m */; };
30EF941516E3C34300B84981 /* RETableViewTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF940116E3C34300B84981 /* RETableViewTextCell.m */; };
30EF941616E3C34300B84981 /* REBoolItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF940416E3C34300B84981 /* REBoolItem.m */; };
30EF941716E3C34300B84981 /* REStringItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF940616E3C34300B84981 /* REStringItem.m */; };
30EF941816E3C34300B84981 /* RETextItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF940816E3C34300B84981 /* RETextItem.m */; };
30EF941916E3C34300B84981 /* RETableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF940A16E3C34300B84981 /* RETableViewCell.m */; };
30EF941A16E3C34300B84981 /* RETableViewCellStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF940C16E3C34300B84981 /* RETableViewCellStyle.m */; };
30EF941B16E3C34300B84981 /* RETableViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF940E16E3C34300B84981 /* RETableViewItem.m */; };
30EF941C16E3C34300B84981 /* RETableViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF941016E3C34300B84981 /* RETableViewManager.m */; };
30EF941D16E3C34300B84981 /* RETableViewSection.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EF941216E3C34300B84981 /* RETableViewSection.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
30DB064816E934AD006C9530 /* RETableViewBoolCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewBoolCell.h; sourceTree = "<group>"; };
30DB064916E934AD006C9530 /* RETableViewBoolCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewBoolCell.m; sourceTree = "<group>"; };
30DB064A16E934AD006C9530 /* RETableViewCreditCardCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewCreditCardCell.h; sourceTree = "<group>"; };
30DB064B16E934AD006C9530 /* RETableViewCreditCardCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewCreditCardCell.m; sourceTree = "<group>"; };
30DB064C16E934AD006C9530 /* RETableViewNumberCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewNumberCell.h; sourceTree = "<group>"; };
30DB064D16E934AD006C9530 /* RETableViewNumberCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewNumberCell.m; sourceTree = "<group>"; };
30DB064E16E934AD006C9530 /* RETableViewStringCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewStringCell.h; sourceTree = "<group>"; };
30DB064F16E934AD006C9530 /* RETableViewStringCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewStringCell.m; sourceTree = "<group>"; };
30DB065016E934AD006C9530 /* RETableViewTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewTextCell.h; sourceTree = "<group>"; };
30DB065116E934AD006C9530 /* RETableViewTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewTextCell.m; sourceTree = "<group>"; };
30DB065316E934AD006C9530 /* REBoolItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = REBoolItem.h; sourceTree = "<group>"; };
30DB065416E934AD006C9530 /* REBoolItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = REBoolItem.m; sourceTree = "<group>"; };
30DB065516E934AD006C9530 /* RECreditCardItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RECreditCardItem.h; sourceTree = "<group>"; };
30DB065616E934AD006C9530 /* RECreditCardItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RECreditCardItem.m; sourceTree = "<group>"; };
30DB065716E934AD006C9530 /* RENumberItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RENumberItem.h; sourceTree = "<group>"; };
30DB065816E934AD006C9530 /* RENumberItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RENumberItem.m; sourceTree = "<group>"; };
30DB065916E934AD006C9530 /* REStringItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = REStringItem.h; sourceTree = "<group>"; };
30DB065A16E934AD006C9530 /* REStringItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = REStringItem.m; sourceTree = "<group>"; };
30DB065B16E934AD006C9530 /* RETextItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETextItem.h; sourceTree = "<group>"; };
30DB065C16E934AD006C9530 /* RETextItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETextItem.m; sourceTree = "<group>"; };
30DB065D16E934AD006C9530 /* REActionBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = REActionBar.h; sourceTree = "<group>"; };
30DB065E16E934AD006C9530 /* REActionBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = REActionBar.m; sourceTree = "<group>"; };
30DB065F16E934AD006C9530 /* RETableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewCell.h; sourceTree = "<group>"; };
30DB066016E934AD006C9530 /* RETableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewCell.m; sourceTree = "<group>"; };
30DB066116E934AD006C9530 /* RETableViewCellStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewCellStyle.h; sourceTree = "<group>"; };
30DB066216E934AD006C9530 /* RETableViewCellStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewCellStyle.m; sourceTree = "<group>"; };
30DB066316E934AD006C9530 /* RETableViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewItem.h; sourceTree = "<group>"; };
30DB066416E934AD006C9530 /* RETableViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewItem.m; sourceTree = "<group>"; };
30DB066516E934AD006C9530 /* RETableViewManager.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = RETableViewManager.bundle; sourceTree = "<group>"; };
30DB066616E934AD006C9530 /* RETableViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewManager.h; sourceTree = "<group>"; };
30DB066716E934AD006C9530 /* RETableViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewManager.m; sourceTree = "<group>"; };
30DB066816E934AD006C9530 /* RETableViewSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewSection.h; sourceTree = "<group>"; };
30DB066916E934AD006C9530 /* RETableViewSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewSection.m; sourceTree = "<group>"; };
30DB067C16E934C5006C9530 /* REFormattedNumberField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = REFormattedNumberField.h; sourceTree = "<group>"; };
30DB067D16E934C5006C9530 /* REFormattedNumberField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = REFormattedNumberField.m; sourceTree = "<group>"; };
30EF93AF16E039B800B84981 /* RETableViewManagerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RETableViewManagerExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
30EF93B216E039B800B84981 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
30EF93B416E039B800B84981 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -49,28 +91,6 @@
30EF93F116E039D500B84981 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = "<group>"; };
30EF93F616E03D1F00B84981 /* ControlsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlsViewController.h; sourceTree = "<group>"; };
30EF93F716E03D1F00B84981 /* ControlsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ControlsViewController.m; sourceTree = "<group>"; };
30EF93FC16E3C34300B84981 /* RETableViewBoolCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewBoolCell.h; sourceTree = "<group>"; };
30EF93FD16E3C34300B84981 /* RETableViewBoolCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewBoolCell.m; sourceTree = "<group>"; };
30EF93FE16E3C34300B84981 /* RETableViewStringCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewStringCell.h; sourceTree = "<group>"; };
30EF93FF16E3C34300B84981 /* RETableViewStringCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewStringCell.m; sourceTree = "<group>"; };
30EF940016E3C34300B84981 /* RETableViewTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewTextCell.h; sourceTree = "<group>"; };
30EF940116E3C34300B84981 /* RETableViewTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewTextCell.m; sourceTree = "<group>"; };
30EF940316E3C34300B84981 /* REBoolItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = REBoolItem.h; sourceTree = "<group>"; };
30EF940416E3C34300B84981 /* REBoolItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = REBoolItem.m; sourceTree = "<group>"; };
30EF940516E3C34300B84981 /* REStringItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = REStringItem.h; sourceTree = "<group>"; };
30EF940616E3C34300B84981 /* REStringItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = REStringItem.m; sourceTree = "<group>"; };
30EF940716E3C34300B84981 /* RETextItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETextItem.h; sourceTree = "<group>"; };
30EF940816E3C34300B84981 /* RETextItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETextItem.m; sourceTree = "<group>"; };
30EF940916E3C34300B84981 /* RETableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewCell.h; sourceTree = "<group>"; };
30EF940A16E3C34300B84981 /* RETableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewCell.m; sourceTree = "<group>"; };
30EF940B16E3C34300B84981 /* RETableViewCellStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewCellStyle.h; sourceTree = "<group>"; };
30EF940C16E3C34300B84981 /* RETableViewCellStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewCellStyle.m; sourceTree = "<group>"; };
30EF940D16E3C34300B84981 /* RETableViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewItem.h; sourceTree = "<group>"; };
30EF940E16E3C34300B84981 /* RETableViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewItem.m; sourceTree = "<group>"; };
30EF940F16E3C34300B84981 /* RETableViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewManager.h; sourceTree = "<group>"; };
30EF941016E3C34300B84981 /* RETableViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewManager.m; sourceTree = "<group>"; };
30EF941116E3C34300B84981 /* RETableViewSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RETableViewSection.h; sourceTree = "<group>"; };
30EF941216E3C34300B84981 /* RETableViewSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RETableViewSection.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -87,10 +107,78 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
30DB064616E934AD006C9530 /* RETableViewManager */ = {
isa = PBXGroup;
children = (
30DB064716E934AD006C9530 /* Cells */,
30DB065216E934AD006C9530 /* Items */,
30DB065D16E934AD006C9530 /* REActionBar.h */,
30DB065E16E934AD006C9530 /* REActionBar.m */,
30DB065F16E934AD006C9530 /* RETableViewCell.h */,
30DB066016E934AD006C9530 /* RETableViewCell.m */,
30DB066116E934AD006C9530 /* RETableViewCellStyle.h */,
30DB066216E934AD006C9530 /* RETableViewCellStyle.m */,
30DB066316E934AD006C9530 /* RETableViewItem.h */,
30DB066416E934AD006C9530 /* RETableViewItem.m */,
30DB066516E934AD006C9530 /* RETableViewManager.bundle */,
30DB066616E934AD006C9530 /* RETableViewManager.h */,
30DB066716E934AD006C9530 /* RETableViewManager.m */,
30DB066816E934AD006C9530 /* RETableViewSection.h */,
30DB066916E934AD006C9530 /* RETableViewSection.m */,
);
name = RETableViewManager;
path = ../RETableViewManager;
sourceTree = "<group>";
};
30DB064716E934AD006C9530 /* Cells */ = {
isa = PBXGroup;
children = (
30DB064816E934AD006C9530 /* RETableViewBoolCell.h */,
30DB064916E934AD006C9530 /* RETableViewBoolCell.m */,
30DB064A16E934AD006C9530 /* RETableViewCreditCardCell.h */,
30DB064B16E934AD006C9530 /* RETableViewCreditCardCell.m */,
30DB064C16E934AD006C9530 /* RETableViewNumberCell.h */,
30DB064D16E934AD006C9530 /* RETableViewNumberCell.m */,
30DB064E16E934AD006C9530 /* RETableViewStringCell.h */,
30DB064F16E934AD006C9530 /* RETableViewStringCell.m */,
30DB065016E934AD006C9530 /* RETableViewTextCell.h */,
30DB065116E934AD006C9530 /* RETableViewTextCell.m */,
);
path = Cells;
sourceTree = "<group>";
};
30DB065216E934AD006C9530 /* Items */ = {
isa = PBXGroup;
children = (
30DB065316E934AD006C9530 /* REBoolItem.h */,
30DB065416E934AD006C9530 /* REBoolItem.m */,
30DB065516E934AD006C9530 /* RECreditCardItem.h */,
30DB065616E934AD006C9530 /* RECreditCardItem.m */,
30DB065716E934AD006C9530 /* RENumberItem.h */,
30DB065816E934AD006C9530 /* RENumberItem.m */,
30DB065916E934AD006C9530 /* REStringItem.h */,
30DB065A16E934AD006C9530 /* REStringItem.m */,
30DB065B16E934AD006C9530 /* RETextItem.h */,
30DB065C16E934AD006C9530 /* RETextItem.m */,
);
path = Items;
sourceTree = "<group>";
};
30DB067B16E934C5006C9530 /* REFormattedNumberField */ = {
isa = PBXGroup;
children = (
30DB067C16E934C5006C9530 /* REFormattedNumberField.h */,
30DB067D16E934C5006C9530 /* REFormattedNumberField.m */,
);
name = REFormattedNumberField;
path = ../REFormattedNumberField;
sourceTree = "<group>";
};
30EF93A616E039B800B84981 = {
isa = PBXGroup;
children = (
30EF93FA16E3C34300B84981 /* RETableViewManager */,
30DB067B16E934C5006C9530 /* REFormattedNumberField */,
30DB064616E934AD006C9530 /* RETableViewManager */,
30EF93B816E039B800B84981 /* RETableViewManagerExample */,
30EF93B116E039B800B84981 /* Frameworks */,
30EF93B016E039B800B84981 /* Products */,
@@ -143,52 +231,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
30EF93FA16E3C34300B84981 /* RETableViewManager */ = {
isa = PBXGroup;
children = (
30EF93FB16E3C34300B84981 /* Cells */,
30EF940216E3C34300B84981 /* Items */,
30EF940916E3C34300B84981 /* RETableViewCell.h */,
30EF940A16E3C34300B84981 /* RETableViewCell.m */,
30EF940B16E3C34300B84981 /* RETableViewCellStyle.h */,
30EF940C16E3C34300B84981 /* RETableViewCellStyle.m */,
30EF940D16E3C34300B84981 /* RETableViewItem.h */,
30EF940E16E3C34300B84981 /* RETableViewItem.m */,
30EF940F16E3C34300B84981 /* RETableViewManager.h */,
30EF941016E3C34300B84981 /* RETableViewManager.m */,
30EF941116E3C34300B84981 /* RETableViewSection.h */,
30EF941216E3C34300B84981 /* RETableViewSection.m */,
);
name = RETableViewManager;
path = ../RETableViewManager;
sourceTree = "<group>";
};
30EF93FB16E3C34300B84981 /* Cells */ = {
isa = PBXGroup;
children = (
30EF93FC16E3C34300B84981 /* RETableViewBoolCell.h */,
30EF93FD16E3C34300B84981 /* RETableViewBoolCell.m */,
30EF93FE16E3C34300B84981 /* RETableViewStringCell.h */,
30EF93FF16E3C34300B84981 /* RETableViewStringCell.m */,
30EF940016E3C34300B84981 /* RETableViewTextCell.h */,
30EF940116E3C34300B84981 /* RETableViewTextCell.m */,
);
path = Cells;
sourceTree = "<group>";
};
30EF940216E3C34300B84981 /* Items */ = {
isa = PBXGroup;
children = (
30EF940316E3C34300B84981 /* REBoolItem.h */,
30EF940416E3C34300B84981 /* REBoolItem.m */,
30EF940516E3C34300B84981 /* REStringItem.h */,
30EF940616E3C34300B84981 /* REStringItem.m */,
30EF940716E3C34300B84981 /* RETextItem.h */,
30EF940816E3C34300B84981 /* RETextItem.m */,
);
path = Items;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -244,6 +286,7 @@
30EF93C516E039B800B84981 /* Default.png in Resources */,
30EF93C716E039B800B84981 /* Default@2x.png in Resources */,
30EF93C916E039B800B84981 /* Default-568h@2x.png in Resources */,
30DB067816E934AD006C9530 /* RETableViewManager.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -258,17 +301,23 @@
30EF93C316E039B800B84981 /* AppDelegate.m in Sources */,
30EF93F216E039D500B84981 /* RootViewController.m in Sources */,
30EF93F816E03D1F00B84981 /* ControlsViewController.m in Sources */,
30EF941316E3C34300B84981 /* RETableViewBoolCell.m in Sources */,
30EF941416E3C34300B84981 /* RETableViewStringCell.m in Sources */,
30EF941516E3C34300B84981 /* RETableViewTextCell.m in Sources */,
30EF941616E3C34300B84981 /* REBoolItem.m in Sources */,
30EF941716E3C34300B84981 /* REStringItem.m in Sources */,
30EF941816E3C34300B84981 /* RETextItem.m in Sources */,
30EF941916E3C34300B84981 /* RETableViewCell.m in Sources */,
30EF941A16E3C34300B84981 /* RETableViewCellStyle.m in Sources */,
30EF941B16E3C34300B84981 /* RETableViewItem.m in Sources */,
30EF941C16E3C34300B84981 /* RETableViewManager.m in Sources */,
30EF941D16E3C34300B84981 /* RETableViewSection.m in Sources */,
30DB066A16E934AD006C9530 /* RETableViewBoolCell.m in Sources */,
30DB066B16E934AD006C9530 /* RETableViewCreditCardCell.m in Sources */,
30DB066C16E934AD006C9530 /* RETableViewNumberCell.m in Sources */,
30DB066D16E934AD006C9530 /* RETableViewStringCell.m in Sources */,
30DB066E16E934AD006C9530 /* RETableViewTextCell.m in Sources */,
30DB066F16E934AD006C9530 /* REBoolItem.m in Sources */,
30DB067016E934AD006C9530 /* RECreditCardItem.m in Sources */,
30DB067116E934AD006C9530 /* RENumberItem.m in Sources */,
30DB067216E934AD006C9530 /* REStringItem.m in Sources */,
30DB067316E934AD006C9530 /* RETextItem.m in Sources */,
30DB067416E934AD006C9530 /* REActionBar.m in Sources */,
30DB067516E934AD006C9530 /* RETableViewCell.m in Sources */,
30DB067616E934AD006C9530 /* RETableViewCellStyle.m in Sources */,
30DB067716E934AD006C9530 /* RETableViewItem.m in Sources */,
30DB067916E934AD006C9530 /* RETableViewManager.m in Sources */,
30DB067A16E934AD006C9530 /* RETableViewSection.m in Sources */,
30DB067E16E934C5006C9530 /* REFormattedNumberField.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -32,6 +32,8 @@
[section addItem:[RETextItem itemWithTitle:@"Text item 4" value:nil placeholder:@"Text"]];
[section addItem:[REBoolItem itemWithTitle:@"Bool item" value:YES]];
[section addItem:[RECreditCardItem item]];
// Set delegate and datasource
//
self.tableView.dataSource = _manager;