Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 17e868c8d9c959ef7fc0edd6056787ea6695ac97 0 parents
@thisandagain authored
Showing with 1,044 additions and 0 deletions.
  1. +10 −0 .gitignore
  2. +21 −0 DIYParallax.h
  3. +151 −0 DIYParallax.m
  4. +13 −0 LICENSE.md
  5. +43 −0 README.md
  6. +330 −0 example/parallax.xcodeproj/project.pbxproj
  7. +7 −0 example/parallax.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  8. BIN  ...ple/parallax.xcodeproj/project.xcworkspace/xcuserdata/asliwinski.xcuserdatad/UserInterfaceState.xcuserstate
  9. +85 −0 example/parallax.xcodeproj/xcuserdata/asliwinski.xcuserdatad/xcschemes/parallax.xcscheme
  10. +22 −0 example/parallax.xcodeproj/xcuserdata/asliwinski.xcuserdatad/xcschemes/xcschememanagement.plist
  11. +19 −0 example/parallax/DIYAppDelegate.h
  12. +62 −0 example/parallax/DIYAppDelegate.m
  13. +20 −0 example/parallax/DIYViewController.h
  14. +70 −0 example/parallax/DIYViewController.m
  15. +119 −0 example/parallax/en.lproj/DIYViewController.xib
  16. +2 −0  example/parallax/en.lproj/InfoPlist.strings
  17. BIN  example/parallax/images/layer_1@2x.png
  18. BIN  example/parallax/images/layer_2@2x.png
  19. BIN  example/parallax/images/layer_3@2x.png
  20. BIN  example/parallax/images/layer_4@2x.png
  21. BIN  example/parallax/images/layer_5@2x.png
  22. +18 −0 example/parallax/main.m
  23. +38 −0 example/parallax/parallax-Info.plist
  24. +14 −0 example/parallax/parallax-Prefix.pch
