├── IOSPatterns ├── en.lproj │ └── InfoPlist.strings ├── Default.png ├── Default@2x.png ├── Default-568h@2x.png ├── ViewController2.h ├── ViewController4.h ├── UIViewController1.h ├── ViewController3.h ├── ViewController5.h ├── AppDelegate.h ├── BigCalculator3.h ├── IOSPatterns-Prefix.pch ├── main.m ├── BigCalculator2.h ├── BigCalculator4.h ├── BigCalculator5.h ├── NotificationDictKeys.h ├── BigCalculator1.h ├── BigCalculator2.m ├── IOSPatterns-Info.plist ├── BigCalculator1.m ├── ViewController5.m ├── ViewController4.m ├── AppDelegate.m ├── BigCalculator3.m ├── ViewController3.m ├── UIViewController1.m ├── BigCalculator5.m ├── ViewController2.m └── BigCalculator4.m ├── IOSPatternsTests ├── en.lproj │ └── InfoPlist.strings ├── IOSPatternsTests.h ├── IOSPatternsTests.m └── IOSPatternsTests-Info.plist ├── README.md ├── .gitignore ├── IOSPatterns.xcodeproj └── project.pbxproj └── Storyboard.storyboard /IOSPatterns/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /IOSPatternsTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /IOSPatterns/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sebastienwindal/iOSPatterns/HEAD/IOSPatterns/Default.png -------------------------------------------------------------------------------- /IOSPatterns/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sebastienwindal/iOSPatterns/HEAD/IOSPatterns/Default@2x.png -------------------------------------------------------------------------------- /IOSPatterns/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sebastienwindal/iOSPatterns/HEAD/IOSPatterns/Default-568h@2x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | iOSPatterns 2 | =========== 3 | 4 | standard iOS UI patterns explored 5 | 6 | [start here](https://github.com/sebastienwindal/iOSPatterns/wiki/standard-iOS-patterns) -------------------------------------------------------------------------------- /IOSPatterns/ViewController2.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController2.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController2 : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /IOSPatterns/ViewController4.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController4.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController4 : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /IOSPatterns/UIViewController1.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController1.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIViewController1 : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /IOSPatterns/ViewController3.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController3.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController3 : UIViewController 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /IOSPatterns/ViewController5.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController5.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/29/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | @interface ViewController5 : UIViewController 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /IOSPatternsTests/IOSPatternsTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOSPatternsTests.h 3 | // IOSPatternsTests 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IOSPatternsTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /IOSPatterns/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator3.h: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator3.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface BigCalculator3 : NSObject 13 | 14 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /IOSPatterns/IOSPatterns-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'IOSPatterns' target in the 'IOSPatterns' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /IOSPatterns/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator2.h: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator2.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BigCalculator2 : NSObject 12 | 13 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2; 14 | 15 | @property (nonatomic) float calculationProgress; 16 | @property (nonatomic) float calculationResult; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator4.h: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator4.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BigCalculator4 : NSObject 12 | 13 | 14 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2; 15 | 16 | -(void) addCalculationProgressHandlerForTarget:(id)obj selector:(SEL)handler; 17 | -(void) addCalculationResultHandlerForTarget:(id)obj selector:(SEL)handler; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /IOSPatternsTests/IOSPatternsTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOSPatternsTests.m 3 | // IOSPatternsTests 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "IOSPatternsTests.h" 10 | 11 | @implementation IOSPatternsTests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in IOSPatternsTests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator5.h: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator5.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/29/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef void (^progressHandler)(float percentProgress); 13 | typedef void (^completionHandler)(float result); 14 | 15 | @interface BigCalculator5 : NSObject 16 | 17 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2; 18 | 19 | -(void) addCalculationProgressHandler:(progressHandler)handler; 20 | -(void) addCalculationResultHandler:(completionHandler)handler; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /IOSPatterns/NotificationDictKeys.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationDictKeys.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastian Windal on 12/6/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #ifndef IOSPatterns_NotificationDictKeys_h 10 | #define IOSPatterns_NotificationDictKeys_h 11 | 12 | static NSString *kBigCalculatorProgressChangeNotification = @"kBigCalculatorProgressChangeNotification"; 13 | static NSString *kBigCalculatorCalculationCompleteNotification = @"kBigCalculatorCalculationCompleteNotification"; 14 | 15 | static NSString *kCalProgressKey = @"kCalProgressKey"; 16 | static NSString *kCalResultKey = @"kCalResultKey"; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator1.h: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator1.h 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @class BigCalculator1; 13 | 14 | @protocol BigCalculatorDelegate 15 | 16 | @required 17 | 18 | -(void) bigCalculator:(BigCalculator1 *)calculator didFinishOperationWithResult:(float)result; 19 | 20 | @optional 21 | 22 | -(void) bigCalculator:(BigCalculator1 *)calculator madeProgressOnCalculation:(float)percentProgress; 23 | 24 | @end 25 | 26 | 27 | @interface BigCalculator1 : NSObject 28 | 29 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2; 30 | 31 | @property (nonatomic, weak) id delegate; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /IOSPatternsTests/IOSPatternsTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.freerangedevelopers.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator2.m: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator2.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "BigCalculator2.h" 10 | 11 | @implementation BigCalculator2 12 | { 13 | float _number1; 14 | float _number2; 15 | } 16 | 17 | -(id) init 18 | { 19 | self = [super init]; 20 | if (self) { 21 | self.calculationProgress = 0.0f; 22 | } 23 | return self; 24 | } 25 | 26 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2 27 | { 28 | _number1 = number1; 29 | _number2 = number2; 30 | [self performSelectorInBackground:@selector(doBackgroundWork) withObject:nil]; 31 | } 32 | 33 | -(void) doBackgroundWork 34 | { 35 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 36 | self.calculationProgress = 0.25; 37 | 38 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 39 | self.calculationProgress = 0.5f; 40 | 41 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 42 | self.calculationProgress = 0.75f; 43 | 44 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 45 | self.calculationProgress = 1.0f; 46 | 47 | // we are done publish the result of our calculation... 48 | self.calculationResult = _number1 * _number2; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /IOSPatterns/IOSPatterns-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.freerangedevelopers.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Storyboard 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator1.m: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator1.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "BigCalculator1.h" 10 | 11 | @implementation BigCalculator1 12 | { 13 | float _number1; 14 | float _number2; 15 | } 16 | 17 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2 18 | { 19 | _number1 = number1; 20 | _number2 = number2; 21 | [self performSelectorInBackground:@selector(doBackgroundWork) withObject:nil]; 22 | } 23 | 24 | -(void) doBackgroundWork 25 | { 26 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 27 | if ([self.delegate respondsToSelector:@selector(bigCalculator:madeProgressOnCalculation:)]) { 28 | [self.delegate bigCalculator:self madeProgressOnCalculation:0.25]; 29 | } 30 | 31 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 32 | if ([self.delegate respondsToSelector:@selector(bigCalculator:madeProgressOnCalculation:)]) { 33 | [self.delegate bigCalculator:self madeProgressOnCalculation:0.5]; 34 | } 35 | 36 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 37 | if ([self.delegate respondsToSelector:@selector(bigCalculator:madeProgressOnCalculation:)]) { 38 | [self.delegate bigCalculator:self madeProgressOnCalculation:0.75]; 39 | } 40 | 41 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 42 | if ([self.delegate respondsToSelector:@selector(bigCalculator:madeProgressOnCalculation:)]) { 43 | [self.delegate bigCalculator:self madeProgressOnCalculation:1.0]; 44 | } 45 | // we are done publish the result of our calculation... 46 | [self.delegate bigCalculator:self didFinishOperationWithResult:(_number1 + _number2)]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /IOSPatterns/ViewController5.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController5.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/29/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "ViewController5.h" 10 | #import "BigCalculator5.h" 11 | 12 | @interface ViewController5 () 13 | 14 | @property (nonatomic, strong) BigCalculator5 *bigCalculator; 15 | 16 | @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 17 | @property (weak, nonatomic) IBOutlet UILabel *resultLabel; 18 | @end 19 | 20 | @implementation ViewController5 21 | 22 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 23 | { 24 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 25 | if (self) { 26 | // Custom initialization 27 | } 28 | return self; 29 | } 30 | 31 | - (void)viewDidLoad 32 | { 33 | [super viewDidLoad]; 34 | 35 | self.bigCalculator = [[BigCalculator5 alloc] init]; 36 | 37 | [self.bigCalculator addCalculationProgressHandler:^(float percentProgress) { 38 | // update UI on main thread 39 | dispatch_async(dispatch_get_main_queue(), ^{ 40 | self.progressView.progress = percentProgress; 41 | }); 42 | }]; 43 | 44 | [self.bigCalculator addCalculationResultHandler:^(float result) { 45 | // update UI on main thread... 46 | dispatch_async(dispatch_get_main_queue(), ^{ 47 | self.progressView.progress = 1.0f; 48 | self.resultLabel.text = [NSString stringWithFormat:@"%f", result]; 49 | }); 50 | }]; 51 | 52 | [self.bigCalculator startBigCalculationWithNumber:7.0f andNumber:5.0f]; 53 | } 54 | 55 | - (void)didReceiveMemoryWarning 56 | { 57 | [super didReceiveMemoryWarning]; 58 | // Dispose of any resources that can be recreated. 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /IOSPatterns/ViewController4.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController4.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "ViewController4.h" 10 | #import "BigCalculator4.h" 11 | 12 | @interface ViewController4 () 13 | 14 | @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 15 | @property (weak, nonatomic) IBOutlet UILabel *resultLabel; 16 | 17 | @property (nonatomic, strong) BigCalculator4 *bigCalculator; 18 | 19 | @end 20 | 21 | @implementation ViewController4 22 | 23 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 24 | { 25 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 26 | if (self) { 27 | // Custom initialization 28 | } 29 | return self; 30 | } 31 | 32 | - (void)viewDidLoad 33 | { 34 | [super viewDidLoad]; 35 | 36 | self.bigCalculator = [[BigCalculator4 alloc] init]; 37 | 38 | [self.bigCalculator addCalculationProgressHandlerForTarget:self selector:@selector(calculationProgressChanged:)]; 39 | [self.bigCalculator addCalculationResultHandlerForTarget:self selector:@selector(calculationCompletedWithResult:)]; 40 | 41 | [self.bigCalculator startBigCalculationWithNumber:5.0 andNumber:7.0]; 42 | } 43 | 44 | -(void) calculationProgressChanged:(float)progress 45 | { 46 | // update UI on main thread 47 | dispatch_async(dispatch_get_main_queue(), ^{ 48 | self.progressView.progress = progress; 49 | }); 50 | } 51 | 52 | -(void) calculationCompletedWithResult:(float) result 53 | { 54 | // update UI on main thread 55 | dispatch_async(dispatch_get_main_queue(), ^{ 56 | self.progressView.progress = 1.0f; 57 | self.resultLabel.text = [NSString stringWithFormat:@"%f", result]; 58 | }); 59 | } 60 | 61 | 62 | - (void)didReceiveMemoryWarning 63 | { 64 | [super didReceiveMemoryWarning]; 65 | // Dispose of any resources that can be recreated. 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /IOSPatterns/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | return YES; 16 | } 17 | 18 | - (void)applicationWillResignActive:(UIApplication *)application 19 | { 20 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 21 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 22 | } 23 | 24 | - (void)applicationDidEnterBackground:(UIApplication *)application 25 | { 26 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 28 | } 29 | 30 | - (void)applicationWillEnterForeground:(UIApplication *)application 31 | { 32 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 33 | } 34 | 35 | - (void)applicationDidBecomeActive:(UIApplication *)application 36 | { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | - (void)applicationWillTerminate:(UIApplication *)application 41 | { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator3.m: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator3.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "BigCalculator3.h" 10 | #import "NotificationDictKeys.h" 11 | 12 | @implementation BigCalculator3 13 | { 14 | float _number1; 15 | float _number2; 16 | } 17 | 18 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2 19 | { 20 | _number1 = number1; 21 | _number2 = number2; 22 | [self performSelectorInBackground:@selector(doBackgroundWork) withObject:nil]; 23 | } 24 | 25 | -(void) doBackgroundWork 26 | { 27 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 28 | [[NSNotificationCenter defaultCenter] postNotificationName:kBigCalculatorProgressChangeNotification 29 | object:self 30 | userInfo:@{kCalProgressKey: @(0.25)}]; 31 | 32 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 33 | [[NSNotificationCenter defaultCenter] postNotificationName:kBigCalculatorProgressChangeNotification 34 | object:self 35 | userInfo:@{kCalProgressKey: @(0.5)}]; 36 | 37 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 38 | [[NSNotificationCenter defaultCenter] postNotificationName:kBigCalculatorProgressChangeNotification 39 | object:self 40 | userInfo:@{kCalProgressKey: @(0.75)}]; 41 | 42 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 43 | [[NSNotificationCenter defaultCenter] postNotificationName:kBigCalculatorProgressChangeNotification 44 | object:self 45 | userInfo:@{kCalProgressKey: @(1.0)}]; 46 | 47 | // we are done publish the result of our calculation... 48 | [[NSNotificationCenter defaultCenter] postNotificationName:kBigCalculatorCalculationCompleteNotification 49 | object:self 50 | userInfo:@{kCalResultKey: @(_number1 / _number2)}]; 51 | 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /IOSPatterns/ViewController3.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController3.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "ViewController3.h" 10 | #import "BigCalculator3.h" 11 | #import "NotificationDictKeys.h" 12 | 13 | @interface ViewController3 () 14 | 15 | @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 16 | @property (weak, nonatomic) IBOutlet UILabel *resultLabel; 17 | 18 | @property (nonatomic, strong) BigCalculator3 *bigCalculator; 19 | @end 20 | 21 | @implementation ViewController3 22 | 23 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 24 | { 25 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 26 | if (self) { 27 | // Custom initialization 28 | } 29 | return self; 30 | } 31 | 32 | 33 | - (void)viewDidLoad 34 | { 35 | [super viewDidLoad]; 36 | 37 | // subscribe to notifications 38 | 39 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(calculatorProgressChanged:) name:kBigCalculatorProgressChangeNotification object:nil]; 40 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(calculatorCompletedCalculation:) name:kBigCalculatorCalculationCompleteNotification object:nil]; 41 | 42 | self.bigCalculator = [[BigCalculator3 alloc] init]; 43 | 44 | [self.bigCalculator startBigCalculationWithNumber:7.0 andNumber:5.0]; 45 | } 46 | 47 | -(void) calculatorProgressChanged:(NSNotification *)notification 48 | { 49 | float value = [notification.userInfo[kCalProgressKey] floatValue]; 50 | // update the UI on the Main thread! 51 | dispatch_async(dispatch_get_main_queue(), ^{ 52 | self.progressView.progress = value; 53 | }); 54 | } 55 | 56 | -(void) calculatorCompletedCalculation:(NSNotification *)notification 57 | { 58 | NSString *str = [NSString stringWithFormat:@"%f", [notification.userInfo[kCalResultKey] floatValue]]; 59 | // update the UI on the Main thread! 60 | dispatch_async(dispatch_get_main_queue(), ^{ 61 | self.progressView.progress = 1.0f; 62 | self.resultLabel.text = str; 63 | }); 64 | 65 | } 66 | 67 | 68 | - (void)didReceiveMemoryWarning 69 | { 70 | [super didReceiveMemoryWarning]; 71 | // Dispose of any resources that can be recreated. 72 | } 73 | 74 | -(void) dealloc 75 | { 76 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /IOSPatterns/UIViewController1.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController1.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "UIViewController1.h" 10 | #import "BigCalculator1.h" 11 | 12 | // we are specifying we are a BigCalculatorDelegate 13 | @interface UIViewController1 () 14 | { 15 | float _progress; 16 | float _result; 17 | } 18 | @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 19 | @property (weak, nonatomic) IBOutlet UILabel *resultLabel; 20 | 21 | @property (nonatomic, strong) BigCalculator1 *bigCalculator; 22 | 23 | @end 24 | 25 | @implementation UIViewController1 26 | 27 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 28 | { 29 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 30 | if (self) { 31 | // Custom initialization 32 | } 33 | return self; 34 | } 35 | 36 | - (void)viewDidLoad 37 | { 38 | [super viewDidLoad]; 39 | 40 | // we set ourselves as the delegate of big calculator 41 | self.bigCalculator = [[BigCalculator1 alloc] init]; 42 | self.bigCalculator.delegate = self; 43 | 44 | [self.bigCalculator startBigCalculationWithNumber:7.0 andNumber:5.0]; 45 | } 46 | 47 | - (void)didReceiveMemoryWarning 48 | { 49 | [super didReceiveMemoryWarning]; 50 | // Dispose of any resources that can be recreated. 51 | } 52 | 53 | #pragma mark BigCalculatorDelegate 54 | 55 | // we implement the BigCalculatorDelegate methods, because we set ourslef as bigCalculator.delegate we will be 56 | // called by big calculator 57 | 58 | -(void) bigCalculator:(BigCalculator1 *)calculator madeProgressOnCalculation:(float)percentProgress 59 | { 60 | // update UI to increase progress (in foreground thread!) 61 | _progress = percentProgress; 62 | [self performSelectorOnMainThread:@selector(updateUI) withObject:nil waitUntilDone:NO]; 63 | 64 | } 65 | 66 | -(void) bigCalculator:(BigCalculator1 *)calculator didFinishOperationWithResult:(float)result 67 | { 68 | // update UI to show calculation result (in foreground thread!) 69 | _result = result; 70 | _progress = 1.0f; 71 | [self performSelectorOnMainThread:@selector(updateUI) withObject:nil waitUntilDone:NO]; 72 | } 73 | 74 | -(void) updateUI 75 | { 76 | self.progressView.progress = _progress; 77 | if (_progress == 1.0f) 78 | self.resultLabel.text = [NSString stringWithFormat:@"%f", _result]; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator5.m: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator5.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/29/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "BigCalculator5.h" 10 | 11 | @interface BigCalculator5() 12 | { 13 | float _number1; 14 | float _number2; 15 | } 16 | 17 | @property (nonatomic, strong) NSMutableArray *progressHandlers; // array of progressHandler objects 18 | @property (nonatomic, strong) NSMutableArray *completionHandlers; // array of completionHandler objects. 19 | 20 | @end 21 | 22 | 23 | @implementation BigCalculator5 24 | 25 | -(NSMutableArray *) progressHandlers 26 | { 27 | if (_progressHandlers == nil) 28 | _progressHandlers = [[ NSMutableArray alloc] init]; 29 | 30 | return _progressHandlers; 31 | } 32 | 33 | -(NSMutableArray *) completionHandlers 34 | { 35 | if (_completionHandlers == nil) 36 | _completionHandlers = [[ NSMutableArray alloc] init]; 37 | 38 | return _completionHandlers; 39 | } 40 | 41 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2 42 | { 43 | _number1 = number1; 44 | _number2 = number2; 45 | [self performSelectorInBackground:@selector(doBackgroundWork) withObject:nil]; 46 | } 47 | 48 | -(void) doBackgroundWork 49 | { 50 | // note the argument is really index 2, index 0 is the object, and index 1 is the selector. 51 | // Kind of obscure. 52 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 53 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 54 | progressHandler handler = obj; 55 | handler(0.25); 56 | }]; 57 | 58 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 59 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 60 | progressHandler handler = obj; 61 | handler(0.5); 62 | }]; 63 | 64 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 65 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 66 | progressHandler handler = obj; 67 | handler(0.75); 68 | }]; 69 | 70 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 71 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 72 | progressHandler handler = obj; 73 | handler(1.0f); 74 | }]; 75 | 76 | // we are done publish the result of our calculation... 77 | [self.completionHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 78 | completionHandler handler = obj; 79 | handler(pow(_number1, _number2)); 80 | }]; 81 | 82 | } 83 | 84 | -(void) addCalculationProgressHandler:(progressHandler)handler 85 | { 86 | // always copy a block when adding it to a collection!!! 87 | [self.progressHandlers addObject:[handler copy]]; 88 | } 89 | 90 | -(void) addCalculationResultHandler:(completionHandler)handler 91 | { 92 | // always copy a block when adding it to a collection!!! 93 | [self.completionHandlers addObject:[handler copy]]; 94 | } 95 | 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /IOSPatterns/ViewController2.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController2.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "ViewController2.h" 10 | #import "BigCalculator2.h" 11 | 12 | @interface ViewController2 () 13 | 14 | @property (nonatomic, strong) BigCalculator2 *bigCalculator; 15 | 16 | @property (weak, nonatomic) IBOutlet UILabel *resultLabel; 17 | @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 18 | @end 19 | 20 | @implementation ViewController2 21 | 22 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 23 | { 24 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 25 | if (self) { 26 | // Custom initialization 27 | } 28 | return self; 29 | } 30 | 31 | -(void) setBigCalculator:(BigCalculator2 *)bigCalculator 32 | { 33 | // unsubscribe from the old object 34 | [_bigCalculator removeObserver:self forKeyPath:@"calculationProgress"]; 35 | [_bigCalculator removeObserver:self forKeyPath:@"calculationResult"]; 36 | 37 | _bigCalculator = bigCalculator; 38 | 39 | // subscribe to new object 40 | // options is set to NSKeyValueObservingOptionNew, so the change dictionary in the 41 | // observalueForKeyPath:ofObject:change:context: callback will contain the changed value 42 | // at the NSKeyValueChangeNewKey key. 43 | [self.bigCalculator addObserver:self forKeyPath:@"calculationProgress" options:NSKeyValueObservingOptionNew context:nil]; 44 | [self.bigCalculator addObserver:self forKeyPath:@"calculationResult" options:NSKeyValueObservingOptionNew context:nil]; 45 | } 46 | 47 | - (void)viewDidLoad 48 | { 49 | [super viewDidLoad]; 50 | 51 | self.bigCalculator = [[BigCalculator2 alloc] init]; 52 | [self.bigCalculator startBigCalculationWithNumber:7.0f andNumber:5.0f]; 53 | self.progressView.progress = 0.0; 54 | } 55 | 56 | - (void)didReceiveMemoryWarning 57 | { 58 | [super didReceiveMemoryWarning]; 59 | } 60 | 61 | -(void) dealloc 62 | { 63 | // object will not be freed unless you unsubscrive from KVO 64 | // which is achieved simply by setting the objet to nil (see what setBigCalculator: is doing.) 65 | self.bigCalculator = nil; 66 | } 67 | 68 | - (void)observeValueForKeyPath:(NSString *)keyPath 69 | ofObject:(id)object 70 | change:(NSDictionary *)change 71 | context:(void *)context 72 | { 73 | 74 | if ([keyPath isEqualToString:@"calculationProgress"]) { 75 | // update ui (from the UI Thread!) 76 | dispatch_async(dispatch_get_main_queue(), ^{ 77 | float value = [change[NSKeyValueChangeNewKey] floatValue]; 78 | self.progressView.progress = value; 79 | }); 80 | } else if ([keyPath isEqualToString:@"calculationResult"]) { 81 | // update ui (from the UI Thread!) 82 | dispatch_async(dispatch_get_main_queue(), ^{ 83 | self.progressView.progress = 1.0f; 84 | NSString *str = [NSString stringWithFormat:@"%f", [change[NSKeyValueChangeNewKey] floatValue]]; 85 | self.resultLabel.text = str; 86 | }); 87 | } 88 | 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /IOSPatterns/BigCalculator4.m: -------------------------------------------------------------------------------- 1 | // 2 | // BigCalculator4.m 3 | // IOSPatterns 4 | // 5 | // Created by Sebastien on 11/28/12. 6 | // Copyright (c) 2012 Sebastien. All rights reserved. 7 | // 8 | 9 | #import "BigCalculator4.h" 10 | 11 | @interface BigCalculator4() 12 | { 13 | float _number1; 14 | float _number2; 15 | } 16 | 17 | @property (nonatomic, strong) NSMutableArray *progressHandlers; // array of NSInvocation 18 | @property (nonatomic, strong) NSMutableArray *completionHandlers; // array of NSInvocation 19 | 20 | @end 21 | 22 | @implementation BigCalculator4 23 | 24 | -(NSMutableArray *) progressHandlers 25 | { 26 | if (_progressHandlers == nil) 27 | _progressHandlers = [[NSMutableArray alloc] init]; 28 | return _progressHandlers; 29 | } 30 | 31 | -(NSMutableArray *) completionHandlers 32 | { 33 | if (_completionHandlers == nil) 34 | _completionHandlers = [[NSMutableArray alloc] init]; 35 | return _completionHandlers; 36 | } 37 | 38 | 39 | -(void) startBigCalculationWithNumber:(float)number1 andNumber:(float)number2 40 | { 41 | _number1 = number1; 42 | _number2 = number2; 43 | [self performSelectorInBackground:@selector(doBackgroundWork) withObject:nil]; 44 | 45 | } 46 | 47 | -(void) doBackgroundWork 48 | { 49 | // note the argument is really index 2, index 0 is the object, and index 1 is the selector. 50 | // Kind of obscure. 51 | 52 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 53 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 54 | NSInvocation *invocation = obj; 55 | float progress = 0.25; 56 | [invocation setArgument:&progress atIndex:2]; 57 | [invocation invoke]; 58 | }]; 59 | 60 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 61 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 62 | NSInvocation *invocation = obj; 63 | float progress = 0.5; 64 | [invocation setArgument:&progress atIndex:2]; 65 | [invocation invoke]; 66 | }]; 67 | 68 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 69 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 70 | NSInvocation *invocation = obj; 71 | float progress = 0.75; 72 | [invocation setArgument:&progress atIndex:2]; 73 | [invocation invoke]; 74 | }]; 75 | 76 | [NSThread sleepForTimeInterval:1.0]; // sleep for one second 77 | [self.progressHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 78 | NSInvocation *invocation = obj; 79 | float progress = 1.0; 80 | [invocation setArgument:&progress atIndex:2]; 81 | [invocation invoke]; 82 | }]; 83 | 84 | // we are done publish the result of our calculation... 85 | [self.completionHandlers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 86 | NSInvocation *invocation = obj; 87 | float result = _number1 - _number2; 88 | [invocation setArgument:&result atIndex:2]; 89 | [invocation invoke]; 90 | }]; 91 | } 92 | 93 | 94 | -(void) addCalculationProgressHandlerForTarget:(id)obj selector:(SEL)handler 95 | { 96 | NSMethodSignature *aSignature; 97 | aSignature = [[obj class] instanceMethodSignatureForSelector:handler]; 98 | 99 | NSInvocation * invocation = [NSInvocation 100 | invocationWithMethodSignature:aSignature]; 101 | 102 | invocation.target = obj; 103 | invocation.selector = handler; 104 | 105 | [self.progressHandlers addObject:invocation]; 106 | } 107 | 108 | -(void) addCalculationResultHandlerForTarget:(id)obj selector:(SEL)handler 109 | { 110 | NSMethodSignature *aSignature; 111 | aSignature = [[obj class] instanceMethodSignatureForSelector:handler]; 112 | 113 | NSInvocation * invocation = [NSInvocation 114 | invocationWithMethodSignature:aSignature]; 115 | 116 | invocation.target = obj; 117 | invocation.selector = handler; 118 | 119 | [self.completionHandlers addObject:invocation]; 120 | } 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /IOSPatterns.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BE687CD71666ECC500F84235 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE687CD61666ECC500F84235 /* UIKit.framework */; }; 11 | BE687CD91666ECC500F84235 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE687CD81666ECC500F84235 /* Foundation.framework */; }; 12 | BE687CDB1666ECC500F84235 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE687CDA1666ECC500F84235 /* CoreGraphics.framework */; }; 13 | BE687CE11666ECC500F84235 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BE687CDF1666ECC500F84235 /* InfoPlist.strings */; }; 14 | BE687CE31666ECC500F84235 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BE687CE21666ECC500F84235 /* main.m */; }; 15 | BE687CE71666ECC500F84235 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BE687CE61666ECC500F84235 /* AppDelegate.m */; }; 16 | BE687CE91666ECC500F84235 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = BE687CE81666ECC500F84235 /* Default.png */; }; 17 | BE687CEB1666ECC500F84235 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE687CEA1666ECC500F84235 /* Default@2x.png */; }; 18 | BE687CED1666ECC500F84235 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE687CEC1666ECC500F84235 /* Default-568h@2x.png */; }; 19 | BE687CF51666ECC500F84235 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE687CF41666ECC500F84235 /* SenTestingKit.framework */; }; 20 | BE687CF61666ECC500F84235 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE687CD61666ECC500F84235 /* UIKit.framework */; }; 21 | BE687CF71666ECC500F84235 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE687CD81666ECC500F84235 /* Foundation.framework */; }; 22 | BE687CFF1666ECC500F84235 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BE687CFD1666ECC500F84235 /* InfoPlist.strings */; }; 23 | BE687D021666ECC500F84235 /* IOSPatternsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BE687D011666ECC500F84235 /* IOSPatternsTests.m */; }; 24 | BE687D0D1666ECDA00F84235 /* BigCalculator1.m in Sources */ = {isa = PBXBuildFile; fileRef = BE687D0C1666ECDA00F84235 /* BigCalculator1.m */; }; 25 | BE687D101666FF8A00F84235 /* UIViewController1.m in Sources */ = {isa = PBXBuildFile; fileRef = BE687D0F1666FF8A00F84235 /* UIViewController1.m */; }; 26 | BE687D14166706E800F84235 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BE687D13166706E800F84235 /* Storyboard.storyboard */; }; 27 | BEAC6E65166709F4002E465D /* BigCalculator2.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E64166709F4002E465D /* BigCalculator2.m */; }; 28 | BEAC6E6C16670AD5002E465D /* ViewController2.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E6B16670AD5002E465D /* ViewController2.m */; }; 29 | BEAC6E701667151E002E465D /* ViewController3.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E6F1667151E002E465D /* ViewController3.m */; }; 30 | BEAC6E7316671532002E465D /* BigCalculator3.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E7216671532002E465D /* BigCalculator3.m */; }; 31 | BEAC6E791667198D002E465D /* BigCalculator4.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E781667198D002E465D /* BigCalculator4.m */; }; 32 | BEAC6E7C16671E17002E465D /* ViewController4.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E7B16671E17002E465D /* ViewController4.m */; }; 33 | BEAC6E7F166724F4002E465D /* ViewController5.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E7E166724F4002E465D /* ViewController5.m */; }; 34 | BEAC6E8216672509002E465D /* BigCalculator5.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAC6E8116672509002E465D /* BigCalculator5.m */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXContainerItemProxy section */ 38 | BE687CF81666ECC500F84235 /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = BE687CC91666ECC500F84235 /* Project object */; 41 | proxyType = 1; 42 | remoteGlobalIDString = BE687CD11666ECC500F84235; 43 | remoteInfo = IOSPatterns; 44 | }; 45 | /* End PBXContainerItemProxy section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | 84FC4E871670D7BC00BE61EA /* NotificationDictKeys.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationDictKeys.h; sourceTree = ""; }; 49 | BE687CD21666ECC500F84235 /* IOSPatterns.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IOSPatterns.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | BE687CD61666ECC500F84235 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 51 | BE687CD81666ECC500F84235 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 52 | BE687CDA1666ECC500F84235 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 53 | BE687CDE1666ECC500F84235 /* IOSPatterns-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IOSPatterns-Info.plist"; sourceTree = ""; }; 54 | BE687CE01666ECC500F84235 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 55 | BE687CE21666ECC500F84235 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | BE687CE41666ECC500F84235 /* IOSPatterns-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IOSPatterns-Prefix.pch"; sourceTree = ""; }; 57 | BE687CE51666ECC500F84235 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 58 | BE687CE61666ECC500F84235 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 59 | BE687CE81666ECC500F84235 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 60 | BE687CEA1666ECC500F84235 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 61 | BE687CEC1666ECC500F84235 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 62 | BE687CF31666ECC500F84235 /* IOSPatternsTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IOSPatternsTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | BE687CF41666ECC500F84235 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 64 | BE687CFC1666ECC500F84235 /* IOSPatternsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IOSPatternsTests-Info.plist"; sourceTree = ""; }; 65 | BE687CFE1666ECC500F84235 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 66 | BE687D001666ECC500F84235 /* IOSPatternsTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IOSPatternsTests.h; sourceTree = ""; }; 67 | BE687D011666ECC500F84235 /* IOSPatternsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IOSPatternsTests.m; sourceTree = ""; }; 68 | BE687D0B1666ECDA00F84235 /* BigCalculator1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BigCalculator1.h; sourceTree = ""; }; 69 | BE687D0C1666ECDA00F84235 /* BigCalculator1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BigCalculator1.m; sourceTree = ""; }; 70 | BE687D0E1666FF8A00F84235 /* UIViewController1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIViewController1.h; sourceTree = ""; }; 71 | BE687D0F1666FF8A00F84235 /* UIViewController1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIViewController1.m; sourceTree = ""; }; 72 | BE687D13166706E800F84235 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard.storyboard; path = ../Storyboard.storyboard; sourceTree = ""; }; 73 | BEAC6E63166709F4002E465D /* BigCalculator2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BigCalculator2.h; sourceTree = ""; }; 74 | BEAC6E64166709F4002E465D /* BigCalculator2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BigCalculator2.m; sourceTree = ""; }; 75 | BEAC6E6A16670AD5002E465D /* ViewController2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController2.h; sourceTree = ""; }; 76 | BEAC6E6B16670AD5002E465D /* ViewController2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController2.m; sourceTree = ""; }; 77 | BEAC6E6E1667151E002E465D /* ViewController3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController3.h; sourceTree = ""; }; 78 | BEAC6E6F1667151E002E465D /* ViewController3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController3.m; sourceTree = ""; }; 79 | BEAC6E7116671532002E465D /* BigCalculator3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BigCalculator3.h; sourceTree = ""; }; 80 | BEAC6E7216671532002E465D /* BigCalculator3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BigCalculator3.m; sourceTree = ""; }; 81 | BEAC6E771667198D002E465D /* BigCalculator4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BigCalculator4.h; sourceTree = ""; }; 82 | BEAC6E781667198D002E465D /* BigCalculator4.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BigCalculator4.m; sourceTree = ""; }; 83 | BEAC6E7A16671E17002E465D /* ViewController4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController4.h; sourceTree = ""; }; 84 | BEAC6E7B16671E17002E465D /* ViewController4.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController4.m; sourceTree = ""; }; 85 | BEAC6E7D166724F4002E465D /* ViewController5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController5.h; sourceTree = ""; }; 86 | BEAC6E7E166724F4002E465D /* ViewController5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController5.m; sourceTree = ""; }; 87 | BEAC6E8016672509002E465D /* BigCalculator5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BigCalculator5.h; sourceTree = ""; }; 88 | BEAC6E8116672509002E465D /* BigCalculator5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BigCalculator5.m; sourceTree = ""; }; 89 | /* End PBXFileReference section */ 90 | 91 | /* Begin PBXFrameworksBuildPhase section */ 92 | BE687CCF1666ECC500F84235 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | BE687CD71666ECC500F84235 /* UIKit.framework in Frameworks */, 97 | BE687CD91666ECC500F84235 /* Foundation.framework in Frameworks */, 98 | BE687CDB1666ECC500F84235 /* CoreGraphics.framework in Frameworks */, 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | BE687CEF1666ECC500F84235 /* Frameworks */ = { 103 | isa = PBXFrameworksBuildPhase; 104 | buildActionMask = 2147483647; 105 | files = ( 106 | BE687CF51666ECC500F84235 /* SenTestingKit.framework in Frameworks */, 107 | BE687CF61666ECC500F84235 /* UIKit.framework in Frameworks */, 108 | BE687CF71666ECC500F84235 /* Foundation.framework in Frameworks */, 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | /* End PBXFrameworksBuildPhase section */ 113 | 114 | /* Begin PBXGroup section */ 115 | BE687CC71666ECC500F84235 = { 116 | isa = PBXGroup; 117 | children = ( 118 | BE687CDC1666ECC500F84235 /* IOSPatterns */, 119 | BE687CFA1666ECC500F84235 /* IOSPatternsTests */, 120 | BE687CD51666ECC500F84235 /* Frameworks */, 121 | BE687CD31666ECC500F84235 /* Products */, 122 | ); 123 | sourceTree = ""; 124 | }; 125 | BE687CD31666ECC500F84235 /* Products */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | BE687CD21666ECC500F84235 /* IOSPatterns.app */, 129 | BE687CF31666ECC500F84235 /* IOSPatternsTests.octest */, 130 | ); 131 | name = Products; 132 | sourceTree = ""; 133 | }; 134 | BE687CD51666ECC500F84235 /* Frameworks */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | BE687CD61666ECC500F84235 /* UIKit.framework */, 138 | BE687CD81666ECC500F84235 /* Foundation.framework */, 139 | BE687CDA1666ECC500F84235 /* CoreGraphics.framework */, 140 | BE687CF41666ECC500F84235 /* SenTestingKit.framework */, 141 | ); 142 | name = Frameworks; 143 | sourceTree = ""; 144 | }; 145 | BE687CDC1666ECC500F84235 /* IOSPatterns */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | BEAC6E7616671965002E465D /* 5 - Callbacks with blocks */, 149 | BEAC6E7516671926002E465D /* 4 - Callbacks with selectors */, 150 | BEAC6E6D166714FF002E465D /* 3 - NSNotification */, 151 | BE687D16166707E000F84235 /* 2 - KVO */, 152 | BE687D15166707D200F84235 /* 1 - delegation */, 153 | BE687CE51666ECC500F84235 /* AppDelegate.h */, 154 | BE687CE61666ECC500F84235 /* AppDelegate.m */, 155 | BE687D13166706E800F84235 /* Storyboard.storyboard */, 156 | BE687CDD1666ECC500F84235 /* Supporting Files */, 157 | ); 158 | path = IOSPatterns; 159 | sourceTree = ""; 160 | }; 161 | BE687CDD1666ECC500F84235 /* Supporting Files */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | BE687CDE1666ECC500F84235 /* IOSPatterns-Info.plist */, 165 | BE687CDF1666ECC500F84235 /* InfoPlist.strings */, 166 | BE687CE21666ECC500F84235 /* main.m */, 167 | BE687CE41666ECC500F84235 /* IOSPatterns-Prefix.pch */, 168 | BE687CE81666ECC500F84235 /* Default.png */, 169 | BE687CEA1666ECC500F84235 /* Default@2x.png */, 170 | BE687CEC1666ECC500F84235 /* Default-568h@2x.png */, 171 | ); 172 | name = "Supporting Files"; 173 | sourceTree = ""; 174 | }; 175 | BE687CFA1666ECC500F84235 /* IOSPatternsTests */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | BE687D001666ECC500F84235 /* IOSPatternsTests.h */, 179 | BE687D011666ECC500F84235 /* IOSPatternsTests.m */, 180 | BE687CFB1666ECC500F84235 /* Supporting Files */, 181 | ); 182 | path = IOSPatternsTests; 183 | sourceTree = ""; 184 | }; 185 | BE687CFB1666ECC500F84235 /* Supporting Files */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | BE687CFC1666ECC500F84235 /* IOSPatternsTests-Info.plist */, 189 | BE687CFD1666ECC500F84235 /* InfoPlist.strings */, 190 | ); 191 | name = "Supporting Files"; 192 | sourceTree = ""; 193 | }; 194 | BE687D15166707D200F84235 /* 1 - delegation */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | BE687D0B1666ECDA00F84235 /* BigCalculator1.h */, 198 | BE687D0C1666ECDA00F84235 /* BigCalculator1.m */, 199 | BE687D0E1666FF8A00F84235 /* UIViewController1.h */, 200 | BE687D0F1666FF8A00F84235 /* UIViewController1.m */, 201 | ); 202 | name = "1 - delegation"; 203 | sourceTree = ""; 204 | }; 205 | BE687D16166707E000F84235 /* 2 - KVO */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | BEAC6E63166709F4002E465D /* BigCalculator2.h */, 209 | BEAC6E64166709F4002E465D /* BigCalculator2.m */, 210 | BEAC6E6A16670AD5002E465D /* ViewController2.h */, 211 | BEAC6E6B16670AD5002E465D /* ViewController2.m */, 212 | ); 213 | name = "2 - KVO"; 214 | sourceTree = ""; 215 | }; 216 | BEAC6E6D166714FF002E465D /* 3 - NSNotification */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | BEAC6E6E1667151E002E465D /* ViewController3.h */, 220 | BEAC6E6F1667151E002E465D /* ViewController3.m */, 221 | BEAC6E7116671532002E465D /* BigCalculator3.h */, 222 | BEAC6E7216671532002E465D /* BigCalculator3.m */, 223 | 84FC4E871670D7BC00BE61EA /* NotificationDictKeys.h */, 224 | ); 225 | name = "3 - NSNotification"; 226 | sourceTree = ""; 227 | }; 228 | BEAC6E7516671926002E465D /* 4 - Callbacks with selectors */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | BEAC6E771667198D002E465D /* BigCalculator4.h */, 232 | BEAC6E781667198D002E465D /* BigCalculator4.m */, 233 | BEAC6E7A16671E17002E465D /* ViewController4.h */, 234 | BEAC6E7B16671E17002E465D /* ViewController4.m */, 235 | ); 236 | name = "4 - Callbacks with selectors"; 237 | sourceTree = ""; 238 | }; 239 | BEAC6E7616671965002E465D /* 5 - Callbacks with blocks */ = { 240 | isa = PBXGroup; 241 | children = ( 242 | BEAC6E7D166724F4002E465D /* ViewController5.h */, 243 | BEAC6E7E166724F4002E465D /* ViewController5.m */, 244 | BEAC6E8016672509002E465D /* BigCalculator5.h */, 245 | BEAC6E8116672509002E465D /* BigCalculator5.m */, 246 | ); 247 | name = "5 - Callbacks with blocks"; 248 | sourceTree = ""; 249 | }; 250 | /* End PBXGroup section */ 251 | 252 | /* Begin PBXNativeTarget section */ 253 | BE687CD11666ECC500F84235 /* IOSPatterns */ = { 254 | isa = PBXNativeTarget; 255 | buildConfigurationList = BE687D051666ECC500F84235 /* Build configuration list for PBXNativeTarget "IOSPatterns" */; 256 | buildPhases = ( 257 | BE687CCE1666ECC500F84235 /* Sources */, 258 | BE687CCF1666ECC500F84235 /* Frameworks */, 259 | BE687CD01666ECC500F84235 /* Resources */, 260 | ); 261 | buildRules = ( 262 | ); 263 | dependencies = ( 264 | ); 265 | name = IOSPatterns; 266 | productName = IOSPatterns; 267 | productReference = BE687CD21666ECC500F84235 /* IOSPatterns.app */; 268 | productType = "com.apple.product-type.application"; 269 | }; 270 | BE687CF21666ECC500F84235 /* IOSPatternsTests */ = { 271 | isa = PBXNativeTarget; 272 | buildConfigurationList = BE687D081666ECC500F84235 /* Build configuration list for PBXNativeTarget "IOSPatternsTests" */; 273 | buildPhases = ( 274 | BE687CEE1666ECC500F84235 /* Sources */, 275 | BE687CEF1666ECC500F84235 /* Frameworks */, 276 | BE687CF01666ECC500F84235 /* Resources */, 277 | BE687CF11666ECC500F84235 /* ShellScript */, 278 | ); 279 | buildRules = ( 280 | ); 281 | dependencies = ( 282 | BE687CF91666ECC500F84235 /* PBXTargetDependency */, 283 | ); 284 | name = IOSPatternsTests; 285 | productName = IOSPatternsTests; 286 | productReference = BE687CF31666ECC500F84235 /* IOSPatternsTests.octest */; 287 | productType = "com.apple.product-type.bundle"; 288 | }; 289 | /* End PBXNativeTarget section */ 290 | 291 | /* Begin PBXProject section */ 292 | BE687CC91666ECC500F84235 /* Project object */ = { 293 | isa = PBXProject; 294 | attributes = { 295 | LastUpgradeCheck = 0450; 296 | ORGANIZATIONNAME = Sebastien; 297 | }; 298 | buildConfigurationList = BE687CCC1666ECC500F84235 /* Build configuration list for PBXProject "IOSPatterns" */; 299 | compatibilityVersion = "Xcode 3.2"; 300 | developmentRegion = English; 301 | hasScannedForEncodings = 0; 302 | knownRegions = ( 303 | en, 304 | ); 305 | mainGroup = BE687CC71666ECC500F84235; 306 | productRefGroup = BE687CD31666ECC500F84235 /* Products */; 307 | projectDirPath = ""; 308 | projectRoot = ""; 309 | targets = ( 310 | BE687CD11666ECC500F84235 /* IOSPatterns */, 311 | BE687CF21666ECC500F84235 /* IOSPatternsTests */, 312 | ); 313 | }; 314 | /* End PBXProject section */ 315 | 316 | /* Begin PBXResourcesBuildPhase section */ 317 | BE687CD01666ECC500F84235 /* Resources */ = { 318 | isa = PBXResourcesBuildPhase; 319 | buildActionMask = 2147483647; 320 | files = ( 321 | BE687CE11666ECC500F84235 /* InfoPlist.strings in Resources */, 322 | BE687CE91666ECC500F84235 /* Default.png in Resources */, 323 | BE687CEB1666ECC500F84235 /* Default@2x.png in Resources */, 324 | BE687CED1666ECC500F84235 /* Default-568h@2x.png in Resources */, 325 | BE687D14166706E800F84235 /* Storyboard.storyboard in Resources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | BE687CF01666ECC500F84235 /* Resources */ = { 330 | isa = PBXResourcesBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | BE687CFF1666ECC500F84235 /* InfoPlist.strings in Resources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | /* End PBXResourcesBuildPhase section */ 338 | 339 | /* Begin PBXShellScriptBuildPhase section */ 340 | BE687CF11666ECC500F84235 /* ShellScript */ = { 341 | isa = PBXShellScriptBuildPhase; 342 | buildActionMask = 2147483647; 343 | files = ( 344 | ); 345 | inputPaths = ( 346 | ); 347 | outputPaths = ( 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | shellPath = /bin/sh; 351 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 352 | }; 353 | /* End PBXShellScriptBuildPhase section */ 354 | 355 | /* Begin PBXSourcesBuildPhase section */ 356 | BE687CCE1666ECC500F84235 /* Sources */ = { 357 | isa = PBXSourcesBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | BE687CE31666ECC500F84235 /* main.m in Sources */, 361 | BE687CE71666ECC500F84235 /* AppDelegate.m in Sources */, 362 | BE687D0D1666ECDA00F84235 /* BigCalculator1.m in Sources */, 363 | BE687D101666FF8A00F84235 /* UIViewController1.m in Sources */, 364 | BEAC6E65166709F4002E465D /* BigCalculator2.m in Sources */, 365 | BEAC6E6C16670AD5002E465D /* ViewController2.m in Sources */, 366 | BEAC6E701667151E002E465D /* ViewController3.m in Sources */, 367 | BEAC6E7316671532002E465D /* BigCalculator3.m in Sources */, 368 | BEAC6E791667198D002E465D /* BigCalculator4.m in Sources */, 369 | BEAC6E7C16671E17002E465D /* ViewController4.m in Sources */, 370 | BEAC6E7F166724F4002E465D /* ViewController5.m in Sources */, 371 | BEAC6E8216672509002E465D /* BigCalculator5.m in Sources */, 372 | ); 373 | runOnlyForDeploymentPostprocessing = 0; 374 | }; 375 | BE687CEE1666ECC500F84235 /* Sources */ = { 376 | isa = PBXSourcesBuildPhase; 377 | buildActionMask = 2147483647; 378 | files = ( 379 | BE687D021666ECC500F84235 /* IOSPatternsTests.m in Sources */, 380 | ); 381 | runOnlyForDeploymentPostprocessing = 0; 382 | }; 383 | /* End PBXSourcesBuildPhase section */ 384 | 385 | /* Begin PBXTargetDependency section */ 386 | BE687CF91666ECC500F84235 /* PBXTargetDependency */ = { 387 | isa = PBXTargetDependency; 388 | target = BE687CD11666ECC500F84235 /* IOSPatterns */; 389 | targetProxy = BE687CF81666ECC500F84235 /* PBXContainerItemProxy */; 390 | }; 391 | /* End PBXTargetDependency section */ 392 | 393 | /* Begin PBXVariantGroup section */ 394 | BE687CDF1666ECC500F84235 /* InfoPlist.strings */ = { 395 | isa = PBXVariantGroup; 396 | children = ( 397 | BE687CE01666ECC500F84235 /* en */, 398 | ); 399 | name = InfoPlist.strings; 400 | sourceTree = ""; 401 | }; 402 | BE687CFD1666ECC500F84235 /* InfoPlist.strings */ = { 403 | isa = PBXVariantGroup; 404 | children = ( 405 | BE687CFE1666ECC500F84235 /* en */, 406 | ); 407 | name = InfoPlist.strings; 408 | sourceTree = ""; 409 | }; 410 | /* End PBXVariantGroup section */ 411 | 412 | /* Begin XCBuildConfiguration section */ 413 | BE687D031666ECC500F84235 /* Debug */ = { 414 | isa = XCBuildConfiguration; 415 | buildSettings = { 416 | ALWAYS_SEARCH_USER_PATHS = NO; 417 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 418 | CLANG_CXX_LIBRARY = "libc++"; 419 | CLANG_ENABLE_OBJC_ARC = YES; 420 | CLANG_WARN_EMPTY_BODY = YES; 421 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 422 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 423 | COPY_PHASE_STRIP = NO; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_DYNAMIC_NO_PIC = NO; 426 | GCC_OPTIMIZATION_LEVEL = 0; 427 | GCC_PREPROCESSOR_DEFINITIONS = ( 428 | "DEBUG=1", 429 | "$(inherited)", 430 | ); 431 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 432 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 433 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 434 | GCC_WARN_UNUSED_VARIABLE = YES; 435 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 436 | ONLY_ACTIVE_ARCH = YES; 437 | SDKROOT = iphoneos; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | }; 440 | name = Debug; 441 | }; 442 | BE687D041666ECC500F84235 /* Release */ = { 443 | isa = XCBuildConfiguration; 444 | buildSettings = { 445 | ALWAYS_SEARCH_USER_PATHS = NO; 446 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 447 | CLANG_CXX_LIBRARY = "libc++"; 448 | CLANG_ENABLE_OBJC_ARC = YES; 449 | CLANG_WARN_EMPTY_BODY = YES; 450 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 452 | COPY_PHASE_STRIP = YES; 453 | GCC_C_LANGUAGE_STANDARD = gnu99; 454 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 455 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 456 | GCC_WARN_UNUSED_VARIABLE = YES; 457 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 458 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 459 | SDKROOT = iphoneos; 460 | TARGETED_DEVICE_FAMILY = "1,2"; 461 | VALIDATE_PRODUCT = YES; 462 | }; 463 | name = Release; 464 | }; 465 | BE687D061666ECC500F84235 /* Debug */ = { 466 | isa = XCBuildConfiguration; 467 | buildSettings = { 468 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 469 | GCC_PREFIX_HEADER = "IOSPatterns/IOSPatterns-Prefix.pch"; 470 | INFOPLIST_FILE = "IOSPatterns/IOSPatterns-Info.plist"; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | WRAPPER_EXTENSION = app; 473 | }; 474 | name = Debug; 475 | }; 476 | BE687D071666ECC500F84235 /* Release */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 480 | GCC_PREFIX_HEADER = "IOSPatterns/IOSPatterns-Prefix.pch"; 481 | INFOPLIST_FILE = "IOSPatterns/IOSPatterns-Info.plist"; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | WRAPPER_EXTENSION = app; 484 | }; 485 | name = Release; 486 | }; 487 | BE687D091666ECC500F84235 /* Debug */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IOSPatterns.app/IOSPatterns"; 491 | FRAMEWORK_SEARCH_PATHS = ( 492 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 493 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 494 | ); 495 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 496 | GCC_PREFIX_HEADER = "IOSPatterns/IOSPatterns-Prefix.pch"; 497 | INFOPLIST_FILE = "IOSPatternsTests/IOSPatternsTests-Info.plist"; 498 | PRODUCT_NAME = "$(TARGET_NAME)"; 499 | TEST_HOST = "$(BUNDLE_LOADER)"; 500 | WRAPPER_EXTENSION = octest; 501 | }; 502 | name = Debug; 503 | }; 504 | BE687D0A1666ECC500F84235 /* Release */ = { 505 | isa = XCBuildConfiguration; 506 | buildSettings = { 507 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IOSPatterns.app/IOSPatterns"; 508 | FRAMEWORK_SEARCH_PATHS = ( 509 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 510 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 511 | ); 512 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 513 | GCC_PREFIX_HEADER = "IOSPatterns/IOSPatterns-Prefix.pch"; 514 | INFOPLIST_FILE = "IOSPatternsTests/IOSPatternsTests-Info.plist"; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | TEST_HOST = "$(BUNDLE_LOADER)"; 517 | WRAPPER_EXTENSION = octest; 518 | }; 519 | name = Release; 520 | }; 521 | /* End XCBuildConfiguration section */ 522 | 523 | /* Begin XCConfigurationList section */ 524 | BE687CCC1666ECC500F84235 /* Build configuration list for PBXProject "IOSPatterns" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | BE687D031666ECC500F84235 /* Debug */, 528 | BE687D041666ECC500F84235 /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | BE687D051666ECC500F84235 /* Build configuration list for PBXNativeTarget "IOSPatterns" */ = { 534 | isa = XCConfigurationList; 535 | buildConfigurations = ( 536 | BE687D061666ECC500F84235 /* Debug */, 537 | BE687D071666ECC500F84235 /* Release */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | BE687D081666ECC500F84235 /* Build configuration list for PBXNativeTarget "IOSPatternsTests" */ = { 543 | isa = XCConfigurationList; 544 | buildConfigurations = ( 545 | BE687D091666ECC500F84235 /* Debug */, 546 | BE687D0A1666ECC500F84235 /* Release */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | defaultConfigurationName = Release; 550 | }; 551 | /* End XCConfigurationList section */ 552 | }; 553 | rootObject = BE687CC91666ECC500F84235 /* Project object */; 554 | } 555 | -------------------------------------------------------------------------------- /Storyboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | --------------------------------------------------------------------------------