├── Adding Shadows to Shapes ├── Adding Shadows to Shapes.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Animating and Moving a Layer ├── Animating and Moving a Layer.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── Xcode.png │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Animating and Rotating Views ├── Animating and Rotating Views.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── Xcode.png │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Animating and Scaling Views ├── Animating and Scaling Views.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── Xcode.png │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Constructing Paths ├── Constructing Paths.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Constructing, Setting and Using Colors ├── Constructing, Setting and Using Colors.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Creating and Drawing Gradients ├── Creating and Drawing Gradients.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── Xcode.png │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Creating the Project Structure in Xcode ├── .DS_Store ├── Creating the Project Structure in Xcode.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Displacing Shapes on Graphic Contexts ├── Displacing Shapes Drawn on Graphic Contexts.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Drawing Images ├── Drawing Images.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── Xcode.png │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Drawing Lines ├── Drawing Lines.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Drawing Rectangles ├── Drawing Rectangles.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Drawing Text ├── Drawing Text.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Enumerating and Loading Fonts ├── Enumerating and Loading Fonts.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── BrainyBinary.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── BrainyBinary.xcuserdatad │ │ └── xcschemes │ │ │ ├── Graphics.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── vandad.xcuserdatad │ │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist └── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib │ └── main.m ├── Main Project ├── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ │ ├── GraphicsViewController.xib │ │ ├── InfoPlist.strings │ │ └── MainWindow.xib │ └── main.m └── Main Project.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── BrainyBinary.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ ├── BrainyBinary.xcuserdatad │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist │ └── vandad.xcuserdatad │ └── xcschemes │ ├── Graphics.xcscheme │ └── xcschememanagement.plist ├── README ├── Rotating Shapes Drawn on Graphic Contexts ├── Graphics │ ├── Graphics-Info.plist │ ├── Graphics-Prefix.pch │ ├── GraphicsAppDelegate.h │ ├── GraphicsAppDelegate.m │ ├── GraphicsViewController.h │ ├── GraphicsViewController.m │ ├── GraphicsViewControllerView.h │ ├── GraphicsViewControllerView.m │ ├── en.lproj │ │ ├── GraphicsViewController.xib │ │ ├── InfoPlist.strings │ │ └── MainWindow.xib │ └── main.m └── Rotating Shapes Drawn on Graphic Contexts.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── BrainyBinary.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ ├── BrainyBinary.xcuserdatad │ └── xcschemes │ │ ├── Graphics.xcscheme │ │ └── xcschememanagement.plist │ └── vandad.xcuserdatad │ └── xcschemes │ ├── Graphics.xcscheme │ └── xcschememanagement.plist └── Scaling Shapes Drawn on Graphic Contexts ├── Graphics ├── Graphics-Info.plist ├── Graphics-Prefix.pch ├── GraphicsAppDelegate.h ├── GraphicsAppDelegate.m ├── GraphicsViewController.h ├── GraphicsViewController.m ├── GraphicsViewControllerView.h ├── GraphicsViewControllerView.m ├── en.lproj │ ├── GraphicsViewController.xib │ ├── InfoPlist.strings │ └── MainWindow.xib └── main.m └── Scaling Shapes Drawn on Graphic Contexts.xcodeproj ├── project.pbxproj ├── project.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── BrainyBinary.xcuserdatad │ └── UserInterfaceState.xcuserstate └── xcuserdata ├── BrainyBinary.xcuserdatad └── xcschemes │ ├── Graphics.xcscheme │ └── xcschememanagement.plist └── vandad.xcuserdatad └── xcschemes ├── Graphics.xcscheme └── xcschememanagement.plist /Adding Shadows to Shapes/Adding Shadows to Shapes.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Adding Shadows to Shapes.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Adding Shadows to Shapes.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 25 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | self.view.backgroundColor = [UIColor whiteColor]; 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Adding Shadows to Shapes/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Animating and Moving a Layer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Animating and Moving a Layer.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Animating and Moving a Layer.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | @protected 13 | UIImageView *xcodeImageView1; 14 | UIImageView *xcodeImageView2; 15 | } 16 | 17 | @property (nonatomic, retain) UIImageView *xcodeImageView1; 18 | @property (nonatomic, retain) UIImageView *xcodeImageView2; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | #import 11 | 12 | @implementation GraphicsViewControllerView 13 | 14 | - (void) awakeFromNib{ 15 | [super awakeFromNib]; 16 | } 17 | 18 | - (id)initWithFrame:(CGRect)frame{ 19 | self = [super initWithFrame:frame]; 20 | if (self != nil) { 21 | } 22 | return self; 23 | } 24 | 25 | //- (void)drawRect:(CGRect)rect{ 26 | // // Drawing code 27 | // 28 | //} 29 | 30 | - (void)dealloc{ 31 | [super dealloc]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/Xcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vandadnp/Graphics-and-Animation-on-iOS/f911e858dbd8536167b0c914a2588fec55bfd3f9/Animating and Moving a Layer/Graphics/Xcode.png -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Animating and Moving a Layer/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Animating and Rotating Views.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Animating and Rotating Views.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Animating and Rotating Views.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 40 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | @protected 13 | UIImageView *xcodeImageView; 14 | } 15 | 16 | @property (nonatomic, retain) UIImageView *xcodeImageView; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | @synthesize xcodeImageView; 14 | 15 | - (id) initWithNibName:(NSString *)nibNameOrNil 16 | bundle:(NSBundle *)nibBundleOrNil{ 17 | 18 | self = [super initWithNibName:nibNameOrNil 19 | bundle:nibBundleOrNil]; 20 | 21 | if (self != nil){ 22 | 23 | 24 | 25 | } 26 | return self; 27 | } 28 | 29 | - (void)clockwiseRotationStopped:(NSString *)paramAnimationID 30 | finished:(NSNumber *)paramFinished 31 | context:(void *)paramContext{ 32 | 33 | [UIView beginAnimations:@"counterclockwiseAnimation" 34 | context:NULL]; 35 | 36 | /* 5 seconds long */ 37 | [UIView setAnimationDuration:5.0f]; 38 | 39 | /* Back to original rotation */ 40 | self.xcodeImageView.transform = 41 | CGAffineTransformIdentity; 42 | 43 | [UIView commitAnimations]; 44 | 45 | } 46 | 47 | - (void) viewDidAppear:(BOOL)paramAnimated{ 48 | [super viewDidAppear:paramAnimated]; 49 | 50 | self.xcodeImageView.center = self.view.center; 51 | 52 | /* Begin the animation */ 53 | [UIView beginAnimations:@"clockwiseAnimation" 54 | context:NULL]; 55 | 56 | /* Make the animation 5 seconds long */ 57 | [UIView setAnimationDuration:5.0f]; 58 | 59 | [UIView setAnimationDelegate:self]; 60 | 61 | [UIView setAnimationDidStopSelector: 62 | @selector(clockwiseRotationStopped:finished:context:)]; 63 | 64 | /* Rotate the image view 90 degrees */ 65 | self.xcodeImageView.transform = 66 | CGAffineTransformMakeRotation((90.0f * M_PI) / 180.0f); 67 | 68 | /* Commit the animation */ 69 | [UIView commitAnimations]; 70 | 71 | } 72 | 73 | 74 | - (void) viewDidLoad{ 75 | [super viewDidLoad]; 76 | 77 | UIImage *xcodeImage = [UIImage imageNamed:@"Xcode.png"]; 78 | 79 | xcodeImageView = [[UIImageView alloc] 80 | initWithImage:xcodeImage]; 81 | 82 | /* Just set the size to make the images smaller */ 83 | [xcodeImageView setFrame:CGRectMake(0.0f, 84 | 0.0f, 85 | 200.0f, 86 | 200.0f)]; 87 | 88 | self.view.backgroundColor = [UIColor whiteColor]; 89 | [self.view addSubview:self.xcodeImageView]; 90 | 91 | } 92 | 93 | - (void)dealloc{ 94 | [xcodeImageView release]; 95 | [super dealloc]; 96 | } 97 | 98 | - (void)viewDidUnload{ 99 | [super viewDidUnload]; 100 | self.xcodeImageView = nil; 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | #import 11 | 12 | @implementation GraphicsViewControllerView 13 | 14 | - (void) awakeFromNib{ 15 | [super awakeFromNib]; 16 | } 17 | 18 | - (id)initWithFrame:(CGRect)frame{ 19 | self = [super initWithFrame:frame]; 20 | if (self != nil) { 21 | } 22 | return self; 23 | } 24 | 25 | //- (void)drawRect:(CGRect)rect{ 26 | // // Drawing code 27 | // 28 | //} 29 | 30 | - (void)dealloc{ 31 | [super dealloc]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/Xcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vandadnp/Graphics-and-Animation-on-iOS/f911e858dbd8536167b0c914a2588fec55bfd3f9/Animating and Rotating Views/Graphics/Xcode.png -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Animating and Rotating Views/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Animating and Scaling Views.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Animating and Scaling Views.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Animating and Scaling Views.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 7 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | @protected 13 | UIImageView *xcodeImageView; 14 | } 15 | 16 | @property (nonatomic, retain) UIImageView *xcodeImageView; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | #import 11 | 12 | @implementation GraphicsViewControllerView 13 | 14 | - (void) awakeFromNib{ 15 | [super awakeFromNib]; 16 | } 17 | 18 | - (id)initWithFrame:(CGRect)frame{ 19 | self = [super initWithFrame:frame]; 20 | if (self != nil) { 21 | } 22 | return self; 23 | } 24 | 25 | //- (void)drawRect:(CGRect)rect{ 26 | // // Drawing code 27 | // 28 | //} 29 | 30 | - (void)dealloc{ 31 | [super dealloc]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/Xcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vandadnp/Graphics-and-Animation-on-iOS/f911e858dbd8536167b0c914a2588fec55bfd3f9/Animating and Scaling Views/Graphics/Xcode.png -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Animating and Scaling Views/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Constructing Paths/Constructing Paths.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Constructing Paths/Constructing Paths.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Constructing Paths/Constructing Paths.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Constructing Paths/Constructing Paths.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIStatusBarHidden 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | self.view.backgroundColor = [UIColor whiteColor]; 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | 11 | @implementation GraphicsViewControllerView 12 | 13 | - (id)initWithFrame:(CGRect)frame{ 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | // Initialization code 17 | } 18 | return self; 19 | } 20 | 21 | 22 | - (void)drawRect:(CGRect)rect{ 23 | // Drawing code 24 | 25 | /* Create the path */ 26 | CGMutablePathRef path = CGPathCreateMutable(); 27 | 28 | /* How big is our screen? We want the X to cover 29 | the whole screen */ 30 | CGRect screenBounds = [[UIScreen mainScreen] bounds]; 31 | 32 | /* Start from top left */ 33 | CGPathMoveToPoint(path, 34 | NULL, 35 | screenBounds.origin.x, 36 | screenBounds.origin.y); 37 | 38 | /* Draw a line from top left to 39 | bottom right of the screen */ 40 | CGPathAddLineToPoint(path, 41 | NULL, 42 | screenBounds.size.width, 43 | screenBounds.size.height); 44 | 45 | /* Start another line from top right */ 46 | CGPathMoveToPoint(path, 47 | NULL, 48 | screenBounds.size.width, 49 | screenBounds.origin.y); 50 | 51 | /* Draw a line from top right to bottom left */ 52 | CGPathAddLineToPoint(path, 53 | NULL, 54 | screenBounds.origin.x, 55 | screenBounds.size.height); 56 | 57 | /* Get the context that the path has to be 58 | drawn on */ 59 | CGContextRef currentContext = 60 | UIGraphicsGetCurrentContext(); 61 | 62 | /* Add the path to the context so we can 63 | draw it later */ 64 | CGContextAddPath(currentContext, 65 | path); 66 | 67 | /* Set the blue color as the stroke color */ 68 | [[UIColor blueColor] setStroke]; 69 | 70 | /* Draw the path with stroke color */ 71 | CGContextDrawPath(currentContext, 72 | kCGPathStroke); 73 | 74 | /* Finally release the path object */ 75 | CGPathRelease(path); 76 | 77 | } 78 | 79 | 80 | 81 | - (void)dealloc{ 82 | [super dealloc]; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Constructing Paths/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Constructing, Setting and Using Colors.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Constructing, Setting and Using Colors.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Constructing, Setting and Using Colors.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 17 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | 24 | 25 | // Release any cached data, images, etc that aren't in use. 26 | } 27 | 28 | #pragma mark - View lifecycle 29 | 30 | - (void)viewDidLoad{ 31 | [super viewDidLoad]; 32 | self.view.backgroundColor = [UIColor whiteColor]; 33 | } 34 | 35 | 36 | - (void)viewDidUnload 37 | { 38 | [super viewDidUnload]; 39 | // Release any retained subviews of the main view. 40 | // e.g. self.myOutlet = nil; 41 | } 42 | 43 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 44 | { 45 | // Return YES for supported orientations 46 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Constructing, Setting and Using Colors/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Creating and Drawing Gradients.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Creating and Drawing Gradients.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Creating and Drawing Gradients.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 33 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIStatusBarHidden 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | self.view.backgroundColor = [UIColor whiteColor]; 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/Xcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vandadnp/Graphics-and-Animation-on-iOS/f911e858dbd8536167b0c914a2588fec55bfd3f9/Creating and Drawing Gradients/Graphics/Xcode.png -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Creating and Drawing Gradients/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vandadnp/Graphics-and-Animation-on-iOS/f911e858dbd8536167b0c914a2588fec55bfd3f9/Creating the Project Structure in Xcode/.DS_Store -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Creating the Project Structure in Xcode.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Creating the Project Structure in Xcode.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Creating the Project Structure in Xcode.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 29 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 21 | { 22 | // Override point for customization after application launch. 23 | 24 | self.window.rootViewController = self.viewController; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | /* 32 | 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. 33 | 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. 34 | */ 35 | } 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application 38 | { 39 | /* 40 | 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. 41 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | */ 43 | } 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application 46 | { 47 | /* 48 | 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. 49 | */ 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application 53 | { 54 | /* 55 | 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. 56 | */ 57 | } 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application 60 | { 61 | /* 62 | Called when the application is about to terminate. 63 | Save data if appropriate. 64 | See also applicationDidEnterBackground:. 65 | */ 66 | } 67 | 68 | - (void)dealloc 69 | { 70 | [_window release]; 71 | [_viewController release]; 72 | [super dealloc]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | } 32 | 33 | 34 | - (void)viewDidUnload 35 | { 36 | [super viewDidUnload]; 37 | // Release any retained subviews of the main view. 38 | // e.g. self.myOutlet = nil; 39 | } 40 | 41 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 42 | { 43 | // Return YES for supported orientations 44 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | 11 | 12 | @implementation GraphicsViewControllerView 13 | 14 | - (id)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | // Initialization code 19 | } 20 | return self; 21 | } 22 | 23 | /* 24 | // Only override drawRect: if you perform custom drawing. 25 | // An empty implementation adversely affects performance during animation. 26 | - (void)drawRect:(CGRect)rect 27 | { 28 | // Drawing code 29 | } 30 | */ 31 | 32 | - (void)dealloc 33 | { 34 | [super dealloc]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Creating the Project Structure in Xcode/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Displacing Shapes Drawn on Graphic Contexts.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Displacing Shapes Drawn on Graphic Contexts.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Displacing Shapes Drawn on Graphic Contexts.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | 32 | self.view.backgroundColor = [UIColor whiteColor]; 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Displacing Shapes on Graphic Contexts/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Drawing Images/Drawing Images.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Drawing Images/Drawing Images.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Drawing Images/Drawing Images.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Images/Drawing Images.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Drawing Images/Drawing Images.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 13 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | self.view.backgroundColor = [UIColor whiteColor]; 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | 11 | @implementation GraphicsViewControllerView 12 | 13 | - (id)initWithFrame:(CGRect)frame{ 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | // Initialization code 17 | } 18 | return self; 19 | } 20 | 21 | - (void)drawRect:(CGRect)rect{ 22 | // Drawing code 23 | 24 | /* Assuming the image is in your app bundle 25 | and we can load it */ 26 | UIImage *xcodeIcon = 27 | [UIImage imageNamed:@"Xcode.png"]; 28 | 29 | [xcodeIcon drawAtPoint:CGPointMake(0.0f, 30 | 20.0f)]; 31 | 32 | [xcodeIcon drawInRect:CGRectMake(50.0f, 33 | 10.0f, 34 | 40.0f, 35 | 35.0f)]; 36 | 37 | } 38 | 39 | - (void)dealloc{ 40 | [super dealloc]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/Xcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vandadnp/Graphics-and-Animation-on-iOS/f911e858dbd8536167b0c914a2588fec55bfd3f9/Drawing Images/Graphics/Xcode.png -------------------------------------------------------------------------------- /Drawing Images/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Drawing Images/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Drawing Lines/Drawing Lines.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Drawing Lines/Drawing Lines.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Drawing Lines/Drawing Lines.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Lines/Drawing Lines.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Drawing Lines/Drawing Lines.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 12 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | self.view.backgroundColor = [UIColor whiteColor]; 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Drawing Lines/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Drawing Rectangles/Drawing Rectangles.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Drawing Rectangles/Drawing Rectangles.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Rectangles/Drawing Rectangles.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Drawing Rectangles/Drawing Rectangles.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 37 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | self.view.backgroundColor = [UIColor whiteColor]; 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Drawing Rectangles/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Drawing Text/Drawing Text.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Drawing Text/Drawing Text.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Drawing Text/Drawing Text.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Text/Drawing Text.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Drawing Text/Drawing Text.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 35 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | 11 | @implementation GraphicsViewControllerView 12 | 13 | - (id)initWithFrame:(CGRect)frame{ 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | // Initialization code 17 | } 18 | return self; 19 | } 20 | 21 | - (void)drawRect:(CGRect)rect{ 22 | // Drawing code 23 | 24 | UIFont *helveticaBold = 25 | [UIFont fontWithName:@"HelveticaNeue-Bold" 26 | size:40.0f]; 27 | 28 | NSString *myString = @"Some String"; 29 | 30 | [myString drawAtPoint:CGPointMake(40, 180) 31 | withFont:helveticaBold]; 32 | 33 | } 34 | 35 | - (void)dealloc{ 36 | [super dealloc]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Drawing Text/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Enumerating and Loading Fonts.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Enumerating and Loading Fonts.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Enumerating and Loading Fonts.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 34 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (void) enumerateFonts{ 22 | 23 | for (NSString *familyName in [UIFont familyNames]){ 24 | NSLog(@"Font Family = %@", familyName); 25 | 26 | for (NSString *fontName in 27 | [UIFont fontNamesForFamilyName:familyName]){ 28 | 29 | NSLog(@"\t%@", fontName); 30 | 31 | } 32 | 33 | } 34 | 35 | } 36 | 37 | 38 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 39 | { 40 | // Override point for customization after application launch. 41 | 42 | [self enumerateFonts]; 43 | 44 | 45 | self.window.rootViewController = self.viewController; 46 | [self.window makeKeyAndVisible]; 47 | return YES; 48 | } 49 | 50 | - (void)applicationWillResignActive:(UIApplication *)application 51 | { 52 | /* 53 | 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. 54 | 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. 55 | */ 56 | } 57 | 58 | - (void)applicationDidEnterBackground:(UIApplication *)application 59 | { 60 | /* 61 | 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. 62 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 63 | */ 64 | } 65 | 66 | - (void)applicationWillEnterForeground:(UIApplication *)application 67 | { 68 | /* 69 | 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. 70 | */ 71 | } 72 | 73 | - (void)applicationDidBecomeActive:(UIApplication *)application 74 | { 75 | /* 76 | 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. 77 | */ 78 | } 79 | 80 | - (void)applicationWillTerminate:(UIApplication *)application 81 | { 82 | /* 83 | Called when the application is about to terminate. 84 | Save data if appropriate. 85 | See also applicationDidEnterBackground:. 86 | */ 87 | } 88 | 89 | - (void)dealloc 90 | { 91 | [_window release]; 92 | [_viewController release]; 93 | [super dealloc]; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | 32 | 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | 11 | 12 | @implementation GraphicsViewControllerView 13 | 14 | - (id)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | // Initialization code 19 | } 20 | return self; 21 | } 22 | 23 | /* 24 | // Only override drawRect: if you perform custom drawing. 25 | // An empty implementation adversely affects performance during animation. 26 | - (void)drawRect:(CGRect)rect 27 | { 28 | // Drawing code 29 | } 30 | */ 31 | 32 | - (void)dealloc 33 | { 34 | [super dealloc]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Enumerating and Loading Fonts/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Main Project/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Main Project/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Main Project/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Main Project/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 21 | { 22 | // Override point for customization after application launch. 23 | 24 | self.window.rootViewController = self.viewController; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | /* 32 | 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. 33 | 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. 34 | */ 35 | } 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application 38 | { 39 | /* 40 | 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. 41 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | */ 43 | } 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application 46 | { 47 | /* 48 | 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. 49 | */ 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application 53 | { 54 | /* 55 | 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. 56 | */ 57 | } 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application 60 | { 61 | /* 62 | Called when the application is about to terminate. 63 | Save data if appropriate. 64 | See also applicationDidEnterBackground:. 65 | */ 66 | } 67 | 68 | - (void)dealloc 69 | { 70 | [_window release]; 71 | [_viewController release]; 72 | [super dealloc]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Main Project/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Main Project/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | /* 29 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 30 | - (void)viewDidLoad 31 | { 32 | [super viewDidLoad]; 33 | } 34 | */ 35 | 36 | - (void)viewDidUnload 37 | { 38 | [super viewDidUnload]; 39 | // Release any retained subviews of the main view. 40 | // e.g. self.myOutlet = nil; 41 | } 42 | 43 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 44 | { 45 | // Return YES for supported orientations 46 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Main Project/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Main Project/Graphics/GraphicsViewControllerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.m 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewControllerView.h" 10 | 11 | 12 | @implementation GraphicsViewControllerView 13 | 14 | - (id)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | // Initialization code 19 | } 20 | return self; 21 | } 22 | 23 | /* 24 | // Only override drawRect: if you perform custom drawing. 25 | // An empty implementation adversely affects performance during animation. 26 | - (void)drawRect:(CGRect)rect 27 | { 28 | // Drawing code 29 | } 30 | */ 31 | 32 | - (void)dealloc 33 | { 34 | [super dealloc]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Main Project/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Main Project/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Main Project/Main Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Main Project/Main Project.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Main Project/Main Project.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Main Project/Main Project.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/Graphics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Main Project/Main Project.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 36 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This repository contains all example codes from the O'Reilly book "Graphics and Animation on iOS" by Vandad Nahavandipoor 2 | 3 | You can find the book on O'Reilly: 4 | http://oreilly.com/catalog/0636920020356/ 5 | 6 | Or on Amazon: 7 | http://www.amazon.com/Graphics-Animation-iOS-Beginners-Guide/dp/1449305679/ref=sr_1_5?s=books&ie=UTF8&qid=1308384915&sr=1-5 8 | 9 | Or other major book sellers -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | 32 | self.view.backgroundColor = [UIColor whiteColor]; 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Rotating Shapes Drawn on Graphic Contexts.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Rotating Shapes Drawn on Graphic Contexts.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Rotating Shapes Drawn on Graphic Contexts/Rotating Shapes Drawn on Graphic Contexts.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 38 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/Graphics-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.pixolity.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/Graphics-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Graphics' target in the 'Graphics' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/GraphicsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GraphicsViewController; 12 | 13 | @interface GraphicsAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet GraphicsViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/GraphicsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsAppDelegate.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsAppDelegate.h" 10 | 11 | #import "GraphicsViewController.h" 12 | 13 | @implementation GraphicsAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | // Override point for customization after application launch. 24 | 25 | self.window.rootViewController = self.viewController; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | 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. 34 | 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. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | 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. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | 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. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | 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. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_viewController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/GraphicsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.h 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GraphicsViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/GraphicsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewController.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "GraphicsViewController.h" 10 | 11 | @implementation GraphicsViewController 12 | 13 | - (void)dealloc 14 | { 15 | [super dealloc]; 16 | } 17 | 18 | - (void)didReceiveMemoryWarning 19 | { 20 | // Releases the view if it doesn't have a superview. 21 | [super didReceiveMemoryWarning]; 22 | 23 | // Release any cached data, images, etc that aren't in use. 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | 32 | self.view.backgroundColor = [UIColor whiteColor]; 33 | 34 | } 35 | 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/GraphicsViewControllerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsViewControllerView.h 3 | // Main Project 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GraphicsViewControllerView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Graphics/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Graphics 4 | // 5 | // Created by Vandad Nahavandipoor on 11-03-30. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Scaling Shapes Drawn on Graphic Contexts.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Scaling Shapes Drawn on Graphic Contexts.xcodeproj/xcuserdata/BrainyBinary.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Scaling Shapes Drawn on Graphic Contexts/Scaling Shapes Drawn on Graphic Contexts.xcodeproj/xcuserdata/vandad.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Graphics.xcscheme 8 | 9 | orderHint 10 | 28 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82D31F64134369460052F98C 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | --------------------------------------------------------------------------------