10 .gitignore
@@ -0,0 +1,10 @@
+.DS_Store
+*.swp
+*~.nib
+
+build/
+
+.xcodeproj/
+!*.xcodeproj/project.pbxproj
+*.mode1v3
+*.mode2v3
21 DIYParallax.h
@@ -0,0 +1,21 @@
+//
+// DIYParallax.h
+// parallax
+//
+// Created by Andrew Sliwinski on 6/1/12.
+// Copyright (c) 2012 DIY, Co. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <CoreMotion/CoreMotion.h>
+
+@interface DIYParallax : UIView <UIAccelerometerDelegate>
+
+@property (nonatomic, retain) NSMutableArray *layers;
+@property (nonatomic, retain) CMMotionManager *motionManager;
+
+- (void)addLayer:(CGFloat)depth imageNamed:(NSString *)asset frame:(CGRect)frame;
+- (void)startListeningToGyro;
+- (void)stopListeningToGyro;
+
+@end
151 DIYParallax.m
@@ -0,0 +1,151 @@
+//
+// DIYParallax.m
+// parallax
+//
+// Created by Andrew Sliwinski on 6/1/12.
+// Copyright (c) 2012 DIY, Co. All rights reserved.
+//
+
+#import "DIYParallax.h"
+
+//
+
+#define UPDATE_INTERVAL 1.0f/60
+#define DRIFT_MULTIPLIER 1.0f
+
+//
+
+@implementation DIYParallax
+
+@synthesize layers;
+@synthesize motionManager;
+
+#pragma mark - Init
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ // Init layers object
+ layers = [[NSMutableArray alloc] init];
+
+ // Init motion manager
+ motionManager = [[CMMotionManager alloc] init];
+ motionManager.gyroUpdateInterval = UPDATE_INTERVAL;
+ }
+
+ return self;
+}
+
+#pragma mark - Public methods
+
+/**
+ * Add layer to view.
+ *
+ * @param int Layer index
+ * @param NSString Asset name
+ * @param CGPoint X/Y position of layer
+ *
+ * @return void
+ */
+- (void)addLayer:(CGFloat)depth imageNamed:(NSString *)asset frame:(CGRect)frame
+{
+ // Track layer
+ [layers addObject:[NSNumber numberWithFloat:depth]];
+
+ // Render to view
+ UIImageView *item = [[UIImageView alloc] initWithFrame:frame];
+ NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
+ UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@", bundlePath, asset]];
+ item.image = image;
+ [self insertSubview:item atIndex:[layers count] - 1];
+
+ [item release];
+ [image release];
+}
+
+/**
+ * Start listening to gyro updates.
+ *
+ * @return void
+ */
+- (void)startListeningToGyro
+{
+ if([self.motionManager isGyroAvailable])
+ {
+ [motionManager startGyroUpdatesToQueue:[NSOperationQueue currentQueue] withHandler: ^(CMGyroData *gyroData, NSError *error)
+ {
+ // Gather rotation rate
+ CMRotationRate rotate = gyroData.rotationRate;
+
+ // Threshold
+ CGFloat x = rotate.x;
+ CGFloat y = rotate.y;
+ x = x < -0.2 || x > 0.2 ? x : 0;
+ y = y < -0.2 || y > 0.2 ? y : 0;
+
+ // Update
+ if (x != 0 || y != 0)
+ {
+ [self update:CGPointMake(x, y)];
+ }
+ }
+ ];
+ }
+}
+
+/**
+ * Stops listening to the gyro.
+ *
+ * @return void
+ */
+- (void)stopListeningToGyro
+{
+ if([self.motionManager isGyroAvailable])
+ {
+ [motionManager stopGyroUpdates];
+ }
+ [motionManager release]; motionManager = nil;
+}
+
+#pragma mark - Private methods
+
+/**
+ * Loops through the layers array and applies subview x/y translations.
+ *
+ * @param CGPoint X/Y translation
+ *
+ * @returns void
+ */
+- (void)update:(CGPoint)point
+{
+ for (int i = 0; i < [layers count]; i++)
+ {
+ // View
+ UIView *view = [self.subviews objectAtIndex:i];
+
+ // Calc
+ CGFloat d = [[layers objectAtIndex:i] floatValue];
+ CGFloat x = view.bounds.origin.x + (point.x * d * DRIFT_MULTIPLIER);
+ CGFloat y = view.bounds.origin.y - (point.y * d * DRIFT_MULTIPLIER);
+
+ // Translate
+ view.transform = CGAffineTransformTranslate(view.transform, x, y);
+ }
+}
+
+#pragma mark - Dealloc
+
+- (void)releaseObjects
+{
+ [motionManager release]; motionManager = nil;
+ [layers release]; layers = nil;
+}
+
+- (void)dealloc
+{
+ [self releaseObjects];
+ [super dealloc];
+}
+
+@end
13 LICENSE.md
@@ -0,0 +1,13 @@
+Copyright 2011 DIY, Co.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
43 README.md
@@ -0,0 +1,43 @@
+# Parallax
+#### Objective-C library for simple implementation of CoreMotion-controlled parallax distortion.
+
+## Installation
+- Copy DIYParallax.h and DIYParallax.m into your project
+- Add the "CoreMotion" framework to your project
+
+## Getting Started
+```objective-c
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ //
+
+ parallax = [[DIYParallax alloc] initWithFrame:self.view.frame];
+
+ [parallax addLayer:0.0 imageNamed:@"layer_1@2x.png" frame:CGRectMake(0, 0, 480, 320)];
+ [parallax addLayer:0.1 imageNamed:@"layer_2@2x.png" frame:CGRectMake(240, 0, 240, 320)];
+ [parallax addLayer:0.2 imageNamed:@"layer_3@2x.png" frame:CGRectMake(240, 160, 240, 160)];
+ [parallax addLayer:0.3 imageNamed:@"layer_4@2x.png" frame:CGRectMake(120, 160, 120, 160)];
+ [parallax addLayer:0.8 imageNamed:@"layer_5@2x.png" frame:CGRectMake(60, 160, 60, 160)];
+
+ [self.view addSubview:parallax];
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+
+ [parallax startListeningToGyro];
+}
+````
+
+## Public Methods
+```
+- (void)addLayer:(CGFloat)depth imageNamed:(NSString *)asset frame:(CGRect)frame;
+- (void)startListeningToGyro;
+- (void)stopListeningToGyro;
+```
+
+## Properties
+DIYParallax is a subclass of UIView, thus all properties and methods inherent to UIView can be applied. For more information, please check the [UIView class reference](https://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html).
330 example/parallax.xcodeproj/project.pbxproj
@@ -0,0 +1,330 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ C39B2D211579610A00BBEA55 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39B2D201579610A00BBEA55 /* UIKit.framework */; };
+ C39B2D231579610A00BBEA55 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39B2D221579610A00BBEA55 /* Foundation.framework */; };
+ C39B2D251579610A00BBEA55 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39B2D241579610A00BBEA55 /* CoreGraphics.framework */; };
+ C39B2D2B1579610A00BBEA55 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D291579610A00BBEA55 /* InfoPlist.strings */; };
+ C39B2D2D1579610A00BBEA55 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C39B2D2C1579610A00BBEA55 /* main.m */; };
+ C39B2D311579610A00BBEA55 /* DIYAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C39B2D301579610A00BBEA55 /* DIYAppDelegate.m */; };
+ C39B2D341579610A00BBEA55 /* DIYViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C39B2D331579610A00BBEA55 /* DIYViewController.m */; };
+ C39B2D371579610A00BBEA55 /* DIYViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D351579610A00BBEA55 /* DIYViewController.xib */; };
+ C39B2D431579620B00BBEA55 /* DIYParallax.m in Sources */ = {isa = PBXBuildFile; fileRef = C39B2D421579620B00BBEA55 /* DIYParallax.m */; };
+ C39B2D461579623200BBEA55 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39B2D451579623200BBEA55 /* CoreMotion.framework */; };
+ C39B2D481579629D00BBEA55 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D471579629D00BBEA55 /* README.md */; };
+ C39B2D4A157962AC00BBEA55 /* LICENSE.md in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D49157962AC00BBEA55 /* LICENSE.md */; };
+ C39B2D511579637800BBEA55 /* layer_1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D4C1579637800BBEA55 /* layer_1@2x.png */; };
+ C39B2D521579637800BBEA55 /* layer_2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D4D1579637800BBEA55 /* layer_2@2x.png */; };
+ C39B2D531579637800BBEA55 /* layer_3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D4E1579637800BBEA55 /* layer_3@2x.png */; };
+ C39B2D541579637800BBEA55 /* layer_4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D4F1579637800BBEA55 /* layer_4@2x.png */; };
+ C39B2D551579637800BBEA55 /* layer_5@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C39B2D501579637800BBEA55 /* layer_5@2x.png */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ C39B2D1C1579610A00BBEA55 /* parallax.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = parallax.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ C39B2D201579610A00BBEA55 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ C39B2D221579610A00BBEA55 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ C39B2D241579610A00BBEA55 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ C39B2D281579610A00BBEA55 /* parallax-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "parallax-Info.plist"; sourceTree = "<group>"; };
+ C39B2D2A1579610A00BBEA55 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ C39B2D2C1579610A00BBEA55 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ C39B2D2E1579610A00BBEA55 /* parallax-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "parallax-Prefix.pch"; sourceTree = "<group>"; };
+ C39B2D2F1579610A00BBEA55 /* DIYAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DIYAppDelegate.h; sourceTree = "<group>"; };
+ C39B2D301579610A00BBEA55 /* DIYAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DIYAppDelegate.m; sourceTree = "<group>"; };
+ C39B2D321579610A00BBEA55 /* DIYViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DIYViewController.h; sourceTree = "<group>"; };
+ C39B2D331579610A00BBEA55 /* DIYViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DIYViewController.m; sourceTree = "<group>"; };
+ C39B2D361579610A00BBEA55 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DIYViewController.xib; sourceTree = "<group>"; };
+ C39B2D411579620B00BBEA55 /* DIYParallax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DIYParallax.h; path = ../DIYParallax.h; sourceTree = "<group>"; };
+ C39B2D421579620B00BBEA55 /* DIYParallax.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DIYParallax.m; path = ../DIYParallax.m; sourceTree = "<group>"; };
+ C39B2D451579623200BBEA55 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
+ C39B2D471579629D00BBEA55 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = "<group>"; };
+ C39B2D49157962AC00BBEA55 /* LICENSE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE.md; path = ../LICENSE.md; sourceTree = "<group>"; };
+ C39B2D4C1579637800BBEA55 /* layer_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "layer_1@2x.png"; path = "images/layer_1@2x.png"; sourceTree = "<group>"; };
+ C39B2D4D1579637800BBEA55 /* layer_2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "layer_2@2x.png"; path = "images/layer_2@2x.png"; sourceTree = "<group>"; };
+ C39B2D4E1579637800BBEA55 /* layer_3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "layer_3@2x.png"; path = "images/layer_3@2x.png"; sourceTree = "<group>"; };
+ C39B2D4F1579637800BBEA55 /* layer_4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "layer_4@2x.png"; path = "images/layer_4@2x.png"; sourceTree = "<group>"; };
+ C39B2D501579637800BBEA55 /* layer_5@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "layer_5@2x.png"; path = "images/layer_5@2x.png"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ C39B2D191579610A00BBEA55 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ C39B2D461579623200BBEA55 /* CoreMotion.framework in Frameworks */,
+ C39B2D211579610A00BBEA55 /* UIKit.framework in Frameworks */,
+ C39B2D231579610A00BBEA55 /* Foundation.framework in Frameworks */,
+ C39B2D251579610A00BBEA55 /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ C39B2D111579610A00BBEA55 = {
+ isa = PBXGroup;
+ children = (
+ C39B2D411579620B00BBEA55 /* DIYParallax.h */,
+ C39B2D421579620B00BBEA55 /* DIYParallax.m */,
+ C39B2D471579629D00BBEA55 /* README.md */,
+ C39B2D49157962AC00BBEA55 /* LICENSE.md */,
+ C39B2D261579610A00BBEA55 /* parallax */,
+ C39B2D1F1579610A00BBEA55 /* Frameworks */,
+ C39B2D1D1579610A00BBEA55 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ C39B2D1D1579610A00BBEA55 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ C39B2D1C1579610A00BBEA55 /* parallax.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ C39B2D1F1579610A00BBEA55 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ C39B2D241579610A00BBEA55 /* CoreGraphics.framework */,
+ C39B2D451579623200BBEA55 /* CoreMotion.framework */,
+ C39B2D221579610A00BBEA55 /* Foundation.framework */,
+ C39B2D201579610A00BBEA55 /* UIKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ C39B2D261579610A00BBEA55 /* parallax */ = {
+ isa = PBXGroup;
+ children = (
+ C39B2D2F1579610A00BBEA55 /* DIYAppDelegate.h */,
+ C39B2D301579610A00BBEA55 /* DIYAppDelegate.m */,
+ C39B2D321579610A00BBEA55 /* DIYViewController.h */,
+ C39B2D331579610A00BBEA55 /* DIYViewController.m */,
+ C39B2D351579610A00BBEA55 /* DIYViewController.xib */,
+ C39B2D4B1579633D00BBEA55 /* images */,
+ C39B2D271579610A00BBEA55 /* Supporting Files */,
+ );
+ path = parallax;
+ sourceTree = "<group>";
+ };
+ C39B2D271579610A00BBEA55 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ C39B2D281579610A00BBEA55 /* parallax-Info.plist */,
+ C39B2D291579610A00BBEA55 /* InfoPlist.strings */,
+ C39B2D2C1579610A00BBEA55 /* main.m */,
+ C39B2D2E1579610A00BBEA55 /* parallax-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ C39B2D4B1579633D00BBEA55 /* images */ = {
+ isa = PBXGroup;
+ children = (
+ C39B2D4C1579637800BBEA55 /* layer_1@2x.png */,
+ C39B2D4D1579637800BBEA55 /* layer_2@2x.png */,
+ C39B2D4E1579637800BBEA55 /* layer_3@2x.png */,
+ C39B2D4F1579637800BBEA55 /* layer_4@2x.png */,
+ C39B2D501579637800BBEA55 /* layer_5@2x.png */,
+ );
+ name = images;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ C39B2D1B1579610A00BBEA55 /* parallax */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C39B2D3A1579610A00BBEA55 /* Build configuration list for PBXNativeTarget "parallax" */;
+ buildPhases = (
+ C39B2D181579610A00BBEA55 /* Sources */,
+ C39B2D191579610A00BBEA55 /* Frameworks */,
+ C39B2D1A1579610A00BBEA55 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = parallax;
+ productName = parallax;
+ productReference = C39B2D1C1579610A00BBEA55 /* parallax.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ C39B2D131579610A00BBEA55 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ CLASSPREFIX = DIY;
+ LastUpgradeCheck = 0430;
+ ORGANIZATIONNAME = "DIY, Co.";
+ };
+ buildConfigurationList = C39B2D161579610A00BBEA55 /* Build configuration list for PBXProject "parallax" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = C39B2D111579610A00BBEA55;
+ productRefGroup = C39B2D1D1579610A00BBEA55 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ C39B2D1B1579610A00BBEA55 /* parallax */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ C39B2D1A1579610A00BBEA55 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ C39B2D2B1579610A00BBEA55 /* InfoPlist.strings in Resources */,
+ C39B2D371579610A00BBEA55 /* DIYViewController.xib in Resources */,
+ C39B2D481579629D00BBEA55 /* README.md in Resources */,
+ C39B2D4A157962AC00BBEA55 /* LICENSE.md in Resources */,
+ C39B2D511579637800BBEA55 /* layer_1@2x.png in Resources */,
+ C39B2D521579637800BBEA55 /* layer_2@2x.png in Resources */,
+ C39B2D531579637800BBEA55 /* layer_3@2x.png in Resources */,
+ C39B2D541579637800BBEA55 /* layer_4@2x.png in Resources */,
+ C39B2D551579637800BBEA55 /* layer_5@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ C39B2D181579610A00BBEA55 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ C39B2D2D1579610A00BBEA55 /* main.m in Sources */,
+ C39B2D311579610A00BBEA55 /* DIYAppDelegate.m in Sources */,
+ C39B2D341579610A00BBEA55 /* DIYViewController.m in Sources */,
+ C39B2D431579620B00BBEA55 /* DIYParallax.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ C39B2D291579610A00BBEA55 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ C39B2D2A1579610A00BBEA55 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ C39B2D351579610A00BBEA55 /* DIYViewController.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ C39B2D361579610A00BBEA55 /* en */,
+ );
+ name = DIYViewController.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C39B2D381579610A00BBEA55 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ C39B2D391579610A00BBEA55 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ C39B2D3B1579610A00BBEA55 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "parallax/parallax-Prefix.pch";
+ INFOPLIST_FILE = "parallax/parallax-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ C39B2D3C1579610A00BBEA55 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "parallax/parallax-Prefix.pch";
+ INFOPLIST_FILE = "parallax/parallax-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C39B2D161579610A00BBEA55 /* Build configuration list for PBXProject "parallax" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C39B2D381579610A00BBEA55 /* Debug */,
+ C39B2D391579610A00BBEA55 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C39B2D3A1579610A00BBEA55 /* Build configuration list for PBXNativeTarget "parallax" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C39B2D3B1579610A00BBEA55 /* Debug */,
+ C39B2D3C1579610A00BBEA55 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = C39B2D131579610A00BBEA55 /* Project object */;
+}
7 example/parallax.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:parallax.xcodeproj">
+ </FileRef>
+</Workspace>
BIN  .../parallax.xcodeproj/project.xcworkspace/xcuserdata/asliwinski.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
85 example/parallax.xcodeproj/xcuserdata/asliwinski.xcuserdatad/xcschemes/parallax.xcscheme
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C39B2D1B1579610A00BBEA55"
+ BuildableName = "parallax.app"
+ BlueprintName = "parallax"
+ ReferencedContainer = "container:parallax.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C39B2D1B1579610A00BBEA55"
+ BuildableName = "parallax.app"
+ BlueprintName = "parallax"
+ ReferencedContainer = "container:parallax.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C39B2D1B1579610A00BBEA55"
+ BuildableName = "parallax.app"
+ BlueprintName = "parallax"
+ ReferencedContainer = "container:parallax.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C39B2D1B1579610A00BBEA55"
+ BuildableName = "parallax.app"
+ BlueprintName = "parallax"
+ ReferencedContainer = "container:parallax.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
22 example/parallax.xcodeproj/xcuserdata/asliwinski.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>parallax.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>C39B2D1B1579610A00BBEA55</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
19 example/parallax/DIYAppDelegate.h
@@ -0,0 +1,19 @@
+//
+// DIYAppDelegate.h
+// parallax
+//
+// Created by Andrew Sliwinski on 6/1/12.
+// Copyright (c) 2012 DIY, Co. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class DIYViewController;
+
+@interface DIYAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@property (strong, nonatomic) DIYViewController *viewController;
+
+@end
62 example/parallax/DIYAppDelegate.m
@@ -0,0 +1,62 @@
+//
+// DIYAppDelegate.m
+// parallax
+//
+// Created by Andrew Sliwinski on 6/1/12.
+// Copyright (c) 2012 DIY, Co. All rights reserved.
+//
+
+#import "DIYAppDelegate.h"
+
+#import "DIYViewController.h"
+
+@implementation DIYAppDelegate
+
+@synthesize window = _window;
+@synthesize viewController = _viewController;
+
+- (void)dealloc
+{
+ [_window release];
+ [_viewController release];
+ [super dealloc];
+}
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
+ // Override point for customization after application launch.
+ self.viewController = [[[DIYViewController alloc] initWithNibName:@"DIYViewController" bundle:nil] autorelease];
+ self.window.rootViewController = self.viewController;
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // 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.
+ // 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.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // 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.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
20 example/parallax/DIYViewController.h
@@ -0,0 +1,20 @@
+//
+// DIYViewController.h
+// parallax
+//
+// Created by Andrew Sliwinski on 6/1/12.
+// Copyright (c) 2012 DIY, Co. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "DIYParallax.h"
+
+@interface DIYViewController : UIViewController
+{
+
+}
+
+@property (nonatomic, retain) DIYParallax *parallax;
+
+@end
70 example/parallax/DIYViewController.m
@@ -0,0 +1,70 @@
+//
+// DIYViewController.m
+// parallax
+//
+// Created by Andrew Sliwinski on 6/1/12.
+// Copyright (c) 2012 DIY, Co. All rights reserved.
+//
+
+#import "DIYViewController.h"
+
+@interface DIYViewController ()
+
+@end
+
+@implementation DIYViewController
+
+@synthesize parallax;
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ //
+
+ parallax = [[DIYParallax alloc] initWithFrame:self.view.frame];
+
+ [parallax addLayer:0.0 imageNamed:@"layer_1@2x.png" frame:CGRectMake(0, 0, 480, 320)];
+ [parallax addLayer:0.1 imageNamed:@"layer_2@2x.png" frame:CGRectMake(240, 0, 240, 320)];
+ [parallax addLayer:0.2 imageNamed:@"layer_3@2x.png" frame:CGRectMake(240, 160, 240, 160)];
+ [parallax addLayer:0.3 imageNamed:@"layer_4@2x.png" frame:CGRectMake(120, 160, 120, 160)];
+ [parallax addLayer:0.8 imageNamed:@"layer_5@2x.png" frame:CGRectMake(60, 160, 60, 160)];
+
+ [self.view addSubview:parallax];
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+
+ [parallax startListeningToGyro];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
+}
+
+#pragma mark - Dealloc
+
+- (void)releaseObjects
+{
+ [parallax stopListeningToGyro];
+ [parallax release]; parallax = nil;
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ [self releaseObjects];
+}
+
+- (void)dealloc
+{
+ [self releaseObjects];
+ [super dealloc];
+}
+
+@end
119 example/parallax/en.lproj/DIYViewController.xib
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C25</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1919</string>
+ <string key="IBDocument.AppKitVersion">1138.11</string>
+ <string key="IBDocument.HIToolboxVersion">566.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">916</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="843779117">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="774585933">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC43NQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="774585933"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="843779117"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="774585933"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">DIYViewController</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">DIYViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/DIYViewController.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">916</string>
+ </data>
+</archive>
2  example/parallax/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
BIN  example/parallax/images/layer_1@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  example/parallax/images/layer_2@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  example/parallax/images/layer_3@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  example/parallax/images/layer_4@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  example/parallax/images/layer_5@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 example/parallax/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// parallax
+//
+// Created by Andrew Sliwinski on 6/1/12.
+// Copyright (c) 2012 DIY, Co. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "DIYAppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([DIYAppDelegate class]));
+ }
+}
38 example/parallax/parallax-Info.plist
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.diy.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UIStatusBarHidden</key>
+ <true/>
+</dict>
+</plist>
14 example/parallax/parallax-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'parallax' target in the 'parallax' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_4_0
+#warning "This project uses features only available in iOS SDK 4.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
Please sign in to comment.
Something went wrong with that request. Please try again.