├── README ├── figher-jet.png ├── figher-jet@2x.png ├── .gitignore ├── Gyroscope_Prefix.pch ├── main.m ├── Classes ├── GyroscopeViewController.h ├── GyroscopeAppDelegate.h ├── GyroscopeViewController.m └── GyroscopeAppDelegate.m ├── Gyroscope-Info.plist ├── Gyroscope.xcodeproj └── project.pbxproj ├── MainWindow.xib └── GyroscopeViewController.xib /README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /figher-jet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samplecode/Gyroscope/master/figher-jet.png -------------------------------------------------------------------------------- /figher-jet@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samplecode/Gyroscope/master/figher-jet@2x.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _Store 2 | *.swp 3 | *~.nib 4 | build/ 5 | *.pbxuser 6 | *.perspective 7 | *.perspectivev3 8 | xcuserdata 9 | -------------------------------------------------------------------------------- /Gyroscope_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Gyroscope' target in the 'Gyroscope' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main(int argc, char *argv[]) { 4 | 5 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 6 | int retVal = UIApplicationMain(argc, argv, nil, nil); 7 | [pool release]; 8 | return retVal; 9 | } 10 | -------------------------------------------------------------------------------- /Classes/GyroscopeViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface GyroscopeViewController : UIViewController { 5 | 6 | CMMotionManager *motionManager; 7 | NSTimer *timer; 8 | float rotation; 9 | 10 | } 11 | 12 | @property(nonatomic, retain) IBOutlet UIImageView *image; 13 | 14 | -(IBAction)toggleUpdates:(id)sender; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Classes/GyroscopeAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GyroscopeViewController; 4 | 5 | @interface GyroscopeAppDelegate : NSObject { 6 | UIWindow *window; 7 | GyroscopeViewController *viewController; 8 | } 9 | 10 | @property (nonatomic, retain) IBOutlet UIWindow *window; 11 | @property (nonatomic, retain) IBOutlet GyroscopeViewController *viewController; 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Gyroscope-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /Classes/GyroscopeViewController.m: -------------------------------------------------------------------------------- 1 | #import "GyroscopeViewController.h" 2 | 3 | @implementation GyroscopeViewController 4 | 5 | @synthesize image; 6 | 7 | -(IBAction)toggleUpdates:(id)sender { 8 | if ([sender isOn]) { 9 | [motionManager startGyroUpdates]; 10 | timer = [NSTimer scheduledTimerWithTimeInterval:1/30.0 11 | target:self 12 | selector:@selector(doGyroUpdate) 13 | userInfo:nil 14 | repeats:YES]; 15 | } else { 16 | [motionManager stopGyroUpdates]; 17 | [timer invalidate]; 18 | } 19 | } 20 | 21 | -(void)doGyroUpdate { 22 | float rate = motionManager.gyroData.rotationRate.z; 23 | if (fabs(rate) > .2) { 24 | float direction = rate > 0 ? 1 : -1; 25 | rotation += direction * M_PI/90.0; 26 | self.image.transform = CGAffineTransformMakeRotation(rotation); 27 | } 28 | } 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | motionManager = [[CMMotionManager alloc] init]; 33 | } 34 | 35 | 36 | /* 37 | // The designated initializer. Override to perform setup that is required before the view is loaded. 38 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 39 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 40 | // Custom initialization 41 | } 42 | return self; 43 | } 44 | */ 45 | 46 | /* 47 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 48 | - (void)loadView { 49 | } 50 | */ 51 | 52 | 53 | /* 54 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 55 | - (void)viewDidLoad { 56 | [super viewDidLoad]; 57 | } 58 | */ 59 | 60 | 61 | /* 62 | // Override to allow orientations other than the default portrait orientation. 63 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 64 | // Return YES for supported orientations 65 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 66 | } 67 | */ 68 | 69 | - (void)didReceiveMemoryWarning { 70 | // Releases the view if it doesn't have a superview. 71 | [super didReceiveMemoryWarning]; 72 | 73 | // Release any cached data, images, etc that aren't in use. 74 | } 75 | 76 | - (void)viewDidUnload { 77 | // Release any retained subviews of the main view. 78 | // e.g. self.myOutlet = nil; 79 | } 80 | 81 | 82 | - (void)dealloc { 83 | [motionManager release]; 84 | self.image = nil; 85 | [super dealloc]; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /Classes/GyroscopeAppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "GyroscopeAppDelegate.h" 2 | #import "GyroscopeViewController.h" 3 | 4 | @implementation GyroscopeAppDelegate 5 | 6 | @synthesize window; 7 | @synthesize viewController; 8 | 9 | 10 | #pragma mark - 11 | #pragma mark Application lifecycle 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | 15 | // Override point for customization after application launch. 16 | 17 | // Add the view controller's view to the window and display. 18 | [window addSubview:viewController.view]; 19 | [window makeKeyAndVisible]; 20 | 21 | return YES; 22 | } 23 | 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application { 26 | /* 27 | 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. 28 | 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. 29 | */ 30 | } 31 | 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application { 34 | /* 35 | 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. 36 | If your application supports background execution, called instead of applicationWillTerminate: when the user quits. 37 | */ 38 | } 39 | 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application { 42 | /* 43 | Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. 44 | */ 45 | } 46 | 47 | 48 | - (void)applicationDidBecomeActive:(UIApplication *)application { 49 | /* 50 | 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. 51 | */ 52 | } 53 | 54 | 55 | - (void)applicationWillTerminate:(UIApplication *)application { 56 | /* 57 | Called when the application is about to terminate. 58 | See also applicationDidEnterBackground:. 59 | */ 60 | } 61 | 62 | 63 | #pragma mark - 64 | #pragma mark Memory management 65 | 66 | - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 67 | /* 68 | Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. 69 | */ 70 | } 71 | 72 | 73 | - (void)dealloc { 74 | [viewController release]; 75 | [window release]; 76 | [super dealloc]; 77 | } 78 | 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Gyroscope.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* GyroscopeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* GyroscopeAppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 13 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 14 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; 15 | 2899E5220DE3E06400AC0155 /* GyroscopeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* GyroscopeViewController.xib */; }; 16 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 17 | 28D7ACF80DDB3853001CB0EB /* GyroscopeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* GyroscopeViewController.m */; }; 18 | 37446686127A584200F2A920 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37446685127A584200F2A920 /* CoreMotion.framework */; }; 19 | 374466C1127A5D0800F2A920 /* figher-jet.png in Resources */ = {isa = PBXBuildFile; fileRef = 374466BF127A5D0800F2A920 /* figher-jet.png */; }; 20 | 374466C2127A5D0800F2A920 /* figher-jet@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 374466C0127A5D0800F2A920 /* figher-jet@2x.png */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 25 | 1D3623240D0F684500981E51 /* GyroscopeAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GyroscopeAppDelegate.h; sourceTree = ""; }; 26 | 1D3623250D0F684500981E51 /* GyroscopeAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GyroscopeAppDelegate.m; sourceTree = ""; }; 27 | 1D6058910D05DD3D006BFB54 /* Gyroscope.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Gyroscope.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 30 | 2899E5210DE3E06400AC0155 /* GyroscopeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GyroscopeViewController.xib; sourceTree = ""; }; 31 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 32 | 28D7ACF60DDB3853001CB0EB /* GyroscopeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GyroscopeViewController.h; sourceTree = ""; }; 33 | 28D7ACF70DDB3853001CB0EB /* GyroscopeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GyroscopeViewController.m; sourceTree = ""; }; 34 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | 32CA4F630368D1EE00C91783 /* Gyroscope_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Gyroscope_Prefix.pch; sourceTree = ""; }; 36 | 37446685127A584200F2A920 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; 37 | 374466BF127A5D0800F2A920 /* figher-jet.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "figher-jet.png"; sourceTree = ""; }; 38 | 374466C0127A5D0800F2A920 /* figher-jet@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "figher-jet@2x.png"; sourceTree = ""; }; 39 | 8D1107310486CEB800E47090 /* Gyroscope-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Gyroscope-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXFrameworksBuildPhase section */ 43 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 44 | isa = PBXFrameworksBuildPhase; 45 | buildActionMask = 2147483647; 46 | files = ( 47 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 48 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 49 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, 50 | 37446686127A584200F2A920 /* CoreMotion.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXFrameworksBuildPhase section */ 55 | 56 | /* Begin PBXGroup section */ 57 | 080E96DDFE201D6D7F000001 /* Classes */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | 1D3623240D0F684500981E51 /* GyroscopeAppDelegate.h */, 61 | 1D3623250D0F684500981E51 /* GyroscopeAppDelegate.m */, 62 | 28D7ACF60DDB3853001CB0EB /* GyroscopeViewController.h */, 63 | 28D7ACF70DDB3853001CB0EB /* GyroscopeViewController.m */, 64 | ); 65 | path = Classes; 66 | sourceTree = ""; 67 | }; 68 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 1D6058910D05DD3D006BFB54 /* Gyroscope.app */, 72 | ); 73 | name = Products; 74 | sourceTree = ""; 75 | }; 76 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 080E96DDFE201D6D7F000001 /* Classes */, 80 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 81 | 29B97317FDCFA39411CA2CEA /* Resources */, 82 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 83 | 19C28FACFE9D520D11CA2CBB /* Products */, 84 | ); 85 | name = CustomTemplate; 86 | sourceTree = ""; 87 | }; 88 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 32CA4F630368D1EE00C91783 /* Gyroscope_Prefix.pch */, 92 | 29B97316FDCFA39411CA2CEA /* main.m */, 93 | ); 94 | name = "Other Sources"; 95 | sourceTree = ""; 96 | }; 97 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 374466AC127A5CD800F2A920 /* images */, 101 | 2899E5210DE3E06400AC0155 /* GyroscopeViewController.xib */, 102 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 103 | 8D1107310486CEB800E47090 /* Gyroscope-Info.plist */, 104 | ); 105 | name = Resources; 106 | sourceTree = ""; 107 | }; 108 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 112 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 113 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */, 114 | 37446685127A584200F2A920 /* CoreMotion.framework */, 115 | ); 116 | name = Frameworks; 117 | sourceTree = ""; 118 | }; 119 | 374466AC127A5CD800F2A920 /* images */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 374466BF127A5D0800F2A920 /* figher-jet.png */, 123 | 374466C0127A5D0800F2A920 /* figher-jet@2x.png */, 124 | ); 125 | name = images; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 1D6058900D05DD3D006BFB54 /* Gyroscope */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Gyroscope" */; 134 | buildPhases = ( 135 | 1D60588D0D05DD3D006BFB54 /* Resources */, 136 | 1D60588E0D05DD3D006BFB54 /* Sources */, 137 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 138 | ); 139 | buildRules = ( 140 | ); 141 | dependencies = ( 142 | ); 143 | name = Gyroscope; 144 | productName = Gyroscope; 145 | productReference = 1D6058910D05DD3D006BFB54 /* Gyroscope.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 152 | isa = PBXProject; 153 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Gyroscope" */; 154 | compatibilityVersion = "Xcode 3.1"; 155 | developmentRegion = English; 156 | hasScannedForEncodings = 1; 157 | knownRegions = ( 158 | English, 159 | Japanese, 160 | French, 161 | German, 162 | ); 163 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 164 | projectDirPath = ""; 165 | projectRoot = ""; 166 | targets = ( 167 | 1D6058900D05DD3D006BFB54 /* Gyroscope */, 168 | ); 169 | }; 170 | /* End PBXProject section */ 171 | 172 | /* Begin PBXResourcesBuildPhase section */ 173 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 174 | isa = PBXResourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 178 | 2899E5220DE3E06400AC0155 /* GyroscopeViewController.xib in Resources */, 179 | 374466C1127A5D0800F2A920 /* figher-jet.png in Resources */, 180 | 374466C2127A5D0800F2A920 /* figher-jet@2x.png in Resources */, 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | /* End PBXResourcesBuildPhase section */ 185 | 186 | /* Begin PBXSourcesBuildPhase section */ 187 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 188 | isa = PBXSourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 192 | 1D3623260D0F684500981E51 /* GyroscopeAppDelegate.m in Sources */, 193 | 28D7ACF80DDB3853001CB0EB /* GyroscopeViewController.m in Sources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXSourcesBuildPhase section */ 198 | 199 | /* Begin XCBuildConfiguration section */ 200 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 201 | isa = XCBuildConfiguration; 202 | buildSettings = { 203 | ALWAYS_SEARCH_USER_PATHS = NO; 204 | COPY_PHASE_STRIP = NO; 205 | GCC_DYNAMIC_NO_PIC = NO; 206 | GCC_OPTIMIZATION_LEVEL = 0; 207 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 208 | GCC_PREFIX_HEADER = Gyroscope_Prefix.pch; 209 | INFOPLIST_FILE = "Gyroscope-Info.plist"; 210 | PRODUCT_NAME = Gyroscope; 211 | }; 212 | name = Debug; 213 | }; 214 | 1D6058950D05DD3E006BFB54 /* Release */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | ALWAYS_SEARCH_USER_PATHS = NO; 218 | COPY_PHASE_STRIP = YES; 219 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 220 | GCC_PREFIX_HEADER = Gyroscope_Prefix.pch; 221 | INFOPLIST_FILE = "Gyroscope-Info.plist"; 222 | PRODUCT_NAME = Gyroscope; 223 | VALIDATE_PRODUCT = YES; 224 | }; 225 | name = Release; 226 | }; 227 | C01FCF4F08A954540054247B /* Debug */ = { 228 | isa = XCBuildConfiguration; 229 | buildSettings = { 230 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 231 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 232 | GCC_C_LANGUAGE_STANDARD = c99; 233 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 234 | GCC_WARN_UNUSED_VARIABLE = YES; 235 | PREBINDING = NO; 236 | SDKROOT = iphoneos4.1; 237 | }; 238 | name = Debug; 239 | }; 240 | C01FCF5008A954540054247B /* Release */ = { 241 | isa = XCBuildConfiguration; 242 | buildSettings = { 243 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 244 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 245 | GCC_C_LANGUAGE_STANDARD = c99; 246 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 247 | GCC_WARN_UNUSED_VARIABLE = YES; 248 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 249 | PREBINDING = NO; 250 | SDKROOT = iphoneos4.1; 251 | }; 252 | name = Release; 253 | }; 254 | /* End XCBuildConfiguration section */ 255 | 256 | /* Begin XCConfigurationList section */ 257 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Gyroscope" */ = { 258 | isa = XCConfigurationList; 259 | buildConfigurations = ( 260 | 1D6058940D05DD3E006BFB54 /* Debug */, 261 | 1D6058950D05DD3E006BFB54 /* Release */, 262 | ); 263 | defaultConfigurationIsVisible = 0; 264 | defaultConfigurationName = Release; 265 | }; 266 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Gyroscope" */ = { 267 | isa = XCConfigurationList; 268 | buildConfigurations = ( 269 | C01FCF4F08A954540054247B /* Debug */, 270 | C01FCF5008A954540054247B /* Release */, 271 | ); 272 | defaultConfigurationIsVisible = 0; 273 | defaultConfigurationName = Release; 274 | }; 275 | /* End XCConfigurationList section */ 276 | }; 277 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 278 | } 279 | -------------------------------------------------------------------------------- /MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | GyroscopeViewController 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | Gyroscope App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | GyroscopeViewController 152 | {{234, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | GyroscopeAppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | UIWindow 183 | UIView 184 | 185 | IBUserSource 186 | 187 | 188 | 189 | 190 | GyroscopeAppDelegate 191 | NSObject 192 | 193 | YES 194 | 195 | YES 196 | viewController 197 | window 198 | 199 | 200 | YES 201 | GyroscopeViewController 202 | UIWindow 203 | 204 | 205 | 206 | YES 207 | 208 | YES 209 | viewController 210 | window 211 | 212 | 213 | YES 214 | 215 | viewController 216 | GyroscopeViewController 217 | 218 | 219 | window 220 | UIWindow 221 | 222 | 223 | 224 | 225 | IBProjectSource 226 | Classes/GyroscopeAppDelegate.h 227 | 228 | 229 | 230 | GyroscopeAppDelegate 231 | NSObject 232 | 233 | IBUserSource 234 | 235 | 236 | 237 | 238 | GyroscopeViewController 239 | UIViewController 240 | 241 | IBProjectSource 242 | Classes/GyroscopeViewController.h 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSError.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSFileManager.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSKeyValueCoding.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | Foundation.framework/Headers/NSKeyValueObserving.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSKeyedArchiver.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSObject.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSRunLoop.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSThread.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSURL.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSURLConnection.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | UIKit.framework/Headers/UIAccessibility.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UINibLoading.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIResponder.h 337 | 338 | 339 | 340 | UIApplication 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIApplication.h 345 | 346 | 347 | 348 | UIResponder 349 | NSObject 350 | 351 | 352 | 353 | UISearchBar 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchBar.h 358 | 359 | 360 | 361 | UISearchDisplayController 362 | NSObject 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UISearchDisplayController.h 366 | 367 | 368 | 369 | UIView 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UITextField.h 373 | 374 | 375 | 376 | UIView 377 | UIResponder 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIView.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWindow 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWindow.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | Gyroscope.xcodeproj 441 | 3 442 | 112 443 | 444 | 445 | -------------------------------------------------------------------------------- /GyroscopeViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10F569 6 | 804 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 123 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 274 48 | {{20, 20}, {280, 280}} 49 | 50 | NO 51 | IBCocoaTouchFramework 52 | 53 | NSImage 54 | figher-jet.png 55 | 56 | 57 | 58 | 59 | 292 60 | {{20, 416}, {154, 21}} 61 | 62 | NO 63 | YES 64 | 7 65 | NO 66 | IBCocoaTouchFramework 67 | Gyroscope updates: 68 | 69 | 1 70 | MCAwIDAAA 71 | 72 | 73 | 3 74 | MQA 75 | 76 | 1 77 | 10 78 | 79 | 80 | 81 | 292 82 | {{206, 413}, {94, 27}} 83 | 84 | NO 85 | IBCocoaTouchFramework 86 | 0 87 | 0 88 | 89 | 90 | {320, 460} 91 | 92 | 93 | 3 94 | MC43NQA 95 | 96 | 2 97 | 98 | 99 | NO 100 | 101 | IBCocoaTouchFramework 102 | 103 | 104 | 105 | 106 | YES 107 | 108 | 109 | view 110 | 111 | 112 | 113 | 7 114 | 115 | 116 | 117 | image 118 | 119 | 120 | 121 | 11 122 | 123 | 124 | 125 | toggleUpdates: 126 | 127 | 128 | 13 129 | 130 | 13 131 | 132 | 133 | 134 | 135 | YES 136 | 137 | 0 138 | 139 | 140 | 141 | 142 | 143 | -1 144 | 145 | 146 | File's Owner 147 | 148 | 149 | -2 150 | 151 | 152 | 153 | 154 | 6 155 | 156 | 157 | YES 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 8 166 | 167 | 168 | 169 | 170 | 9 171 | 172 | 173 | 174 | 175 | 10 176 | 177 | 178 | 179 | 180 | 181 | 182 | YES 183 | 184 | YES 185 | -1.CustomClassName 186 | -2.CustomClassName 187 | 10.IBPluginDependency 188 | 10.IBViewBoundsToFrameTransform 189 | 6.IBEditorWindowLastContentRect 190 | 6.IBPluginDependency 191 | 8.IBPluginDependency 192 | 8.IBViewBoundsToFrameTransform 193 | 9.IBPluginDependency 194 | 9.IBViewBoundsToFrameTransform 195 | 196 | 197 | YES 198 | GyroscopeViewController 199 | UIResponder 200 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 201 | 202 | P4AAAL+AAABDTgAAw9IAAA 203 | 204 | {{239, 376}, {320, 480}} 205 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 206 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 207 | 208 | P4AAAL+AAABDFgAAwiwAAA 209 | 210 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 211 | 212 | P4AAAL+AAABCZAAAw8SAAA 213 | 214 | 215 | 216 | 217 | YES 218 | 219 | 220 | YES 221 | 222 | 223 | 224 | 225 | YES 226 | 227 | 228 | YES 229 | 230 | 231 | 232 | 13 233 | 234 | 235 | 236 | YES 237 | 238 | GyroscopeViewController 239 | UIViewController 240 | 241 | toggleUpdates: 242 | id 243 | 244 | 245 | toggleUpdates: 246 | 247 | toggleUpdates: 248 | id 249 | 250 | 251 | 252 | image 253 | UIImageView 254 | 255 | 256 | image 257 | 258 | image 259 | UIImageView 260 | 261 | 262 | 263 | IBProjectSource 264 | Classes/GyroscopeViewController.h 265 | 266 | 267 | 268 | 269 | YES 270 | 271 | NSObject 272 | 273 | IBFrameworkSource 274 | Foundation.framework/Headers/NSError.h 275 | 276 | 277 | 278 | NSObject 279 | 280 | IBFrameworkSource 281 | Foundation.framework/Headers/NSFileManager.h 282 | 283 | 284 | 285 | NSObject 286 | 287 | IBFrameworkSource 288 | Foundation.framework/Headers/NSKeyValueCoding.h 289 | 290 | 291 | 292 | NSObject 293 | 294 | IBFrameworkSource 295 | Foundation.framework/Headers/NSKeyValueObserving.h 296 | 297 | 298 | 299 | NSObject 300 | 301 | IBFrameworkSource 302 | Foundation.framework/Headers/NSKeyedArchiver.h 303 | 304 | 305 | 306 | NSObject 307 | 308 | IBFrameworkSource 309 | Foundation.framework/Headers/NSObject.h 310 | 311 | 312 | 313 | NSObject 314 | 315 | IBFrameworkSource 316 | Foundation.framework/Headers/NSRunLoop.h 317 | 318 | 319 | 320 | NSObject 321 | 322 | IBFrameworkSource 323 | Foundation.framework/Headers/NSThread.h 324 | 325 | 326 | 327 | NSObject 328 | 329 | IBFrameworkSource 330 | Foundation.framework/Headers/NSURL.h 331 | 332 | 333 | 334 | NSObject 335 | 336 | IBFrameworkSource 337 | Foundation.framework/Headers/NSURLConnection.h 338 | 339 | 340 | 341 | NSObject 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIAccessibility.h 345 | 346 | 347 | 348 | NSObject 349 | 350 | IBFrameworkSource 351 | UIKit.framework/Headers/UINibLoading.h 352 | 353 | 354 | 355 | NSObject 356 | 357 | IBFrameworkSource 358 | UIKit.framework/Headers/UIResponder.h 359 | 360 | 361 | 362 | UIControl 363 | UIView 364 | 365 | IBFrameworkSource 366 | UIKit.framework/Headers/UIControl.h 367 | 368 | 369 | 370 | UIImageView 371 | UIView 372 | 373 | IBFrameworkSource 374 | UIKit.framework/Headers/UIImageView.h 375 | 376 | 377 | 378 | UILabel 379 | UIView 380 | 381 | IBFrameworkSource 382 | UIKit.framework/Headers/UILabel.h 383 | 384 | 385 | 386 | UIResponder 387 | NSObject 388 | 389 | 390 | 391 | UISearchBar 392 | UIView 393 | 394 | IBFrameworkSource 395 | UIKit.framework/Headers/UISearchBar.h 396 | 397 | 398 | 399 | UISearchDisplayController 400 | NSObject 401 | 402 | IBFrameworkSource 403 | UIKit.framework/Headers/UISearchDisplayController.h 404 | 405 | 406 | 407 | UISwitch 408 | UIControl 409 | 410 | IBFrameworkSource 411 | UIKit.framework/Headers/UISwitch.h 412 | 413 | 414 | 415 | UIView 416 | 417 | IBFrameworkSource 418 | UIKit.framework/Headers/UITextField.h 419 | 420 | 421 | 422 | UIView 423 | UIResponder 424 | 425 | IBFrameworkSource 426 | UIKit.framework/Headers/UIView.h 427 | 428 | 429 | 430 | UIViewController 431 | 432 | IBFrameworkSource 433 | UIKit.framework/Headers/UINavigationController.h 434 | 435 | 436 | 437 | UIViewController 438 | 439 | IBFrameworkSource 440 | UIKit.framework/Headers/UIPopoverController.h 441 | 442 | 443 | 444 | UIViewController 445 | 446 | IBFrameworkSource 447 | UIKit.framework/Headers/UISplitViewController.h 448 | 449 | 450 | 451 | UIViewController 452 | 453 | IBFrameworkSource 454 | UIKit.framework/Headers/UITabBarController.h 455 | 456 | 457 | 458 | UIViewController 459 | UIResponder 460 | 461 | IBFrameworkSource 462 | UIKit.framework/Headers/UIViewController.h 463 | 464 | 465 | 466 | 467 | 0 468 | IBCocoaTouchFramework 469 | 470 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 471 | 472 | 473 | 474 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 475 | 476 | 477 | YES 478 | Gyroscope.xcodeproj 479 | 3 480 | 481 | figher-jet.png 482 | {280, 280} 483 | 484 | 123 485 | 486 | 487 | --------------------------------------------------------------------------------