From cef24dd2ba42407d1c67545b3062a9f689badcc7 Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Thu, 24 May 2012 11:03:28 -0700 Subject: [PATCH] braindead simple example of how to use. would be better with better-looking images. --- Example/Example.xcodeproj/project.pbxproj | 324 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + Example/Example/Example-Info.plist | 38 ++ Example/Example/Example-Prefix.pch | 14 + Example/Example/SLAppDelegate.h | 19 + Example/Example/SLAppDelegate.m | 55 +++ Example/Example/SLViewController.h | 13 + Example/Example/SLViewController.m | 71 ++++ Example/Example/en.lproj/InfoPlist.strings | 2 + Example/Example/en.lproj/SLViewController.xib | 164 +++++++++ Example/Example/main.m | 18 + images/blue.png | Bin 0 -> 1119 bytes images/green.png | Bin 0 -> 1120 bytes images/red.png | Bin 0 -> 1119 bytes 14 files changed, 725 insertions(+) create mode 100644 Example/Example.xcodeproj/project.pbxproj create mode 100644 Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Example/Example/Example-Info.plist create mode 100644 Example/Example/Example-Prefix.pch create mode 100644 Example/Example/SLAppDelegate.h create mode 100644 Example/Example/SLAppDelegate.m create mode 100644 Example/Example/SLViewController.h create mode 100644 Example/Example/SLViewController.m create mode 100644 Example/Example/en.lproj/InfoPlist.strings create mode 100644 Example/Example/en.lproj/SLViewController.xib create mode 100644 Example/Example/main.m create mode 100644 images/blue.png create mode 100644 images/green.png create mode 100644 images/red.png diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f956ded --- /dev/null +++ b/Example/Example.xcodeproj/project.pbxproj @@ -0,0 +1,324 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 93AEB0CB156EAD9D00F4C6A0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93AEB0CA156EAD9D00F4C6A0 /* UIKit.framework */; }; + 93AEB0CD156EAD9D00F4C6A0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93AEB0CC156EAD9D00F4C6A0 /* Foundation.framework */; }; + 93AEB0CF156EAD9D00F4C6A0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93AEB0CE156EAD9D00F4C6A0 /* CoreGraphics.framework */; }; + 93AEB0D5156EAD9D00F4C6A0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 93AEB0D3156EAD9D00F4C6A0 /* InfoPlist.strings */; }; + 93AEB0D7156EAD9D00F4C6A0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AEB0D6156EAD9D00F4C6A0 /* main.m */; }; + 93AEB0DB156EAD9D00F4C6A0 /* SLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AEB0DA156EAD9D00F4C6A0 /* SLAppDelegate.m */; }; + 93AEB0DE156EAD9D00F4C6A0 /* SLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AEB0DD156EAD9D00F4C6A0 /* SLViewController.m */; }; + 93AEB0E1156EAD9D00F4C6A0 /* SLViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93AEB0DF156EAD9D00F4C6A0 /* SLViewController.xib */; }; + 93AEB0EA156EADBB00F4C6A0 /* SYCompositor.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AEB0E9156EADBB00F4C6A0 /* SYCompositor.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 93AEB0ED156EADC100F4C6A0 /* SYCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AEB0EC156EADC100F4C6A0 /* SYCache.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 93AEB0F2156EAE2E00F4C6A0 /* blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 93AEB0EF156EAE2E00F4C6A0 /* blue.png */; }; + 93AEB0F3156EAE2E00F4C6A0 /* green.png in Resources */ = {isa = PBXBuildFile; fileRef = 93AEB0F0156EAE2E00F4C6A0 /* green.png */; }; + 93AEB0F4156EAE2E00F4C6A0 /* red.png in Resources */ = {isa = PBXBuildFile; fileRef = 93AEB0F1156EAE2E00F4C6A0 /* red.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 93AEB0C6156EAD9D00F4C6A0 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 93AEB0CA156EAD9D00F4C6A0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 93AEB0CC156EAD9D00F4C6A0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 93AEB0CE156EAD9D00F4C6A0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 93AEB0D2156EAD9D00F4C6A0 /* Example-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Example-Info.plist"; sourceTree = ""; }; + 93AEB0D4156EAD9D00F4C6A0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 93AEB0D6156EAD9D00F4C6A0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 93AEB0D8156EAD9D00F4C6A0 /* Example-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Example-Prefix.pch"; sourceTree = ""; }; + 93AEB0D9156EAD9D00F4C6A0 /* SLAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLAppDelegate.h; sourceTree = ""; }; + 93AEB0DA156EAD9D00F4C6A0 /* SLAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLAppDelegate.m; sourceTree = ""; }; + 93AEB0DC156EAD9D00F4C6A0 /* SLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLViewController.h; sourceTree = ""; }; + 93AEB0DD156EAD9D00F4C6A0 /* SLViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLViewController.m; sourceTree = ""; }; + 93AEB0E0156EAD9D00F4C6A0 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SLViewController.xib; sourceTree = ""; }; + 93AEB0E8156EADBB00F4C6A0 /* SYCompositor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SYCompositor.h; path = ../SYCompositor.h; sourceTree = ""; }; + 93AEB0E9156EADBB00F4C6A0 /* SYCompositor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SYCompositor.m; path = ../SYCompositor.m; sourceTree = ""; }; + 93AEB0EB156EADC100F4C6A0 /* SYCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SYCache.h; path = ../SYCache/SYCache.h; sourceTree = ""; }; + 93AEB0EC156EADC100F4C6A0 /* SYCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SYCache.m; path = ../SYCache/SYCache.m; sourceTree = ""; }; + 93AEB0EF156EAE2E00F4C6A0 /* blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blue.png; sourceTree = ""; }; + 93AEB0F0156EAE2E00F4C6A0 /* green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = green.png; sourceTree = ""; }; + 93AEB0F1156EAE2E00F4C6A0 /* red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = red.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 93AEB0C3156EAD9D00F4C6A0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 93AEB0CB156EAD9D00F4C6A0 /* UIKit.framework in Frameworks */, + 93AEB0CD156EAD9D00F4C6A0 /* Foundation.framework in Frameworks */, + 93AEB0CF156EAD9D00F4C6A0 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 93AEB0BB156EAD9C00F4C6A0 = { + isa = PBXGroup; + children = ( + 93AEB0EE156EAE2E00F4C6A0 /* images */, + 93AEB0E7156EADAF00F4C6A0 /* SYCompositor and Cache */, + 93AEB0D0156EAD9D00F4C6A0 /* Example */, + 93AEB0C9156EAD9D00F4C6A0 /* Frameworks */, + 93AEB0C7156EAD9D00F4C6A0 /* Products */, + ); + sourceTree = ""; + }; + 93AEB0C7156EAD9D00F4C6A0 /* Products */ = { + isa = PBXGroup; + children = ( + 93AEB0C6156EAD9D00F4C6A0 /* Example.app */, + ); + name = Products; + sourceTree = ""; + }; + 93AEB0C9156EAD9D00F4C6A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 93AEB0CA156EAD9D00F4C6A0 /* UIKit.framework */, + 93AEB0CC156EAD9D00F4C6A0 /* Foundation.framework */, + 93AEB0CE156EAD9D00F4C6A0 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 93AEB0D0156EAD9D00F4C6A0 /* Example */ = { + isa = PBXGroup; + children = ( + 93AEB0D9156EAD9D00F4C6A0 /* SLAppDelegate.h */, + 93AEB0DA156EAD9D00F4C6A0 /* SLAppDelegate.m */, + 93AEB0DC156EAD9D00F4C6A0 /* SLViewController.h */, + 93AEB0DD156EAD9D00F4C6A0 /* SLViewController.m */, + 93AEB0DF156EAD9D00F4C6A0 /* SLViewController.xib */, + 93AEB0D1156EAD9D00F4C6A0 /* Supporting Files */, + ); + path = Example; + sourceTree = ""; + }; + 93AEB0D1156EAD9D00F4C6A0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 93AEB0D2156EAD9D00F4C6A0 /* Example-Info.plist */, + 93AEB0D3156EAD9D00F4C6A0 /* InfoPlist.strings */, + 93AEB0D6156EAD9D00F4C6A0 /* main.m */, + 93AEB0D8156EAD9D00F4C6A0 /* Example-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 93AEB0E7156EADAF00F4C6A0 /* SYCompositor and Cache */ = { + isa = PBXGroup; + children = ( + 93AEB0EB156EADC100F4C6A0 /* SYCache.h */, + 93AEB0EC156EADC100F4C6A0 /* SYCache.m */, + 93AEB0E8156EADBB00F4C6A0 /* SYCompositor.h */, + 93AEB0E9156EADBB00F4C6A0 /* SYCompositor.m */, + ); + name = "SYCompositor and Cache"; + sourceTree = ""; + }; + 93AEB0EE156EAE2E00F4C6A0 /* images */ = { + isa = PBXGroup; + children = ( + 93AEB0EF156EAE2E00F4C6A0 /* blue.png */, + 93AEB0F0156EAE2E00F4C6A0 /* green.png */, + 93AEB0F1156EAE2E00F4C6A0 /* red.png */, + ); + name = images; + path = ../images; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 93AEB0C5156EAD9D00F4C6A0 /* Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 93AEB0E4156EAD9D00F4C6A0 /* Build configuration list for PBXNativeTarget "Example" */; + buildPhases = ( + 93AEB0C2156EAD9D00F4C6A0 /* Sources */, + 93AEB0C3156EAD9D00F4C6A0 /* Frameworks */, + 93AEB0C4156EAD9D00F4C6A0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Example; + productName = Example; + productReference = 93AEB0C6156EAD9D00F4C6A0 /* Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 93AEB0BD156EAD9C00F4C6A0 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = SL; + LastUpgradeCheck = 0430; + ORGANIZATIONNAME = "Structlab LLC"; + }; + buildConfigurationList = 93AEB0C0156EAD9C00F4C6A0 /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 93AEB0BB156EAD9C00F4C6A0; + productRefGroup = 93AEB0C7156EAD9D00F4C6A0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 93AEB0C5156EAD9D00F4C6A0 /* Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 93AEB0C4156EAD9D00F4C6A0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 93AEB0D5156EAD9D00F4C6A0 /* InfoPlist.strings in Resources */, + 93AEB0E1156EAD9D00F4C6A0 /* SLViewController.xib in Resources */, + 93AEB0F2156EAE2E00F4C6A0 /* blue.png in Resources */, + 93AEB0F3156EAE2E00F4C6A0 /* green.png in Resources */, + 93AEB0F4156EAE2E00F4C6A0 /* red.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 93AEB0C2156EAD9D00F4C6A0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 93AEB0D7156EAD9D00F4C6A0 /* main.m in Sources */, + 93AEB0DB156EAD9D00F4C6A0 /* SLAppDelegate.m in Sources */, + 93AEB0DE156EAD9D00F4C6A0 /* SLViewController.m in Sources */, + 93AEB0EA156EADBB00F4C6A0 /* SYCompositor.m in Sources */, + 93AEB0ED156EADC100F4C6A0 /* SYCache.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 93AEB0D3156EAD9D00F4C6A0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 93AEB0D4156EAD9D00F4C6A0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 93AEB0DF156EAD9D00F4C6A0 /* SLViewController.xib */ = { + isa = PBXVariantGroup; + children = ( + 93AEB0E0156EAD9D00F4C6A0 /* en */, + ); + name = SLViewController.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 93AEB0E2156EAD9D00F4C6A0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + "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; + }; + 93AEB0E3156EAD9D00F4C6A0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + "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; + }; + 93AEB0E5156EAD9D00F4C6A0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Example/Example-Prefix.pch"; + INFOPLIST_FILE = "Example/Example-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 93AEB0E6156EAD9D00F4C6A0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Example/Example-Prefix.pch"; + INFOPLIST_FILE = "Example/Example-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 93AEB0C0156EAD9C00F4C6A0 /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 93AEB0E2156EAD9D00F4C6A0 /* Debug */, + 93AEB0E3156EAD9D00F4C6A0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 93AEB0E4156EAD9D00F4C6A0 /* Build configuration list for PBXNativeTarget "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 93AEB0E5156EAD9D00F4C6A0 /* Debug */, + 93AEB0E6156EAD9D00F4C6A0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 93AEB0BD156EAD9C00F4C6A0 /* Project object */; +} diff --git a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6d2a51b --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/Example/Example-Info.plist b/Example/Example/Example-Info.plist new file mode 100644 index 0000000..ae638c5 --- /dev/null +++ b/Example/Example/Example-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.structlab.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/Example/Example-Prefix.pch b/Example/Example/Example-Prefix.pch new file mode 100644 index 0000000..556997e --- /dev/null +++ b/Example/Example/Example-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'Example' target in the 'Example' project +// + +#import + +#ifndef __IPHONE_4_0 +#warning "This project uses features only available in iOS SDK 4.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Example/Example/SLAppDelegate.h b/Example/Example/SLAppDelegate.h new file mode 100644 index 0000000..ce54da4 --- /dev/null +++ b/Example/Example/SLAppDelegate.h @@ -0,0 +1,19 @@ +// +// SLAppDelegate.h +// Example +// +// Created by Aaron Brethorst on 5/24/12. +// Copyright (c) 2012 Structlab LLC. All rights reserved. +// + +#import + +@class SLViewController; + +@interface SLAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (strong, nonatomic) SLViewController *viewController; + +@end diff --git a/Example/Example/SLAppDelegate.m b/Example/Example/SLAppDelegate.m new file mode 100644 index 0000000..7fead69 --- /dev/null +++ b/Example/Example/SLAppDelegate.m @@ -0,0 +1,55 @@ +// +// SLAppDelegate.m +// Example +// +// Created by Aaron Brethorst on 5/24/12. +// Copyright (c) 2012 Structlab LLC. All rights reserved. +// + +#import "SLAppDelegate.h" + +#import "SLViewController.h" + +@implementation SLAppDelegate + +@synthesize window = _window; +@synthesize viewController = _viewController; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + // Override point for customization after application launch. + self.viewController = [[SLViewController alloc] initWithNibName:@"SLViewController" bundle:nil]; + 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 diff --git a/Example/Example/SLViewController.h b/Example/Example/SLViewController.h new file mode 100644 index 0000000..9b9b5d3 --- /dev/null +++ b/Example/Example/SLViewController.h @@ -0,0 +1,13 @@ +// +// SLViewController.h +// Example +// +// Created by Aaron Brethorst on 5/24/12. +// Copyright (c) 2012 Structlab LLC. All rights reserved. +// + +#import + +@interface SLViewController : UIViewController +@property(strong,nonatomic) IBOutlet UIImageView *imageView; +@end diff --git a/Example/Example/SLViewController.m b/Example/Example/SLViewController.m new file mode 100644 index 0000000..e0b7b96 --- /dev/null +++ b/Example/Example/SLViewController.m @@ -0,0 +1,71 @@ +// +// SLViewController.m +// Example +// +// Created by Aaron Brethorst on 5/24/12. +// Copyright (c) 2012 Structlab LLC. All rights reserved. +// + +#import "SLViewController.h" +#import "SYCache.h" +#import "SYCompositor.h" + +@interface SLViewController () + +@end + +@implementation SLViewController +@synthesize imageView = _imageView; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + [self composite]; +} + +- (void)composite +{ + // Build your cache key to be unique per your layer configuration + NSString *cacheKey = @"cache-key"; + + // Get the image from SYCompositor + UIImage *image = [SYCompositor imageWithKey:cacheKey]; + + // If the image is `nil`, you should build it + if (image == nil) { + // Create your layers. See `SYCompositor.h` for a full list of available keys + NSArray *layers = [[NSArray alloc] initWithObjects: + // Lens + [NSDictionary dictionaryWithObjectsAndKeys: + @"red.png", kSYCompositorImageNameKey, + [NSValue valueWithCGRect:CGRectMake(88.0f, 275.0f, 50.f, 50.f)], kSYCompositorRectKey, + nil], + + // Body layer + [NSDictionary dictionaryWithObjectsAndKeys: + @"green.png", kSYCompositorImageNameKey, + [NSValue valueWithCGRect:CGRectMake(108.0f, 295.0f, 138.0f, 138.0f)], kSYCompositorRectKey, + nil], + nil]; + + // Create the image. This will store it in the cache automatically. + image = [SYCompositor imageWithLayers:layers size:[[UIScreen mainScreen] bounds].size key:cacheKey]; + } + + // Now `image` is ready to go! + self.imageView.image = image; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} + +@end diff --git a/Example/Example/en.lproj/InfoPlist.strings b/Example/Example/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Example/Example/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Example/Example/en.lproj/SLViewController.xib b/Example/Example/en.lproj/SLViewController.xib new file mode 100644 index 0000000..d8406f3 --- /dev/null +++ b/Example/Example/en.lproj/SLViewController.xib @@ -0,0 +1,164 @@ + + + + 1296 + 11D50b + 2182 + 1138.32 + 568.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1179 + + + IBProxyObject + IBUIView + IBUIImageView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {320, 460} + + + _NS:9 + NO + IBCocoaTouchFramework + + + {{0, 20}, {320, 460}} + + + + 3 + MC43NQA + + 2 + + + NO + + IBCocoaTouchFramework + + + + + + + view + + + + 7 + + + + imageView + + + + 9 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 6 + + + + + + + + 8 + + + + + + + SLViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 9 + + + + + SLViewController + UIViewController + + imageView + UIImageView + + + imageView + + imageView + UIImageView + + + + IBProjectSource + ./Classes/SLViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + 1179 + + diff --git a/Example/Example/main.m b/Example/Example/main.m new file mode 100644 index 0000000..85ecb0f --- /dev/null +++ b/Example/Example/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Example +// +// Created by Aaron Brethorst on 5/24/12. +// Copyright (c) 2012 Structlab LLC. All rights reserved. +// + +#import + +#import "SLAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([SLAppDelegate class])); + } +} diff --git a/images/blue.png b/images/blue.png new file mode 100644 index 0000000000000000000000000000000000000000..89b7b3b253bd3277ad328a97885ee9abee6f99a4 GIT binary patch literal 1119 zcmcgrJ#5oJ7x6R}0z#9S&nG>sn7a3f_g82Ce? z$+?&l`G(kVaxO~~v6@UqE2`kHsu&%~QY)6@8kd`Km(WDEMk;#%zkl&s_RmS(S!?Fs zets#ONo>uPb_QYV-T* QV_39&-Q9NHu0MSG2j#0hW&i*H literal 0 HcmV?d00001 diff --git a/images/green.png b/images/green.png new file mode 100644 index 0000000000000000000000000000000000000000..933b287d36927547d07afd67cf9fceb0c4c69ac8 GIT binary patch literal 1120 zcmcgrO>5LZ7*4g6ZK2@RiZG-gEx5@{c9S+kV?Q?8cE!}PyWolZS!j zJ?Rh7i+A-Th!??wXAd4c2_C&F_!pe)ZdMOlkA_L+gZFvfXP&(8)1B?j*_pW+Ns?w8 zTXs{-LH?Ge#5ei=tSzSV-0AQZ-Qzuv5otZ3y96{MZ=W=Y7aZUFL{=o}?DeqS;T`uH z_GzSed5n@pi9k!z%4(K){sG}&m+XhJCI9;HQ3hdP$v1Qtx=D?6!>toWS|{6W|Kz|o z19|ldSjn&;hzR#U79GYZ&Mdjli^V!WR%Or+;RlvH5Y=&aK#ej2bfr@EAws|~6jap> z16>9hM4Af4Fv_TkbpvZlVED))8w>Vu)2v_If>~S5YY2SCMI&Iftf| zMMOD0j=7hW<8;1Yuu1B(FySGMLC)yy(j#ukLh0ZNQ8J>9)1ghmFg5cM6)7;kQW5C7 z{|=3!QFO|i0@tETNZ2sy}fbZ0|Dy0)w%WE!Zz+SEUaNX!dt@CU1(ip}dLNWoI9 z?+*^gXwl5|`cieNF8J*6S_ar)jFtg*8J>z&g%~xjg1@SwI1;6nFGn>lHlr>fv1kn@ zdf-C+^=HvPuNwAxJNx$Y%cE%tmL}hB;`c9p%sFiS_MJ-?AGB^t_S(Zz>DdpTU+6|9W(H>1U}R)QVn+;|(pYC;n)5E|F<<0wG zBgcXuCfo;ke3WE3x8xBo7VF|zmBA>4A6oK7QeCeJ>NF)lS1RQIA_NRWK~>!_&>GMn z(o`shQASm)8(3Qh<3|>1X?TEJc4Mq1c9z`doMBZR4u{IHqR_ObBGWVr4oxeIh;nw4 za6d06+46+JCRvb1j7Ky91*5-D2i%fHrWaR;*_1ZP#x@DV)ZAw(QebhVNucNbJ2Z}` z(HU=%%Y6SzoOMnZQClRVgESC7?qIo)Vz{0XpVPEM>Cwc+W}kAJ^(h1OwgFa9MS&yp zUewy2w!31yq4(NhvOQW}GiKRBA5 zOKm3K7#q&cr9Km@ie%KH3jU~y$&o0vVmYmGv6*%WNknU;q6gN_Uu=o~IdkppPX6`# z=hBh{7v|sfJ{?~-Zhd*p-n#hbS+8`XRFc8g{QS#j(#`+626JQG$MouLsT$4ggmCby OXnEJ!v(IZ!p8p0!kUgRR literal 0 HcmV?d00001