diff --git a/9781430259596.jpg b/9781430259596.jpg new file mode 100644 index 0000000..9d7afca Binary files /dev/null and b/9781430259596.jpg differ diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.pbxproj b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.pbxproj new file mode 100644 index 0000000..30e9b54 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.pbxproj @@ -0,0 +1,483 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 881C33AC1773FA8B0025BD62 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881C33AB1773FA8B0025BD62 /* Foundation.framework */; }; + 881C33AE1773FA8B0025BD62 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881C33AD1773FA8B0025BD62 /* CoreGraphics.framework */; }; + 881C33B01773FA8B0025BD62 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881C33AF1773FA8B0025BD62 /* UIKit.framework */; }; + 881C33B61773FA8B0025BD62 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881C33B41773FA8B0025BD62 /* InfoPlist.strings */; }; + 881C33B81773FA8B0025BD62 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 881C33B71773FA8B0025BD62 /* main.m */; }; + 881C33BC1773FA8B0025BD62 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 881C33BB1773FA8B0025BD62 /* AppDelegate.m */; }; + 881C33BF1773FA8B0025BD62 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881C33BD1773FA8B0025BD62 /* Main.storyboard */; }; + 881C33C21773FA8B0025BD62 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881C33C11773FA8B0025BD62 /* ViewController.m */; }; + 881C33C41773FA8B0025BD62 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 881C33C31773FA8B0025BD62 /* Images.xcassets */; }; + 881C33CB1773FA8B0025BD62 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881C33CA1773FA8B0025BD62 /* XCTest.framework */; }; + 881C33CC1773FA8B0025BD62 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881C33AB1773FA8B0025BD62 /* Foundation.framework */; }; + 881C33CD1773FA8B0025BD62 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881C33AF1773FA8B0025BD62 /* UIKit.framework */; }; + 881C33D51773FA8C0025BD62 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881C33D31773FA8C0025BD62 /* InfoPlist.strings */; }; + 881C33D71773FA8C0025BD62 /* My_SIngle_View_AppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 881C33D61773FA8C0025BD62 /* My_SIngle_View_AppTests.m */; }; + 881C33E11773FF4B0025BD62 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881C33E01773FF4B0025BD62 /* CoreData.framework */; }; + 886E82EF177AB14F00348455 /* IMG_0195.JPG in Resources */ = {isa = PBXBuildFile; fileRef = 886E82EE177AB14E00348455 /* IMG_0195.JPG */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 881C33CE1773FA8B0025BD62 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 881C33A01773FA8B0025BD62 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 881C33A71773FA8B0025BD62; + remoteInfo = "My SIngle View App"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 881C33A81773FA8B0025BD62 /* My SIngle View App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "My SIngle View App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881C33AB1773FA8B0025BD62 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 881C33AD1773FA8B0025BD62 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 881C33AF1773FA8B0025BD62 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 881C33B31773FA8B0025BD62 /* My SIngle View App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "My SIngle View App-Info.plist"; sourceTree = ""; }; + 881C33B51773FA8B0025BD62 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881C33B71773FA8B0025BD62 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 881C33B91773FA8B0025BD62 /* My SIngle View App-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "My SIngle View App-Prefix.pch"; sourceTree = ""; }; + 881C33BA1773FA8B0025BD62 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 881C33BB1773FA8B0025BD62 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 881C33BE1773FA8B0025BD62 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 881C33C01773FA8B0025BD62 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 881C33C11773FA8B0025BD62 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 881C33C31773FA8B0025BD62 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 881C33C91773FA8B0025BD62 /* My SIngle View AppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "My SIngle View AppTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881C33CA1773FA8B0025BD62 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 881C33D21773FA8C0025BD62 /* My SIngle View AppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "My SIngle View AppTests-Info.plist"; sourceTree = ""; }; + 881C33D41773FA8C0025BD62 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881C33D61773FA8C0025BD62 /* My_SIngle_View_AppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = My_SIngle_View_AppTests.m; sourceTree = ""; }; + 881C33E01773FF4B0025BD62 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 886E82EC177AAC2E00348455 /* MyClass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyClass.h; sourceTree = ""; }; + 886E82ED177AAC2E00348455 /* MyClass.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyClass.m; sourceTree = ""; }; + 886E82EE177AB14E00348455 /* IMG_0195.JPG */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = IMG_0195.JPG; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 881C33A51773FA8B0025BD62 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881C33E11773FF4B0025BD62 /* CoreData.framework in Frameworks */, + 881C33AC1773FA8B0025BD62 /* Foundation.framework in Frameworks */, + 881C33AE1773FA8B0025BD62 /* CoreGraphics.framework in Frameworks */, + 881C33B01773FA8B0025BD62 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881C33C61773FA8B0025BD62 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881C33CB1773FA8B0025BD62 /* XCTest.framework in Frameworks */, + 881C33CD1773FA8B0025BD62 /* UIKit.framework in Frameworks */, + 881C33CC1773FA8B0025BD62 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 881C339F1773FA8B0025BD62 = { + isa = PBXGroup; + children = ( + 881C33B11773FA8B0025BD62 /* My SIngle View App */, + 881C33D01773FA8B0025BD62 /* My SIngle View AppTests */, + 881C33AA1773FA8B0025BD62 /* Frameworks */, + 881C33A91773FA8B0025BD62 /* Products */, + ); + sourceTree = ""; + }; + 881C33A91773FA8B0025BD62 /* Products */ = { + isa = PBXGroup; + children = ( + 881C33A81773FA8B0025BD62 /* My SIngle View App.app */, + 881C33C91773FA8B0025BD62 /* My SIngle View AppTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 881C33AA1773FA8B0025BD62 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 881C33E01773FF4B0025BD62 /* CoreData.framework */, + 881C33AB1773FA8B0025BD62 /* Foundation.framework */, + 881C33AD1773FA8B0025BD62 /* CoreGraphics.framework */, + 881C33AF1773FA8B0025BD62 /* UIKit.framework */, + 881C33CA1773FA8B0025BD62 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 881C33B11773FA8B0025BD62 /* My SIngle View App */ = { + isa = PBXGroup; + children = ( + 881C33BA1773FA8B0025BD62 /* AppDelegate.h */, + 881C33BB1773FA8B0025BD62 /* AppDelegate.m */, + 881C33BD1773FA8B0025BD62 /* Main.storyboard */, + 886E82EC177AAC2E00348455 /* MyClass.h */, + 886E82ED177AAC2E00348455 /* MyClass.m */, + 881C33C01773FA8B0025BD62 /* ViewController.h */, + 881C33C11773FA8B0025BD62 /* ViewController.m */, + 881C33C31773FA8B0025BD62 /* Images.xcassets */, + 881C33B21773FA8B0025BD62 /* Supporting Files */, + ); + path = "My SIngle View App"; + sourceTree = ""; + }; + 881C33B21773FA8B0025BD62 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886E82EE177AB14E00348455 /* IMG_0195.JPG */, + 881C33B31773FA8B0025BD62 /* My SIngle View App-Info.plist */, + 881C33B41773FA8B0025BD62 /* InfoPlist.strings */, + 881C33B71773FA8B0025BD62 /* main.m */, + 881C33B91773FA8B0025BD62 /* My SIngle View App-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 881C33D01773FA8B0025BD62 /* My SIngle View AppTests */ = { + isa = PBXGroup; + children = ( + 881C33D61773FA8C0025BD62 /* My_SIngle_View_AppTests.m */, + 881C33D11773FA8C0025BD62 /* Supporting Files */, + ); + path = "My SIngle View AppTests"; + sourceTree = ""; + }; + 881C33D11773FA8C0025BD62 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881C33D21773FA8C0025BD62 /* My SIngle View AppTests-Info.plist */, + 881C33D31773FA8C0025BD62 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 881C33A71773FA8B0025BD62 /* My SIngle View App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881C33DA1773FA8C0025BD62 /* Build configuration list for PBXNativeTarget "My SIngle View App" */; + buildPhases = ( + 881C33A41773FA8B0025BD62 /* Sources */, + 881C33A51773FA8B0025BD62 /* Frameworks */, + 881C33A61773FA8B0025BD62 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "My SIngle View App"; + productName = "My SIngle View App"; + productReference = 881C33A81773FA8B0025BD62 /* My SIngle View App.app */; + productType = "com.apple.product-type.application"; + }; + 881C33C81773FA8B0025BD62 /* My SIngle View AppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881C33DD1773FA8C0025BD62 /* Build configuration list for PBXNativeTarget "My SIngle View AppTests" */; + buildPhases = ( + 881C33C51773FA8B0025BD62 /* Sources */, + 881C33C61773FA8B0025BD62 /* Frameworks */, + 881C33C71773FA8B0025BD62 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 881C33CF1773FA8B0025BD62 /* PBXTargetDependency */, + ); + name = "My SIngle View AppTests"; + productName = "My SIngle View AppTests"; + productReference = 881C33C91773FA8B0025BD62 /* My SIngle View AppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 881C33A01773FA8B0025BD62 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 881C33C81773FA8B0025BD62 = { + TestTargetID = 881C33A71773FA8B0025BD62; + }; + }; + }; + buildConfigurationList = 881C33A31773FA8B0025BD62 /* Build configuration list for PBXProject "My SIngle View App" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 881C339F1773FA8B0025BD62; + productRefGroup = 881C33A91773FA8B0025BD62 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 881C33A71773FA8B0025BD62 /* My SIngle View App */, + 881C33C81773FA8B0025BD62 /* My SIngle View AppTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 881C33A61773FA8B0025BD62 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881C33C41773FA8B0025BD62 /* Images.xcassets in Resources */, + 881C33B61773FA8B0025BD62 /* InfoPlist.strings in Resources */, + 886E82EF177AB14F00348455 /* IMG_0195.JPG in Resources */, + 881C33BF1773FA8B0025BD62 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881C33C71773FA8B0025BD62 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881C33D51773FA8C0025BD62 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 881C33A41773FA8B0025BD62 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881C33C21773FA8B0025BD62 /* ViewController.m in Sources */, + 881C33BC1773FA8B0025BD62 /* AppDelegate.m in Sources */, + 881C33B81773FA8B0025BD62 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881C33C51773FA8B0025BD62 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881C33D71773FA8C0025BD62 /* My_SIngle_View_AppTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 881C33CF1773FA8B0025BD62 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 881C33A71773FA8B0025BD62 /* My SIngle View App */; + targetProxy = 881C33CE1773FA8B0025BD62 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 881C33B41773FA8B0025BD62 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881C33B51773FA8B0025BD62 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 881C33BD1773FA8B0025BD62 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 881C33BE1773FA8B0025BD62 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 881C33D31773FA8C0025BD62 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881C33D41773FA8C0025BD62 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 881C33D81773FA8C0025BD62 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 881C33D91773FA8C0025BD62 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 881C33DB1773FA8C0025BD62 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "My SIngle View App/My SIngle View App-Prefix.pch"; + INFOPLIST_FILE = "My SIngle View App/My SIngle View App-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 881C33DC1773FA8C0025BD62 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "My SIngle View App/My SIngle View App-Prefix.pch"; + INFOPLIST_FILE = "My SIngle View App/My SIngle View App-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 881C33DE1773FA8C0025BD62 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/My SIngle View App.app/My SIngle View App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "My SIngle View App/My SIngle View App-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "My SIngle View AppTests/My SIngle View AppTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 881C33DF1773FA8C0025BD62 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/My SIngle View App.app/My SIngle View App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "My SIngle View App/My SIngle View App-Prefix.pch"; + INFOPLIST_FILE = "My SIngle View AppTests/My SIngle View AppTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 881C33A31773FA8B0025BD62 /* Build configuration list for PBXProject "My SIngle View App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881C33D81773FA8C0025BD62 /* Debug */, + 881C33D91773FA8C0025BD62 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881C33DA1773FA8C0025BD62 /* Build configuration list for PBXNativeTarget "My SIngle View App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881C33DB1773FA8C0025BD62 /* Debug */, + 881C33DC1773FA8C0025BD62 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881C33DD1773FA8C0025BD62 /* Build configuration list for PBXNativeTarget "My SIngle View AppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881C33DE1773FA8C0025BD62 /* Debug */, + 881C33DF1773FA8C0025BD62 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 881C33A01773FA8B0025BD62 /* Project object */; +} diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0910bb1 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..053b915 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/My SIngle View App.xcscheme b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/My SIngle View App.xcscheme new file mode 100644 index 0000000..e48b277 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/My SIngle View App.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1a6ec3b --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + My SIngle View App.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 881C33A71773FA8B0025BD62 + + primary + + + 881C33C81773FA8B0025BD62 + + primary + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/AppDelegate.h b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/AppDelegate.h new file mode 100644 index 0000000..1874579 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// My SIngle View App +// +// Created by joseph hoffman on 6/20/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/AppDelegate.m b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/AppDelegate.m new file mode 100644 index 0000000..bf368b5 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// My SIngle View App +// +// Created by joseph hoffman on 6/20/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Base.lproj/Main.storyboard b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Base.lproj/Main.storyboard new file mode 100644 index 0000000..21fe951 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Base.lproj/Main.storyboard @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/IMG_0195.JPG b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/IMG_0195.JPG new file mode 100644 index 0000000..0358841 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/IMG_0195.JPG differ diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/AppIcon.appiconset/Contents.json b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/tater.imageset/Contents.json b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/tater.imageset/Contents.json new file mode 100644 index 0000000..8a4ea0b --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/Images.xcassets/tater.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/My SIngle View App-Info.plist b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/My SIngle View App-Info.plist new file mode 100644 index 0000000..96e5444 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/My SIngle View App-Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationUsageDescription + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/My SIngle View App-Prefix.pch b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/My SIngle View App-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/My SIngle View App-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/MyClass.h b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/MyClass.h new file mode 100644 index 0000000..074a283 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/MyClass.h @@ -0,0 +1,13 @@ +// +// MyClass.h +// My SIngle View App +// +// Created by joseph hoffman on 6/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface MyClass : NSObject + +@end diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/MyClass.m b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/MyClass.m new file mode 100644 index 0000000..3e5f52e --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/MyClass.m @@ -0,0 +1,13 @@ +// +// MyClass.m +// My SIngle View App +// +// Created by joseph hoffman on 6/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MyClass.h" + +@implementation MyClass + +@end diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/ViewController.h b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/ViewController.h new file mode 100644 index 0000000..6ee4a0d --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/ViewController.h @@ -0,0 +1,17 @@ +// +// ViewController.h +// My SIngle View App +// +// Created by joseph hoffman on 6/20/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIButton *myButton; + + +- (IBAction)sayHello:(id)sender; +@end diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/ViewController.m b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/ViewController.m new file mode 100644 index 0000000..c0f0134 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/ViewController.m @@ -0,0 +1,44 @@ +// +// ViewController.m +// My SIngle View App +// +// Created by joseph hoffman on 6/20/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + [self.myButton setTitle:@"Outlet!" forState:UIControlStateNormal]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)showAlert:(id)sender +{ + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Testing Actions" + message:@"Hello Brother!" + delegate:nil + cancelButtonTitle:@"Dismiss" + otherButtonTitles:nil]; + [alert show]; + +} + +- (IBAction)sayHello:(id)sender { +} +@end diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/main.m b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/main.m new file mode 100644 index 0000000..2ba102c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-1 to 1-8/My SIngle View App/main.m @@ -0,0 +1,18 @@ +// +// main.m +// My SIngle View App +// +// Created by joseph hoffman on 6/20/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/.DS_Store b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/.DS_Store new file mode 100644 index 0000000..78ce279 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/.DS_Store differ diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.pbxproj b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1b9b403 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF35E1177BF954009D869F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF35E0177BF954009D869F /* Foundation.framework */; }; + 88CF35E3177BF954009D869F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF35E2177BF954009D869F /* CoreGraphics.framework */; }; + 88CF35E5177BF954009D869F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF35E4177BF954009D869F /* UIKit.framework */; }; + 88CF35EB177BF954009D869F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF35E9177BF954009D869F /* InfoPlist.strings */; }; + 88CF35ED177BF954009D869F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35EC177BF954009D869F /* main.m */; }; + 88CF35F1177BF954009D869F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35F0177BF954009D869F /* AppDelegate.m */; }; + 88CF35F4177BF954009D869F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CF35F2177BF954009D869F /* Main.storyboard */; }; + 88CF35F7177BF954009D869F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35F6177BF954009D869F /* ViewController.m */; }; + 88CF35F9177BF954009D869F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CF35F8177BF954009D869F /* Images.xcassets */; }; + 88CF3600177BF954009D869F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF35FF177BF954009D869F /* XCTest.framework */; }; + 88CF3601177BF954009D869F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF35E0177BF954009D869F /* Foundation.framework */; }; + 88CF3602177BF954009D869F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF35E4177BF954009D869F /* UIKit.framework */; }; + 88CF360A177BF954009D869F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF3608177BF954009D869F /* InfoPlist.strings */; }; + 88CF360C177BF954009D869F /* Recipe_1_10__Handling_ExceptionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF360B177BF954009D869F /* Recipe_1_10__Handling_ExceptionsTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF3603177BF954009D869F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF35D5177BF954009D869F /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF35DC177BF954009D869F; + remoteInfo = "Recipe 1-10: Handling Exceptions"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF35DD177BF954009D869F /* Recipe 1-10 Handling Exceptions.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 1-10 Handling Exceptions.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF35E0177BF954009D869F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF35E2177BF954009D869F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF35E4177BF954009D869F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF35E8177BF954009D869F /* Recipe 1-10 Handling Exceptions-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-10 Handling Exceptions-Info.plist"; sourceTree = ""; }; + 88CF35EA177BF954009D869F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF35EC177BF954009D869F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF35EE177BF954009D869F /* Recipe 1-10 Handling Exceptions-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 1-10 Handling Exceptions-Prefix.pch"; sourceTree = ""; }; + 88CF35EF177BF954009D869F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CF35F0177BF954009D869F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CF35F3177BF954009D869F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CF35F5177BF954009D869F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CF35F6177BF954009D869F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CF35F8177BF954009D869F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CF35FE177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 1-10 Handling ExceptionsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF35FF177BF954009D869F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF3607177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-10 Handling ExceptionsTests-Info.plist"; sourceTree = ""; }; + 88CF3609177BF954009D869F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF360B177BF954009D869F /* Recipe_1_10__Handling_ExceptionsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_1_10__Handling_ExceptionsTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF35DA177BF954009D869F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35E3177BF954009D869F /* CoreGraphics.framework in Frameworks */, + 88CF35E5177BF954009D869F /* UIKit.framework in Frameworks */, + 88CF35E1177BF954009D869F /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF35FB177BF954009D869F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF3600177BF954009D869F /* XCTest.framework in Frameworks */, + 88CF3602177BF954009D869F /* UIKit.framework in Frameworks */, + 88CF3601177BF954009D869F /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF35D4177BF954009D869F = { + isa = PBXGroup; + children = ( + 88CF35E6177BF954009D869F /* Recipe 1-10 Handling Exceptions */, + 88CF3605177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests */, + 88CF35DF177BF954009D869F /* Frameworks */, + 88CF35DE177BF954009D869F /* Products */, + ); + sourceTree = ""; + }; + 88CF35DE177BF954009D869F /* Products */ = { + isa = PBXGroup; + children = ( + 88CF35DD177BF954009D869F /* Recipe 1-10 Handling Exceptions.app */, + 88CF35FE177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF35DF177BF954009D869F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CF35E0177BF954009D869F /* Foundation.framework */, + 88CF35E2177BF954009D869F /* CoreGraphics.framework */, + 88CF35E4177BF954009D869F /* UIKit.framework */, + 88CF35FF177BF954009D869F /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF35E6177BF954009D869F /* Recipe 1-10 Handling Exceptions */ = { + isa = PBXGroup; + children = ( + 88CF35EF177BF954009D869F /* AppDelegate.h */, + 88CF35F0177BF954009D869F /* AppDelegate.m */, + 88CF35F2177BF954009D869F /* Main.storyboard */, + 88CF35F5177BF954009D869F /* ViewController.h */, + 88CF35F6177BF954009D869F /* ViewController.m */, + 88CF35F8177BF954009D869F /* Images.xcassets */, + 88CF35E7177BF954009D869F /* Supporting Files */, + ); + name = "Recipe 1-10 Handling Exceptions"; + path = "Recipe 1-10: Handling Exceptions"; + sourceTree = ""; + }; + 88CF35E7177BF954009D869F /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF35E8177BF954009D869F /* Recipe 1-10 Handling Exceptions-Info.plist */, + 88CF35E9177BF954009D869F /* InfoPlist.strings */, + 88CF35EC177BF954009D869F /* main.m */, + 88CF35EE177BF954009D869F /* Recipe 1-10 Handling Exceptions-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF3605177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests */ = { + isa = PBXGroup; + children = ( + 88CF360B177BF954009D869F /* Recipe_1_10__Handling_ExceptionsTests.m */, + 88CF3606177BF954009D869F /* Supporting Files */, + ); + name = "Recipe 1-10 Handling ExceptionsTests"; + path = "Recipe 1-10: Handling ExceptionsTests"; + sourceTree = ""; + }; + 88CF3606177BF954009D869F /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF3607177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests-Info.plist */, + 88CF3608177BF954009D869F /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF35DC177BF954009D869F /* Recipe 1-10 Handling Exceptions */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF360F177BF954009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-10 Handling Exceptions" */; + buildPhases = ( + 88CF35D9177BF954009D869F /* Sources */, + 88CF35DA177BF954009D869F /* Frameworks */, + 88CF35DB177BF954009D869F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 1-10 Handling Exceptions"; + productName = "Recipe 1-10: Handling Exceptions"; + productReference = 88CF35DD177BF954009D869F /* Recipe 1-10 Handling Exceptions.app */; + productType = "com.apple.product-type.application"; + }; + 88CF35FD177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF3612177BF954009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-10 Handling ExceptionsTests" */; + buildPhases = ( + 88CF35FA177BF954009D869F /* Sources */, + 88CF35FB177BF954009D869F /* Frameworks */, + 88CF35FC177BF954009D869F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF3604177BF954009D869F /* PBXTargetDependency */, + ); + name = "Recipe 1-10 Handling ExceptionsTests"; + productName = "Recipe 1-10: Handling ExceptionsTests"; + productReference = 88CF35FE177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF35D5177BF954009D869F /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF35FD177BF954009D869F = { + TestTargetID = 88CF35DC177BF954009D869F; + }; + }; + }; + buildConfigurationList = 88CF35D8177BF954009D869F /* Build configuration list for PBXProject "Recipe 1-10 Handling Exceptions" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CF35D4177BF954009D869F; + productRefGroup = 88CF35DE177BF954009D869F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF35DC177BF954009D869F /* Recipe 1-10 Handling Exceptions */, + 88CF35FD177BF954009D869F /* Recipe 1-10 Handling ExceptionsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF35DB177BF954009D869F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35F9177BF954009D869F /* Images.xcassets in Resources */, + 88CF35EB177BF954009D869F /* InfoPlist.strings in Resources */, + 88CF35F4177BF954009D869F /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF35FC177BF954009D869F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF360A177BF954009D869F /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF35D9177BF954009D869F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35F7177BF954009D869F /* ViewController.m in Sources */, + 88CF35F1177BF954009D869F /* AppDelegate.m in Sources */, + 88CF35ED177BF954009D869F /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF35FA177BF954009D869F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF360C177BF954009D869F /* Recipe_1_10__Handling_ExceptionsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF3604177BF954009D869F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF35DC177BF954009D869F /* Recipe 1-10 Handling Exceptions */; + targetProxy = 88CF3603177BF954009D869F /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF35E9177BF954009D869F /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF35EA177BF954009D869F /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF35F2177BF954009D869F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CF35F3177BF954009D869F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CF3608177BF954009D869F /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF3609177BF954009D869F /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF360D177BF954009D869F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF360E177BF954009D869F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF3610177BF954009D869F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-10: Handling Exceptions/Recipe 1-10 Handling Exceptions-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-10: Handling Exceptions/Recipe 1-10 Handling Exceptions-Info.plist"; + PRODUCT_NAME = "Recipe 1-10 Handling Exceptions"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF3611177BF954009D869F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-10: Handling Exceptions/Recipe 1-10 Handling Exceptions-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-10: Handling Exceptions/Recipe 1-10 Handling Exceptions-Info.plist"; + PRODUCT_NAME = "Recipe 1-10 Handling Exceptions"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF3613177BF954009D869F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-10: Handling Exceptions.app/Recipe 1-10: Handling Exceptions"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-10: Handling Exceptions/Recipe 1-10: Handling Exceptions-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 1-10: Handling ExceptionsTests/Recipe 1-10 Handling ExceptionsTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-10 Handling ExceptionsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF3614177BF954009D869F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-10: Handling Exceptions.app/Recipe 1-10: Handling Exceptions"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-10: Handling Exceptions/Recipe 1-10: Handling Exceptions-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-10: Handling ExceptionsTests/Recipe 1-10 Handling ExceptionsTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-10 Handling ExceptionsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF35D8177BF954009D869F /* Build configuration list for PBXProject "Recipe 1-10 Handling Exceptions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF360D177BF954009D869F /* Debug */, + 88CF360E177BF954009D869F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF360F177BF954009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-10 Handling Exceptions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF3610177BF954009D869F /* Debug */, + 88CF3611177BF954009D869F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF3612177BF954009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-10 Handling ExceptionsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF3613177BF954009D869F /* Debug */, + 88CF3614177BF954009D869F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF35D5177BF954009D869F /* Project object */; +} diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..252cceb --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..9db5116 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-10 Handling Exceptions.xcscheme b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-10 Handling Exceptions.xcscheme new file mode 100644 index 0000000..d8a68d8 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-10 Handling Exceptions.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6df3084 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 1-10 Handling Exceptions.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CF35DC177BF954009D869F + + primary + + + 88CF35FD177BF954009D869F + + primary + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/AppDelegate.h b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/AppDelegate.h new file mode 100644 index 0000000..25354cc --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Recipe 1-10 Handling Exceptions +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/AppDelegate.m b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/AppDelegate.m new file mode 100644 index 0000000..bae487b --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/AppDelegate.m @@ -0,0 +1,138 @@ +// +// AppDelegate.m +// Recipe 1-10 Handling Exceptions +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ +//#if!TARGET_IPHONE_SIMULATOR + // Default exception handling code + NSUserDefaults *settings = [NSUserDefaults standardUserDefaults]; + + if ([settings boolForKey:@"ExceptionOccurredOnLastRun"]) + { + // Reset exception occurred flag + [settings setBool:NO forKey:@"ExceptionOccurredOnLastRunKey"]; + [settings synchronize]; + + // Notify the user + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"We're sorry" + message:@"An error occurred on the previous run." delegate:self + cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; + [alert addButtonWithTitle:@"Email Report"]; + [alert show]; + } + else + { + + + + + NSSetUncaughtExceptionHandler(&exceptionHandler); + + // Redirect stderr output stream to file + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, + NSUserDomainMask, YES); + NSString *documentsPath = [paths objectAtIndex:0]; + NSString *stderrPath = [documentsPath stringByAppendingPathComponent:@"stderr.log"]; + + freopen([stderrPath cStringUsingEncoding:NSASCIIStringEncoding], "w", stderr); + + } +//#endif + + 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:. +} +void exceptionHandler(NSException *exception) +{ + + NSLog(@"Uncaught exception: %@\nReason: %@\nUser Info: %@\nCall Stack: %@", + exception.name, exception.reason, exception.userInfo, exception.callStackSymbols); + + //Set flag + NSUserDefaults *settings = [NSUserDefaults standardUserDefaults]; + + [settings setBool:YES forKey:@"ExceptionOccurredOnLastRun"]; + [settings synchronize]; +} +-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, + NSUserDomainMask, YES); + NSString *documentsPath = [paths objectAtIndex:0]; + NSString *stderrPath = [documentsPath stringByAppendingPathComponent:@"stderr.log"]; + + if (buttonIndex == 1) + { + // Email a Report + MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init]; + mailComposer.mailComposeDelegate = self; + [mailComposer setSubject:@"Error Report"]; + [mailComposer setToRecipients:[NSArray arrayWithObject:@"support@mycompany.com"]]; + // Attach log file + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, + NSUserDomainMask, YES); + NSString *documentsPath = [paths objectAtIndex:0]; + NSString *stderrPath = [documentsPath stringByAppendingPathComponent:@"stderr.log"]; + + NSData *data = [NSData dataWithContentsOfFile:stderrPath]; + + [mailComposer addAttachmentData:data mimeType:@"Text/XML" fileName:@"stderr.log"]; + UIDevice *device = [UIDevice currentDevice]; + NSString *emailBody = + [NSString stringWithFormat:@"My Model: %@\nMy OS: %@\nMy Version: %@", + [device model], [device systemName], [device systemVersion]]; + [mailComposer setMessageBody:emailBody isHTML:NO]; + [self.window.rootViewController presentViewController:mailComposer animated:YES + completion:nil]; + + } + + NSSetUncaughtExceptionHandler(&exceptionHandler); + + // Redirect stderr output stream to file + freopen([stderrPath cStringUsingEncoding:NSASCIIStringEncoding], "w", stderr); + +} +-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error +{ + [self.window.rootViewController dismissViewControllerAnimated:YES completion:nil]; +} + + + +@end diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Base.lproj/Main.storyboard b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Base.lproj/Main.storyboard new file mode 100644 index 0000000..16c134e --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Base.lproj/Main.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Images.xcassets/AppIcon.appiconset/Contents.json b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions-Info.plist b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions-Prefix.pch b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/Recipe 1-10 Handling Exceptions-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/ViewController.h b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/ViewController.h new file mode 100644 index 0000000..e95aa2d --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// Recipe 1-10 Handling Exceptions +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +- (IBAction)throwFakeException:(id)sender; + +@end diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/ViewController.m b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/ViewController.m new file mode 100644 index 0000000..7dbfa50 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/ViewController.m @@ -0,0 +1,37 @@ +// +// ViewController.m +// Recipe 1-10 Handling Exceptions +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)throwFakeException:(id)sender +{ + NSException *e = [[NSException alloc] initWithName:@"FakeException" + reason:@"The developer sucks!" + userInfo:[NSDictionary dictionaryWithObject:@"Extra info" + forKey:@"Key"]]; + [e raise]; +} +@end diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/main.m b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/main.m new file mode 100644 index 0000000..0b0030c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling Exceptions/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 1-10: Handling Exceptions +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/Recipe 1-10 Handling ExceptionsTests-Info.plist b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/Recipe 1-10 Handling ExceptionsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/Recipe 1-10 Handling ExceptionsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/Recipe_1_10__Handling_ExceptionsTests.m b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/Recipe_1_10__Handling_ExceptionsTests.m new file mode 100644 index 0000000..eebce26 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/Recipe_1_10__Handling_ExceptionsTests.m @@ -0,0 +1,36 @@ +// +// Recipe_1_10__Handling_ExceptionsTests.m +// Recipe 1-10: Handling ExceptionsTests +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_1_10__Handling_ExceptionsTests : XCTestCase + +@end + +@implementation Recipe_1_10__Handling_ExceptionsTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-10_ Handling Exceptions/Recipe 1-10_ Handling ExceptionsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/.DS_Store b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/.DS_Store new file mode 100644 index 0000000..0aaa9a3 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/.DS_Store differ diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version copy-Info.plist b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version copy-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version copy-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.pbxproj b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8479756 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.pbxproj @@ -0,0 +1,571 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 887F3C0C1780D53C006908AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0B1780D53C006908AE /* Foundation.framework */; }; + 887F3C0E1780D53C006908AE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0D1780D53C006908AE /* CoreGraphics.framework */; }; + 887F3C101780D53C006908AE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0F1780D53C006908AE /* UIKit.framework */; }; + 887F3C161780D53C006908AE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C141780D53C006908AE /* InfoPlist.strings */; }; + 887F3C181780D53C006908AE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C171780D53C006908AE /* main.m */; }; + 887F3C1C1780D53C006908AE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C1B1780D53C006908AE /* AppDelegate.m */; }; + 887F3C1F1780D53C006908AE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C1D1780D53C006908AE /* Main.storyboard */; }; + 887F3C221780D53C006908AE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C211780D53C006908AE /* ViewController.m */; }; + 887F3C241780D53C006908AE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C231780D53C006908AE /* Images.xcassets */; }; + 887F3C2B1780D53C006908AE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C2A1780D53C006908AE /* XCTest.framework */; }; + 887F3C2C1780D53C006908AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0B1780D53C006908AE /* Foundation.framework */; }; + 887F3C2D1780D53C006908AE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0F1780D53C006908AE /* UIKit.framework */; }; + 887F3C351780D53C006908AE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C331780D53C006908AE /* InfoPlist.strings */; }; + 887F3C371780D53C006908AE /* Recipe_1_11_Adding_A_Lite_VersionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C361780D53C006908AE /* Recipe_1_11_Adding_A_Lite_VersionTests.m */; }; + 887F3C421780D9F7006908AE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C211780D53C006908AE /* ViewController.m */; }; + 887F3C431780D9F7006908AE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C1B1780D53C006908AE /* AppDelegate.m */; }; + 887F3C441780D9F7006908AE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C171780D53C006908AE /* main.m */; }; + 887F3C461780D9F7006908AE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0D1780D53C006908AE /* CoreGraphics.framework */; }; + 887F3C471780D9F7006908AE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0F1780D53C006908AE /* UIKit.framework */; }; + 887F3C481780D9F7006908AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C0B1780D53C006908AE /* Foundation.framework */; }; + 887F3C4A1780D9F7006908AE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C231780D53C006908AE /* Images.xcassets */; }; + 887F3C4B1780D9F7006908AE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C141780D53C006908AE /* InfoPlist.strings */; }; + 887F3C4C1780D9F7006908AE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C1D1780D53C006908AE /* Main.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 887F3C2E1780D53C006908AE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 887F3C001780D53C006908AE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 887F3C071780D53C006908AE; + remoteInfo = "Recipe 1-11:Adding A Lite Version"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 887F3C081780D53C006908AE /* Recipe 1-11 Adding A Lite Version.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 1-11 Adding A Lite Version.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 887F3C0B1780D53C006908AE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 887F3C0D1780D53C006908AE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 887F3C0F1780D53C006908AE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 887F3C131780D53C006908AE /* Recipe 1-11 Adding A Lite Version-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-11 Adding A Lite Version-Info.plist"; sourceTree = ""; }; + 887F3C151780D53C006908AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 887F3C171780D53C006908AE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 887F3C191780D53C006908AE /* Recipe 1-11 Adding A Lite Version-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 1-11 Adding A Lite Version-Prefix.pch"; sourceTree = ""; }; + 887F3C1A1780D53C006908AE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 887F3C1B1780D53C006908AE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 887F3C1E1780D53C006908AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 887F3C201780D53C006908AE /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 887F3C211780D53C006908AE /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 887F3C231780D53C006908AE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 887F3C291780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 1-11 Adding A Lite VersionTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 887F3C2A1780D53C006908AE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 887F3C321780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-11 Adding A Lite VersionTests-Info.plist"; sourceTree = ""; }; + 887F3C341780D53C006908AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 887F3C361780D53C006908AE /* Recipe_1_11_Adding_A_Lite_VersionTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_1_11_Adding_A_Lite_VersionTests.m; sourceTree = ""; }; + 887F3C501780D9F7006908AE /* Recipe 1-11 Adding A Lite Version - Lite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 1-11 Adding A Lite Version - Lite.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 887F3C511780D9F8006908AE /* Recipe 1-11 Adding A Lite Version copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "Recipe 1-11 Adding A Lite Version copy-Info.plist"; path = "/Users/josephhoffman/Google Drive/iOS 7 Book/iOS 7 Book Chapter folders/CH1/Projects/Recipe 1-11:Adding A Lite Version/Recipe 1-11 Adding A Lite Version copy-Info.plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 887F3C051780D53C006908AE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C0E1780D53C006908AE /* CoreGraphics.framework in Frameworks */, + 887F3C101780D53C006908AE /* UIKit.framework in Frameworks */, + 887F3C0C1780D53C006908AE /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C261780D53C006908AE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C2B1780D53C006908AE /* XCTest.framework in Frameworks */, + 887F3C2D1780D53C006908AE /* UIKit.framework in Frameworks */, + 887F3C2C1780D53C006908AE /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C451780D9F7006908AE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C461780D9F7006908AE /* CoreGraphics.framework in Frameworks */, + 887F3C471780D9F7006908AE /* UIKit.framework in Frameworks */, + 887F3C481780D9F7006908AE /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 887F3BFF1780D53C006908AE = { + isa = PBXGroup; + children = ( + 887F3C111780D53C006908AE /* Recipe 1-11 Adding A Lite Version */, + 887F3C301780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests */, + 887F3C0A1780D53C006908AE /* Frameworks */, + 887F3C091780D53C006908AE /* Products */, + 887F3C511780D9F8006908AE /* Recipe 1-11 Adding A Lite Version copy-Info.plist */, + ); + sourceTree = ""; + }; + 887F3C091780D53C006908AE /* Products */ = { + isa = PBXGroup; + children = ( + 887F3C081780D53C006908AE /* Recipe 1-11 Adding A Lite Version.app */, + 887F3C291780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests.xctest */, + 887F3C501780D9F7006908AE /* Recipe 1-11 Adding A Lite Version - Lite.app */, + ); + name = Products; + sourceTree = ""; + }; + 887F3C0A1780D53C006908AE /* Frameworks */ = { + isa = PBXGroup; + children = ( + 887F3C0B1780D53C006908AE /* Foundation.framework */, + 887F3C0D1780D53C006908AE /* CoreGraphics.framework */, + 887F3C0F1780D53C006908AE /* UIKit.framework */, + 887F3C2A1780D53C006908AE /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 887F3C111780D53C006908AE /* Recipe 1-11 Adding A Lite Version */ = { + isa = PBXGroup; + children = ( + 887F3C1A1780D53C006908AE /* AppDelegate.h */, + 887F3C1B1780D53C006908AE /* AppDelegate.m */, + 887F3C1D1780D53C006908AE /* Main.storyboard */, + 887F3C201780D53C006908AE /* ViewController.h */, + 887F3C211780D53C006908AE /* ViewController.m */, + 887F3C231780D53C006908AE /* Images.xcassets */, + 887F3C121780D53C006908AE /* Supporting Files */, + ); + name = "Recipe 1-11 Adding A Lite Version"; + path = "Recipe 1-11:Adding A Lite Version"; + sourceTree = ""; + }; + 887F3C121780D53C006908AE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 887F3C131780D53C006908AE /* Recipe 1-11 Adding A Lite Version-Info.plist */, + 887F3C141780D53C006908AE /* InfoPlist.strings */, + 887F3C171780D53C006908AE /* main.m */, + 887F3C191780D53C006908AE /* Recipe 1-11 Adding A Lite Version-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 887F3C301780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests */ = { + isa = PBXGroup; + children = ( + 887F3C361780D53C006908AE /* Recipe_1_11_Adding_A_Lite_VersionTests.m */, + 887F3C311780D53C006908AE /* Supporting Files */, + ); + name = "Recipe 1-11 Adding A Lite VersionTests"; + path = "Recipe 1-11:Adding A Lite VersionTests"; + sourceTree = ""; + }; + 887F3C311780D53C006908AE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 887F3C321780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests-Info.plist */, + 887F3C331780D53C006908AE /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 887F3C071780D53C006908AE /* Recipe 1-11 Adding A Lite Version */ = { + isa = PBXNativeTarget; + buildConfigurationList = 887F3C3A1780D53C006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-11 Adding A Lite Version" */; + buildPhases = ( + 887F3C041780D53C006908AE /* Sources */, + 887F3C051780D53C006908AE /* Frameworks */, + 887F3C061780D53C006908AE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 1-11 Adding A Lite Version"; + productName = "Recipe 1-11:Adding A Lite Version"; + productReference = 887F3C081780D53C006908AE /* Recipe 1-11 Adding A Lite Version.app */; + productType = "com.apple.product-type.application"; + }; + 887F3C281780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 887F3C3D1780D53C006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-11 Adding A Lite VersionTests" */; + buildPhases = ( + 887F3C251780D53C006908AE /* Sources */, + 887F3C261780D53C006908AE /* Frameworks */, + 887F3C271780D53C006908AE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 887F3C2F1780D53C006908AE /* PBXTargetDependency */, + ); + name = "Recipe 1-11 Adding A Lite VersionTests"; + productName = "Recipe 1-11:Adding A Lite VersionTests"; + productReference = 887F3C291780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 887F3C401780D9F7006908AE /* Recipe 1-11 Adding A Lite Version - Lite */ = { + isa = PBXNativeTarget; + buildConfigurationList = 887F3C4D1780D9F7006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-11 Adding A Lite Version - Lite" */; + buildPhases = ( + 887F3C411780D9F7006908AE /* Sources */, + 887F3C451780D9F7006908AE /* Frameworks */, + 887F3C491780D9F7006908AE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 1-11 Adding A Lite Version - Lite"; + productName = "Recipe 1-11:Adding A Lite Version"; + productReference = 887F3C501780D9F7006908AE /* Recipe 1-11 Adding A Lite Version - Lite.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 887F3C001780D53C006908AE /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 887F3C281780D53C006908AE = { + TestTargetID = 887F3C071780D53C006908AE; + }; + }; + }; + buildConfigurationList = 887F3C031780D53C006908AE /* Build configuration list for PBXProject "Recipe 1-11 Adding A Lite Version" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 887F3BFF1780D53C006908AE; + productRefGroup = 887F3C091780D53C006908AE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 887F3C071780D53C006908AE /* Recipe 1-11 Adding A Lite Version */, + 887F3C281780D53C006908AE /* Recipe 1-11 Adding A Lite VersionTests */, + 887F3C401780D9F7006908AE /* Recipe 1-11 Adding A Lite Version - Lite */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 887F3C061780D53C006908AE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C241780D53C006908AE /* Images.xcassets in Resources */, + 887F3C161780D53C006908AE /* InfoPlist.strings in Resources */, + 887F3C1F1780D53C006908AE /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C271780D53C006908AE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C351780D53C006908AE /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C491780D9F7006908AE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C4A1780D9F7006908AE /* Images.xcassets in Resources */, + 887F3C4B1780D9F7006908AE /* InfoPlist.strings in Resources */, + 887F3C4C1780D9F7006908AE /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 887F3C041780D53C006908AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C221780D53C006908AE /* ViewController.m in Sources */, + 887F3C1C1780D53C006908AE /* AppDelegate.m in Sources */, + 887F3C181780D53C006908AE /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C251780D53C006908AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C371780D53C006908AE /* Recipe_1_11_Adding_A_Lite_VersionTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C411780D9F7006908AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C421780D9F7006908AE /* ViewController.m in Sources */, + 887F3C431780D9F7006908AE /* AppDelegate.m in Sources */, + 887F3C441780D9F7006908AE /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 887F3C2F1780D53C006908AE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 887F3C071780D53C006908AE /* Recipe 1-11 Adding A Lite Version */; + targetProxy = 887F3C2E1780D53C006908AE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 887F3C141780D53C006908AE /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 887F3C151780D53C006908AE /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 887F3C1D1780D53C006908AE /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 887F3C1E1780D53C006908AE /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 887F3C331780D53C006908AE /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 887F3C341780D53C006908AE /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 887F3C381780D53C006908AE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 887F3C391780D53C006908AE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 887F3C3B1780D53C006908AE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-11:Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-11:Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Info.plist"; + PRODUCT_NAME = "Recipe 1-11 Adding A Lite Version"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 887F3C3C1780D53C006908AE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-11:Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-11:Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Info.plist"; + PRODUCT_NAME = "Recipe 1-11 Adding A Lite Version"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 887F3C3E1780D53C006908AE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-11:Adding A Lite Version.app/Recipe 1-11:Adding A Lite Version"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-11:Adding A Lite Version/Recipe 1-11:Adding A Lite Version-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 1-11:Adding A Lite VersionTests/Recipe 1-11 Adding A Lite VersionTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-11 Adding A Lite VersionTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 887F3C3F1780D53C006908AE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-11:Adding A Lite Version.app/Recipe 1-11:Adding A Lite Version"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-11:Adding A Lite Version/Recipe 1-11:Adding A Lite Version-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-11:Adding A Lite VersionTests/Recipe 1-11 Adding A Lite VersionTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-11 Adding A Lite VersionTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; + 887F3C4E1780D9F7006908AE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-11:Adding A Lite Version/Recipe 1-11:Adding A Lite Version-Prefix.pch"; + "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = LITE_VERSION; + INFOPLIST_FILE = "Recipe 1-11:Adding A Lite Version copy-Info.plist"; + PRODUCT_NAME = "Recipe 1-11 Adding A Lite Version - Lite"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 887F3C4F1780D9F7006908AE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-11:Adding A Lite Version/Recipe 1-11:Adding A Lite Version-Prefix.pch"; + "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = LITE_VERSION; + INFOPLIST_FILE = "Recipe 1-11:Adding A Lite Version copy-Info.plist"; + PRODUCT_NAME = "Recipe 1-11 Adding A Lite Version - Lite"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 887F3C031780D53C006908AE /* Build configuration list for PBXProject "Recipe 1-11 Adding A Lite Version" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 887F3C381780D53C006908AE /* Debug */, + 887F3C391780D53C006908AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 887F3C3A1780D53C006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-11 Adding A Lite Version" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 887F3C3B1780D53C006908AE /* Debug */, + 887F3C3C1780D53C006908AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 887F3C3D1780D53C006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-11 Adding A Lite VersionTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 887F3C3E1780D53C006908AE /* Debug */, + 887F3C3F1780D53C006908AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 887F3C4D1780D9F7006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-11 Adding A Lite Version - Lite" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 887F3C4E1780D9F7006908AE /* Debug */, + 887F3C4F1780D9F7006908AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 887F3C001780D53C006908AE /* Project object */; +} diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..19cdd56 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..30d1819 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-11_Adding A Lite Version copy.xcscheme b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-11_Adding A Lite Version copy.xcscheme new file mode 100644 index 0000000..becb639 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-11_Adding A Lite Version copy.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-11_Adding A Lite Version.xcscheme b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-11_Adding A Lite Version.xcscheme new file mode 100644 index 0000000..e95e4b9 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-11_Adding A Lite Version.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..5be6a8e --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,37 @@ + + + + + SchemeUserState + + Recipe 1-11:Adding A Lite Version copy.xcscheme + + orderHint + 1 + + Recipe 1-11:Adding A Lite Version.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 887F3C071780D53C006908AE + + primary + + + 887F3C281780D53C006908AE + + primary + + + 887F3C401780D9F7006908AE + + primary + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/AppDelegate.h b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/AppDelegate.h new file mode 100644 index 0000000..d2de2f2 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 1-11 Adding A Lite Version +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/AppDelegate.m b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/AppDelegate.m new file mode 100644 index 0000000..2653920 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 1-11 Adding A Lite Version +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Base.lproj/Main.storyboard b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b99208b --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/AppIcon.appiconset/Contents.json b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/LaunchImage-1.launchimage/Contents.json b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/LaunchImage-1.launchimage/Contents.json new file mode 100644 index 0000000..82fb390 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/LaunchImage-1.launchimage/Contents.json @@ -0,0 +1,118 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..abb689e --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,42 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Info.plist b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Prefix.pch b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/Recipe 1-11 Adding A Lite Version-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/ViewController.h b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/ViewController.h new file mode 100644 index 0000000..163dc03 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 1-11 Adding A Lite Version +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/ViewController.m b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/ViewController.m new file mode 100644 index 0000000..621632d --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/ViewController.m @@ -0,0 +1,35 @@ +// +// ViewController.m +// Recipe 1-11 Adding A Lite Version +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + +#ifdef LITE_VERSION + + NSLog(@"This Is the Lite Version"); + +#endif +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/main.m b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/main.m new file mode 100644 index 0000000..5612bf5 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite Version/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 1-11:Adding A Lite Version +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/Recipe 1-11 Adding A Lite VersionTests-Info.plist b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/Recipe 1-11 Adding A Lite VersionTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/Recipe 1-11 Adding A Lite VersionTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/Recipe_1_11_Adding_A_Lite_VersionTests.m b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/Recipe_1_11_Adding_A_Lite_VersionTests.m new file mode 100644 index 0000000..c27a56e --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/Recipe_1_11_Adding_A_Lite_VersionTests.m @@ -0,0 +1,36 @@ +// +// Recipe_1_11_Adding_A_Lite_VersionTests.m +// Recipe 1-11:Adding A Lite VersionTests +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_1_11_Adding_A_Lite_VersionTests : XCTestCase + +@end + +@implementation Recipe_1_11_Adding_A_Lite_VersionTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-11_Adding A Lite Version/Recipe 1-11_Adding A Lite VersionTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/.DS_Store b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/.DS_Store new file mode 100644 index 0000000..7aea0e0 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/.DS_Store differ diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.pbxproj b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.pbxproj new file mode 100644 index 0000000..15cbec0 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 887F3C5F1780F651006908AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C5E1780F651006908AE /* Foundation.framework */; }; + 887F3C611780F651006908AE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C601780F651006908AE /* CoreGraphics.framework */; }; + 887F3C631780F651006908AE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C621780F651006908AE /* UIKit.framework */; }; + 887F3C691780F651006908AE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C671780F651006908AE /* InfoPlist.strings */; }; + 887F3C6B1780F651006908AE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C6A1780F651006908AE /* main.m */; }; + 887F3C6F1780F651006908AE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C6E1780F651006908AE /* AppDelegate.m */; }; + 887F3C721780F651006908AE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C701780F651006908AE /* Main.storyboard */; }; + 887F3C751780F651006908AE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C741780F651006908AE /* ViewController.m */; }; + 887F3C771780F651006908AE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C761780F651006908AE /* Images.xcassets */; }; + 887F3C7E1780F651006908AE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C7D1780F651006908AE /* XCTest.framework */; }; + 887F3C7F1780F651006908AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C5E1780F651006908AE /* Foundation.framework */; }; + 887F3C801780F651006908AE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887F3C621780F651006908AE /* UIKit.framework */; }; + 887F3C881780F651006908AE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 887F3C861780F651006908AE /* InfoPlist.strings */; }; + 887F3C8A1780F651006908AE /* Recipe_1_12__Launch_ImagesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 887F3C891780F651006908AE /* Recipe_1_12__Launch_ImagesTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 887F3C811780F651006908AE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 887F3C531780F650006908AE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 887F3C5A1780F651006908AE; + remoteInfo = "Recipe 1-12: Launch Images"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 887F3C5B1780F651006908AE /* Recipe 1-12 Launch Images.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 1-12 Launch Images.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 887F3C5E1780F651006908AE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 887F3C601780F651006908AE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 887F3C621780F651006908AE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 887F3C661780F651006908AE /* Recipe 1-12 Launch Images-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-12 Launch Images-Info.plist"; sourceTree = ""; }; + 887F3C681780F651006908AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 887F3C6A1780F651006908AE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 887F3C6C1780F651006908AE /* Recipe 1-12 Launch Images-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 1-12 Launch Images-Prefix.pch"; sourceTree = ""; }; + 887F3C6D1780F651006908AE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 887F3C6E1780F651006908AE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 887F3C711780F651006908AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 887F3C731780F651006908AE /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 887F3C741780F651006908AE /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 887F3C761780F651006908AE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 887F3C7C1780F651006908AE /* Recipe 1-12 Launch ImagesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 1-12 Launch ImagesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 887F3C7D1780F651006908AE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 887F3C851780F651006908AE /* Recipe 1-12 Launch ImagesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-12 Launch ImagesTests-Info.plist"; sourceTree = ""; }; + 887F3C871780F651006908AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 887F3C891780F651006908AE /* Recipe_1_12__Launch_ImagesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_1_12__Launch_ImagesTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 887F3C581780F651006908AE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C611780F651006908AE /* CoreGraphics.framework in Frameworks */, + 887F3C631780F651006908AE /* UIKit.framework in Frameworks */, + 887F3C5F1780F651006908AE /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C791780F651006908AE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C7E1780F651006908AE /* XCTest.framework in Frameworks */, + 887F3C801780F651006908AE /* UIKit.framework in Frameworks */, + 887F3C7F1780F651006908AE /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 887F3C521780F650006908AE = { + isa = PBXGroup; + children = ( + 887F3C641780F651006908AE /* Recipe 1-12 Launch Images */, + 887F3C831780F651006908AE /* Recipe 1-12 Launch ImagesTests */, + 887F3C5D1780F651006908AE /* Frameworks */, + 887F3C5C1780F651006908AE /* Products */, + ); + sourceTree = ""; + }; + 887F3C5C1780F651006908AE /* Products */ = { + isa = PBXGroup; + children = ( + 887F3C5B1780F651006908AE /* Recipe 1-12 Launch Images.app */, + 887F3C7C1780F651006908AE /* Recipe 1-12 Launch ImagesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 887F3C5D1780F651006908AE /* Frameworks */ = { + isa = PBXGroup; + children = ( + 887F3C5E1780F651006908AE /* Foundation.framework */, + 887F3C601780F651006908AE /* CoreGraphics.framework */, + 887F3C621780F651006908AE /* UIKit.framework */, + 887F3C7D1780F651006908AE /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 887F3C641780F651006908AE /* Recipe 1-12 Launch Images */ = { + isa = PBXGroup; + children = ( + 887F3C6D1780F651006908AE /* AppDelegate.h */, + 887F3C6E1780F651006908AE /* AppDelegate.m */, + 887F3C701780F651006908AE /* Main.storyboard */, + 887F3C731780F651006908AE /* ViewController.h */, + 887F3C741780F651006908AE /* ViewController.m */, + 887F3C761780F651006908AE /* Images.xcassets */, + 887F3C651780F651006908AE /* Supporting Files */, + ); + name = "Recipe 1-12 Launch Images"; + path = "Recipe 1-12: Launch Images"; + sourceTree = ""; + }; + 887F3C651780F651006908AE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 887F3C661780F651006908AE /* Recipe 1-12 Launch Images-Info.plist */, + 887F3C671780F651006908AE /* InfoPlist.strings */, + 887F3C6A1780F651006908AE /* main.m */, + 887F3C6C1780F651006908AE /* Recipe 1-12 Launch Images-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 887F3C831780F651006908AE /* Recipe 1-12 Launch ImagesTests */ = { + isa = PBXGroup; + children = ( + 887F3C891780F651006908AE /* Recipe_1_12__Launch_ImagesTests.m */, + 887F3C841780F651006908AE /* Supporting Files */, + ); + name = "Recipe 1-12 Launch ImagesTests"; + path = "Recipe 1-12: Launch ImagesTests"; + sourceTree = ""; + }; + 887F3C841780F651006908AE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 887F3C851780F651006908AE /* Recipe 1-12 Launch ImagesTests-Info.plist */, + 887F3C861780F651006908AE /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 887F3C5A1780F651006908AE /* Recipe 1-12 Launch Images */ = { + isa = PBXNativeTarget; + buildConfigurationList = 887F3C8D1780F651006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-12 Launch Images" */; + buildPhases = ( + 887F3C571780F651006908AE /* Sources */, + 887F3C581780F651006908AE /* Frameworks */, + 887F3C591780F651006908AE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 1-12 Launch Images"; + productName = "Recipe 1-12: Launch Images"; + productReference = 887F3C5B1780F651006908AE /* Recipe 1-12 Launch Images.app */; + productType = "com.apple.product-type.application"; + }; + 887F3C7B1780F651006908AE /* Recipe 1-12 Launch ImagesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 887F3C901780F651006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-12 Launch ImagesTests" */; + buildPhases = ( + 887F3C781780F651006908AE /* Sources */, + 887F3C791780F651006908AE /* Frameworks */, + 887F3C7A1780F651006908AE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 887F3C821780F651006908AE /* PBXTargetDependency */, + ); + name = "Recipe 1-12 Launch ImagesTests"; + productName = "Recipe 1-12: Launch ImagesTests"; + productReference = 887F3C7C1780F651006908AE /* Recipe 1-12 Launch ImagesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 887F3C531780F650006908AE /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 887F3C7B1780F651006908AE = { + TestTargetID = 887F3C5A1780F651006908AE; + }; + }; + }; + buildConfigurationList = 887F3C561780F650006908AE /* Build configuration list for PBXProject "Recipe 1-12 Launch Images" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 887F3C521780F650006908AE; + productRefGroup = 887F3C5C1780F651006908AE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 887F3C5A1780F651006908AE /* Recipe 1-12 Launch Images */, + 887F3C7B1780F651006908AE /* Recipe 1-12 Launch ImagesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 887F3C591780F651006908AE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C771780F651006908AE /* Images.xcassets in Resources */, + 887F3C691780F651006908AE /* InfoPlist.strings in Resources */, + 887F3C721780F651006908AE /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C7A1780F651006908AE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C881780F651006908AE /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 887F3C571780F651006908AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C751780F651006908AE /* ViewController.m in Sources */, + 887F3C6F1780F651006908AE /* AppDelegate.m in Sources */, + 887F3C6B1780F651006908AE /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 887F3C781780F651006908AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 887F3C8A1780F651006908AE /* Recipe_1_12__Launch_ImagesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 887F3C821780F651006908AE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 887F3C5A1780F651006908AE /* Recipe 1-12 Launch Images */; + targetProxy = 887F3C811780F651006908AE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 887F3C671780F651006908AE /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 887F3C681780F651006908AE /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 887F3C701780F651006908AE /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 887F3C711780F651006908AE /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 887F3C861780F651006908AE /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 887F3C871780F651006908AE /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 887F3C8B1780F651006908AE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 887F3C8C1780F651006908AE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 887F3C8E1780F651006908AE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-12: Launch Images/Recipe 1-12 Launch Images-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-12: Launch Images/Recipe 1-12 Launch Images-Info.plist"; + PRODUCT_NAME = "Recipe 1-12 Launch Images"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 887F3C8F1780F651006908AE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-12: Launch Images/Recipe 1-12 Launch Images-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-12: Launch Images/Recipe 1-12 Launch Images-Info.plist"; + PRODUCT_NAME = "Recipe 1-12 Launch Images"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 887F3C911780F651006908AE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-12: Launch Images.app/Recipe 1-12: Launch Images"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-12: Launch Images/Recipe 1-12: Launch Images-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 1-12: Launch ImagesTests/Recipe 1-12 Launch ImagesTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-12 Launch ImagesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 887F3C921780F651006908AE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-12: Launch Images.app/Recipe 1-12: Launch Images"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-12: Launch Images/Recipe 1-12: Launch Images-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-12: Launch ImagesTests/Recipe 1-12 Launch ImagesTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-12 Launch ImagesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 887F3C561780F650006908AE /* Build configuration list for PBXProject "Recipe 1-12 Launch Images" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 887F3C8B1780F651006908AE /* Debug */, + 887F3C8C1780F651006908AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 887F3C8D1780F651006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-12 Launch Images" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 887F3C8E1780F651006908AE /* Debug */, + 887F3C8F1780F651006908AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 887F3C901780F651006908AE /* Build configuration list for PBXNativeTarget "Recipe 1-12 Launch ImagesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 887F3C911780F651006908AE /* Debug */, + 887F3C921780F651006908AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 887F3C531780F650006908AE /* Project object */; +} diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6a6f491 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..d46d637 Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-12_ Launch Images.xcscheme b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-12_ Launch Images.xcscheme new file mode 100644 index 0000000..36cb3d4 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 1-12_ Launch Images.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f7ad3f7 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 1-12: Launch Images.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 887F3C5A1780F651006908AE + + primary + + + 887F3C7B1780F651006908AE + + primary + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/AppDelegate.h b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/AppDelegate.h new file mode 100644 index 0000000..02f55fb --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 1-12 Launch Images +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/AppDelegate.m b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/AppDelegate.m new file mode 100644 index 0000000..2dfa097 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 1-12 Launch Images +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Base.lproj/Main.storyboard b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Base.lproj/Main.storyboard new file mode 100644 index 0000000..a87b990 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Base.lproj/Main.storyboard @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/AppIcon.appiconset/Contents.json b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage-1.launchimage/Contents.json b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage-1.launchimage/Contents.json new file mode 100644 index 0000000..82fb390 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage-1.launchimage/Contents.json @@ -0,0 +1,118 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..cff5cac --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "filename" : "tater.png", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage.launchimage/tater.png b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage.launchimage/tater.png new file mode 100644 index 0000000..498d83c Binary files /dev/null and b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Images.xcassets/LaunchImage.launchimage/tater.png differ diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images-Info.plist b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images-Prefix.pch b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/Recipe 1-12 Launch Images-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/ViewController.h b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/ViewController.h new file mode 100644 index 0000000..b003f64 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 1-12 Launch Images +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/ViewController.m b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/ViewController.m new file mode 100644 index 0000000..91c9367 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 1-12 Launch Images +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/main.m b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/main.m new file mode 100644 index 0000000..9107b0c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch Images/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 1-12: Launch Images +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/Recipe 1-12 Launch ImagesTests-Info.plist b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/Recipe 1-12 Launch ImagesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/Recipe 1-12 Launch ImagesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/Recipe_1_12__Launch_ImagesTests.m b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/Recipe_1_12__Launch_ImagesTests.m new file mode 100644 index 0000000..a40e9d9 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/Recipe_1_12__Launch_ImagesTests.m @@ -0,0 +1,36 @@ +// +// Recipe_1_12__Launch_ImagesTests.m +// Recipe 1-12: Launch ImagesTests +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_1_12__Launch_ImagesTests : XCTestCase + +@end + +@implementation Recipe_1_12__Launch_ImagesTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-12_ Launch Images/Recipe 1-12_ Launch ImagesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling.xcodeproj/project.pbxproj b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling.xcodeproj/project.pbxproj new file mode 100644 index 0000000..52a6058 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF359C177BEA1A009D869F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF359B177BEA1A009D869F /* Foundation.framework */; }; + 88CF359E177BEA1A009D869F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF359D177BEA1A009D869F /* CoreGraphics.framework */; }; + 88CF35A0177BEA1A009D869F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF359F177BEA1A009D869F /* UIKit.framework */; }; + 88CF35A6177BEA1A009D869F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF35A4177BEA1A009D869F /* InfoPlist.strings */; }; + 88CF35A8177BEA1A009D869F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35A7177BEA1A009D869F /* main.m */; }; + 88CF35AC177BEA1A009D869F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35AB177BEA1A009D869F /* AppDelegate.m */; }; + 88CF35AF177BEA1A009D869F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CF35AD177BEA1A009D869F /* Main.storyboard */; }; + 88CF35B2177BEA1A009D869F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35B1177BEA1A009D869F /* ViewController.m */; }; + 88CF35B4177BEA1A009D869F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CF35B3177BEA1A009D869F /* Images.xcassets */; }; + 88CF35BB177BEA1A009D869F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF35BA177BEA1A009D869F /* XCTest.framework */; }; + 88CF35BC177BEA1A009D869F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF359B177BEA1A009D869F /* Foundation.framework */; }; + 88CF35BD177BEA1A009D869F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF359F177BEA1A009D869F /* UIKit.framework */; }; + 88CF35C5177BEA1A009D869F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF35C3177BEA1A009D869F /* InfoPlist.strings */; }; + 88CF35C7177BEA1A009D869F /* Recipe_1_9___Default_Error_HandlingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35C6177BEA1A009D869F /* Recipe_1_9___Default_Error_HandlingTests.m */; }; + 88CF35D2177BEC97009D869F /* ErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35D1177BEC97009D869F /* ErrorHandler.m */; }; + 88CF35D3177BEC97009D869F /* ErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF35D1177BEC97009D869F /* ErrorHandler.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF35BE177BEA1A009D869F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF3590177BEA19009D869F /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF3597177BEA19009D869F; + remoteInfo = "Recipe 1-9 : Default Error Handling"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF3598177BEA1A009D869F /* Recipe 1-9 Default Error Handling.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 1-9 Default Error Handling.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF359B177BEA1A009D869F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF359D177BEA1A009D869F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF359F177BEA1A009D869F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF35A3177BEA1A009D869F /* Recipe 1-9 Default Error Handling-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-9 Default Error Handling-Info.plist"; sourceTree = ""; }; + 88CF35A5177BEA1A009D869F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF35A7177BEA1A009D869F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF35A9177BEA1A009D869F /* Recipe 1-9 Default Error Handling-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 1-9 Default Error Handling-Prefix.pch"; sourceTree = ""; }; + 88CF35AA177BEA1A009D869F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CF35AB177BEA1A009D869F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CF35AE177BEA1A009D869F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CF35B0177BEA1A009D869F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CF35B1177BEA1A009D869F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CF35B3177BEA1A009D869F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CF35B9177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 1-9 Default Error HandlingTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF35BA177BEA1A009D869F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF35C2177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 1-9 Default Error HandlingTests-Info.plist"; sourceTree = ""; }; + 88CF35C4177BEA1A009D869F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF35C6177BEA1A009D869F /* Recipe_1_9___Default_Error_HandlingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Recipe_1_9___Default_Error_HandlingTests.m"; sourceTree = ""; }; + 88CF35D0177BEC97009D869F /* ErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorHandler.h; sourceTree = ""; }; + 88CF35D1177BEC97009D869F /* ErrorHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ErrorHandler.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF3595177BEA19009D869F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF359E177BEA1A009D869F /* CoreGraphics.framework in Frameworks */, + 88CF35A0177BEA1A009D869F /* UIKit.framework in Frameworks */, + 88CF359C177BEA1A009D869F /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF35B6177BEA1A009D869F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35BB177BEA1A009D869F /* XCTest.framework in Frameworks */, + 88CF35BD177BEA1A009D869F /* UIKit.framework in Frameworks */, + 88CF35BC177BEA1A009D869F /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF358F177BEA19009D869F = { + isa = PBXGroup; + children = ( + 88CF35A1177BEA1A009D869F /* Recipe 1-9 Default Error Handling */, + 88CF35C0177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests */, + 88CF359A177BEA1A009D869F /* Frameworks */, + 88CF3599177BEA1A009D869F /* Products */, + ); + sourceTree = ""; + }; + 88CF3599177BEA1A009D869F /* Products */ = { + isa = PBXGroup; + children = ( + 88CF3598177BEA1A009D869F /* Recipe 1-9 Default Error Handling.app */, + 88CF35B9177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF359A177BEA1A009D869F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CF359B177BEA1A009D869F /* Foundation.framework */, + 88CF359D177BEA1A009D869F /* CoreGraphics.framework */, + 88CF359F177BEA1A009D869F /* UIKit.framework */, + 88CF35BA177BEA1A009D869F /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF35A1177BEA1A009D869F /* Recipe 1-9 Default Error Handling */ = { + isa = PBXGroup; + children = ( + 88CF35AA177BEA1A009D869F /* AppDelegate.h */, + 88CF35AB177BEA1A009D869F /* AppDelegate.m */, + 88CF35AD177BEA1A009D869F /* Main.storyboard */, + 88CF35B0177BEA1A009D869F /* ViewController.h */, + 88CF35B1177BEA1A009D869F /* ViewController.m */, + 88CF35D0177BEC97009D869F /* ErrorHandler.h */, + 88CF35D1177BEC97009D869F /* ErrorHandler.m */, + 88CF35B3177BEA1A009D869F /* Images.xcassets */, + 88CF35A2177BEA1A009D869F /* Supporting Files */, + ); + name = "Recipe 1-9 Default Error Handling"; + path = "Recipe 1-9 : Default Error Handling"; + sourceTree = ""; + }; + 88CF35A2177BEA1A009D869F /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF35A3177BEA1A009D869F /* Recipe 1-9 Default Error Handling-Info.plist */, + 88CF35A4177BEA1A009D869F /* InfoPlist.strings */, + 88CF35A7177BEA1A009D869F /* main.m */, + 88CF35A9177BEA1A009D869F /* Recipe 1-9 Default Error Handling-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF35C0177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests */ = { + isa = PBXGroup; + children = ( + 88CF35C6177BEA1A009D869F /* Recipe_1_9___Default_Error_HandlingTests.m */, + 88CF35C1177BEA1A009D869F /* Supporting Files */, + ); + name = "Recipe 1-9 Default Error HandlingTests"; + path = "Recipe 1-9 : Default Error HandlingTests"; + sourceTree = ""; + }; + 88CF35C1177BEA1A009D869F /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF35C2177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests-Info.plist */, + 88CF35C3177BEA1A009D869F /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF3597177BEA19009D869F /* Recipe 1-9 Default Error Handling */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF35CA177BEA1A009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-9 Default Error Handling" */; + buildPhases = ( + 88CF3594177BEA19009D869F /* Sources */, + 88CF3595177BEA19009D869F /* Frameworks */, + 88CF3596177BEA19009D869F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 1-9 Default Error Handling"; + productName = "Recipe 1-9 : Default Error Handling"; + productReference = 88CF3598177BEA1A009D869F /* Recipe 1-9 Default Error Handling.app */; + productType = "com.apple.product-type.application"; + }; + 88CF35B8177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF35CD177BEA1A009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-9 Default Error HandlingTests" */; + buildPhases = ( + 88CF35B5177BEA1A009D869F /* Sources */, + 88CF35B6177BEA1A009D869F /* Frameworks */, + 88CF35B7177BEA1A009D869F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF35BF177BEA1A009D869F /* PBXTargetDependency */, + ); + name = "Recipe 1-9 Default Error HandlingTests"; + productName = "Recipe 1-9 : Default Error HandlingTests"; + productReference = 88CF35B9177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF3590177BEA19009D869F /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF35B8177BEA1A009D869F = { + TestTargetID = 88CF3597177BEA19009D869F; + }; + }; + }; + buildConfigurationList = 88CF3593177BEA19009D869F /* Build configuration list for PBXProject "Recipe 1-9 Default Error Handling" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CF358F177BEA19009D869F; + productRefGroup = 88CF3599177BEA1A009D869F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF3597177BEA19009D869F /* Recipe 1-9 Default Error Handling */, + 88CF35B8177BEA1A009D869F /* Recipe 1-9 Default Error HandlingTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF3596177BEA19009D869F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35B4177BEA1A009D869F /* Images.xcassets in Resources */, + 88CF35A6177BEA1A009D869F /* InfoPlist.strings in Resources */, + 88CF35AF177BEA1A009D869F /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF35B7177BEA1A009D869F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35C5177BEA1A009D869F /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF3594177BEA19009D869F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35B2177BEA1A009D869F /* ViewController.m in Sources */, + 88CF35D2177BEC97009D869F /* ErrorHandler.m in Sources */, + 88CF35AC177BEA1A009D869F /* AppDelegate.m in Sources */, + 88CF35A8177BEA1A009D869F /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF35B5177BEA1A009D869F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF35C7177BEA1A009D869F /* Recipe_1_9___Default_Error_HandlingTests.m in Sources */, + 88CF35D3177BEC97009D869F /* ErrorHandler.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF35BF177BEA1A009D869F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF3597177BEA19009D869F /* Recipe 1-9 Default Error Handling */; + targetProxy = 88CF35BE177BEA1A009D869F /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF35A4177BEA1A009D869F /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF35A5177BEA1A009D869F /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF35AD177BEA1A009D869F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CF35AE177BEA1A009D869F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CF35C3177BEA1A009D869F /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF35C4177BEA1A009D869F /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF35C8177BEA1A009D869F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF35C9177BEA1A009D869F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF35CB177BEA1A009D869F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-9 : Default Error Handling/Recipe 1-9 Default Error Handling-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-9 : Default Error Handling/Recipe 1-9 Default Error Handling-Info.plist"; + PRODUCT_NAME = "Recipe 1-9 Default Error Handling"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF35CC177BEA1A009D869F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-9 : Default Error Handling/Recipe 1-9 Default Error Handling-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-9 : Default Error Handling/Recipe 1-9 Default Error Handling-Info.plist"; + PRODUCT_NAME = "Recipe 1-9 Default Error Handling"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF35CE177BEA1A009D869F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-9 : Default Error Handling.app/Recipe 1-9 : Default Error Handling"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-9 : Default Error Handling/Recipe 1-9 : Default Error Handling-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 1-9 : Default Error HandlingTests/Recipe 1-9 Default Error HandlingTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-9 Default Error HandlingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF35CF177BEA1A009D869F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 1-9 : Default Error Handling.app/Recipe 1-9 : Default Error Handling"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 1-9 : Default Error Handling/Recipe 1-9 : Default Error Handling-Prefix.pch"; + INFOPLIST_FILE = "Recipe 1-9 : Default Error HandlingTests/Recipe 1-9 Default Error HandlingTests-Info.plist"; + PRODUCT_NAME = "Recipe 1-9 Default Error HandlingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF3593177BEA19009D869F /* Build configuration list for PBXProject "Recipe 1-9 Default Error Handling" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF35C8177BEA1A009D869F /* Debug */, + 88CF35C9177BEA1A009D869F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF35CA177BEA1A009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-9 Default Error Handling" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF35CB177BEA1A009D869F /* Debug */, + 88CF35CC177BEA1A009D869F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF35CD177BEA1A009D869F /* Build configuration list for PBXNativeTarget "Recipe 1-9 Default Error HandlingTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF35CE177BEA1A009D869F /* Debug */, + 88CF35CF177BEA1A009D869F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF3590177BEA19009D869F /* Project object */; +} diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..47ac27b --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/AppDelegate.h b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/AppDelegate.h new file mode 100644 index 0000000..0ac2a68 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 1-9 Default Error Handling +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/AppDelegate.m b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/AppDelegate.m new file mode 100644 index 0000000..6c13531 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 1-9 Default Error Handling +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Base.lproj/Main.storyboard b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Base.lproj/Main.storyboard new file mode 100644 index 0000000..5ea9d88 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Base.lproj/Main.storyboard @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ErrorHandler.h b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ErrorHandler.h new file mode 100644 index 0000000..dd57555 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ErrorHandler.h @@ -0,0 +1,21 @@ +// +// ErrorHandler.h +// Recipe 1-9 Default Error Handling +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ErrorHandler : NSObject + +@property (strong, nonatomic)NSError *error; +@property (nonatomic)BOOL fatalError; + +-(id)initWithError:(NSError *)error fatal:(BOOL)fatalError; + ++(void)handleError:(NSError *)error fatal:(BOOL)fatalError; + + +@end diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ErrorHandler.m b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ErrorHandler.m new file mode 100644 index 0000000..a57d0c1 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ErrorHandler.m @@ -0,0 +1,97 @@ +// +// ErrorHandler.m +// Recipe 1-9 Default Error Handling +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ErrorHandler.h" + + +@implementation ErrorHandler + +static NSMutableArray *retainedDelegates = nil; + +-(id)initWithError:(NSError *)error fatal:(BOOL)fatalError +{ + self = [super init]; + if (self) { + self.error = error; + self.fatalError = fatalError; + } + return self; +} + +-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex != [alertView cancelButtonIndex]) + { + NSString *buttonTitle = [alertView buttonTitleAtIndex:buttonIndex]; + NSInteger recoveryIndex = [[self.error localizedRecoveryOptions] + indexOfObject:buttonTitle]; + if (recoveryIndex != NSNotFound) + { + if ([[self.error recoveryAttempter] attemptRecoveryFromError:self.error + optionIndex:recoveryIndex] == NO) + { + // Redisplay alert since recovery attempt failed + [ErrorHandler handleError:self.error fatal:self.fatalError]; + } + } + } + else + { + // Cancel button clicked + + if (self.fatalError) + { + // In case of a fatal error, abort execution + abort(); + } + } + + // Job is finished, release this delegate + [retainedDelegates removeObject:self]; +} + + ++(void)handleError:(NSError *)error fatal:(BOOL)fatalError +{ + NSString *localizedCancelTitle = NSLocalizedString(@"Dismiss", nil); + if (fatalError) + localizedCancelTitle = NSLocalizedString(@"Shut Down", nil); + + // Notify the user + ErrorHandler *delegate = [[ErrorHandler alloc] initWithError:error fatal:fatalError]; + if (!retainedDelegates) { + retainedDelegates = [[NSMutableArray alloc] init]; + } + [retainedDelegates addObject:delegate]; + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[error localizedDescription] + message:[error localizedFailureReason] + delegate:delegate + cancelButtonTitle:localizedCancelTitle + otherButtonTitles:nil]; + + if ([error recoveryAttempter]) + { + // Append the recovery suggestion to the error message + alert.message = [NSString stringWithFormat:@"%@\n%@", alert.message, error.localizedRecoverySuggestion]; + // Add buttons for the recovery options + for (NSString * option in error.localizedRecoveryOptions) + { + [alert addButtonWithTitle:option]; + } + } + + + [alert show]; + // Log to standard out + NSLog(@"Unhandled error:\n%@, %@", error, [error userInfo]); +} + + + +@end diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Images.xcassets/AppIcon.appiconset/Contents.json b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling-Info.plist b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling-Prefix.pch b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 Default Error Handling-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ViewController.h b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ViewController.h new file mode 100644 index 0000000..fea5cde --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ViewController.h @@ -0,0 +1,17 @@ +// +// ViewController.h +// Recipe 1-9 Default Error Handling +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "ErrorHandler.h" + +@interface ViewController : UIViewController + +- (IBAction)fakeNonFatalError:(id)sender; +- (IBAction)fakeFatalError:(id)sender; + +@end diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ViewController.m b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ViewController.m new file mode 100644 index 0000000..a594675 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/ViewController.m @@ -0,0 +1,63 @@ +// +// ViewController.m +// Recipe 1-9 Default Error Handling +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (BOOL)attemptRecoveryFromError:(NSError *)error optionIndex:(NSUInteger)recoveryOptionIndex { + return NO; +} + +- (IBAction)fakeNonFatalError:(id)sender +{ + NSString *description = @"Connection Error"; + NSString *failureReason = @"Can't seem to get a connection."; + NSArray *recoveryOptions = @[@"Retry"]; + NSString *recoverySuggestion = @"Check your wifi settings and retry."; + + NSDictionary *userInfo = + [NSDictionary dictionaryWithObjects:@[description, failureReason, recoveryOptions, recoverySuggestion, self] + forKeys: @[NSLocalizedDescriptionKey,NSLocalizedFailureReasonErrorKey, NSLocalizedRecoveryOptionsErrorKey, NSLocalizedRecoverySuggestionErrorKey, NSRecoveryAttempterErrorKey]]; + + NSError *error = [[NSError alloc] initWithDomain:@"NSCookbook.iOS7recipesbook" + code:42 userInfo:userInfo]; + + [ErrorHandler handleError:error fatal:NO]; +} + +- (IBAction)fakeFatalError:(id)sender +{ + NSString *description = @"Data Error"; + NSString *failureReason = @"Data is corrupt. The app must shut down."; + NSString *recoverySuggestion = @"Contact support!"; + + NSDictionary *userInfo = [NSDictionary dictionaryWithObjects:@[description, failureReason, recoverySuggestion] forKeys:@[NSLocalizedDescriptionKey, NSLocalizedFailureReasonErrorKey, NSLocalizedRecoverySuggestionErrorKey]]; + + NSError *error = [[NSError alloc] initWithDomain:@"NSCookbook.iOS7recipesbook" + code:22 userInfo:userInfo]; + + [ErrorHandler handleError:error fatal:YES]; +} +@end diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/main.m b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/main.m new file mode 100644 index 0000000..9d6ebf4 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error Handling/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 1-9 : Default Error Handling +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/Recipe 1-9 Default Error HandlingTests-Info.plist b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/Recipe 1-9 Default Error HandlingTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/Recipe 1-9 Default Error HandlingTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/Recipe_1_9___Default_Error_HandlingTests.m b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/Recipe_1_9___Default_Error_HandlingTests.m new file mode 100644 index 0000000..ad05c8d --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/Recipe_1_9___Default_Error_HandlingTests.m @@ -0,0 +1,36 @@ +// +// Recipe_1_9___Default_Error_HandlingTests.m +// Recipe 1-9 : Default Error HandlingTests +// +// Created by joseph hoffman on 6/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_1_9___Default_Error_HandlingTests : XCTestCase + +@end + +@implementation Recipe_1_9___Default_Error_HandlingTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/en.lproj/InfoPlist.strings b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH1 - Application Recipes/Recipe 1-9 - Defualt Error Handling/Recipe 1-9 _ Default Error Handling/Recipe 1-9 _ Default Error HandlingTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.pbxproj b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7b91984 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 885F84C417CC406100590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84C317CC406100590488 /* Foundation.framework */; }; + 885F84C617CC406100590488 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84C517CC406100590488 /* CoreGraphics.framework */; }; + 885F84C817CC406100590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84C717CC406100590488 /* UIKit.framework */; }; + 885F84CE17CC406100590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F84CC17CC406100590488 /* InfoPlist.strings */; }; + 885F84D017CC406100590488 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F84CF17CC406100590488 /* main.m */; }; + 885F84D417CC406100590488 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F84D317CC406100590488 /* AppDelegate.m */; }; + 885F84D717CC406100590488 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 885F84D517CC406100590488 /* Main.storyboard */; }; + 885F84DA17CC406100590488 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F84D917CC406100590488 /* ViewController.m */; }; + 885F84DC17CC406100590488 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 885F84DB17CC406100590488 /* Images.xcassets */; }; + 885F84E317CC406100590488 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84E217CC406100590488 /* XCTest.framework */; }; + 885F84E417CC406100590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84C317CC406100590488 /* Foundation.framework */; }; + 885F84E517CC406100590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84C717CC406100590488 /* UIKit.framework */; }; + 885F84ED17CC406100590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F84EB17CC406100590488 /* InfoPlist.strings */; }; + 885F84EF17CC406100590488 /* Recipe_10_1_Playing_AudioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F84EE17CC406100590488 /* Recipe_10_1_Playing_AudioTests.m */; }; + 885F84F917CC41D900590488 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84F817CC41D900590488 /* AVFoundation.framework */; }; + 885F84FB17CC41E200590488 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84FA17CC41E200590488 /* AudioToolbox.framework */; }; + 885F84FD17CC46E200590488 /* midnight-ride.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 885F84FC17CC46E200590488 /* midnight-ride.mp3 */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 885F84E617CC406100590488 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 885F84B817CC406100590488 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 885F84BF17CC406100590488; + remoteInfo = "Recipe 10-1 Playing Audio"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 885F84C017CC406100590488 /* Recipe 10-1 Playing Audio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 10-1 Playing Audio.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F84C317CC406100590488 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 885F84C517CC406100590488 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 885F84C717CC406100590488 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 885F84CB17CC406100590488 /* Recipe 10-1 Playing Audio-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-1 Playing Audio-Info.plist"; sourceTree = ""; }; + 885F84CD17CC406100590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F84CF17CC406100590488 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 885F84D117CC406100590488 /* Recipe 10-1 Playing Audio-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 10-1 Playing Audio-Prefix.pch"; sourceTree = ""; }; + 885F84D217CC406100590488 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 885F84D317CC406100590488 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 885F84D617CC406100590488 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 885F84D817CC406100590488 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 885F84D917CC406100590488 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 885F84DB17CC406100590488 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 885F84E117CC406100590488 /* Recipe 10-1 Playing AudioTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 10-1 Playing AudioTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F84E217CC406100590488 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 885F84EA17CC406100590488 /* Recipe 10-1 Playing AudioTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-1 Playing AudioTests-Info.plist"; sourceTree = ""; }; + 885F84EC17CC406100590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F84EE17CC406100590488 /* Recipe_10_1_Playing_AudioTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_10_1_Playing_AudioTests.m; sourceTree = ""; }; + 885F84F817CC41D900590488 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 885F84FA17CC41E200590488 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 885F84FC17CC46E200590488 /* midnight-ride.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "midnight-ride.mp3"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 885F84BD17CC406100590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84FB17CC41E200590488 /* AudioToolbox.framework in Frameworks */, + 885F84F917CC41D900590488 /* AVFoundation.framework in Frameworks */, + 885F84C617CC406100590488 /* CoreGraphics.framework in Frameworks */, + 885F84C817CC406100590488 /* UIKit.framework in Frameworks */, + 885F84C417CC406100590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F84DE17CC406100590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84E317CC406100590488 /* XCTest.framework in Frameworks */, + 885F84E517CC406100590488 /* UIKit.framework in Frameworks */, + 885F84E417CC406100590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 885F84B717CC406100590488 = { + isa = PBXGroup; + children = ( + 885F84C917CC406100590488 /* Recipe 10-1 Playing Audio */, + 885F84E817CC406100590488 /* Recipe 10-1 Playing AudioTests */, + 885F84C217CC406100590488 /* Frameworks */, + 885F84C117CC406100590488 /* Products */, + ); + sourceTree = ""; + }; + 885F84C117CC406100590488 /* Products */ = { + isa = PBXGroup; + children = ( + 885F84C017CC406100590488 /* Recipe 10-1 Playing Audio.app */, + 885F84E117CC406100590488 /* Recipe 10-1 Playing AudioTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 885F84C217CC406100590488 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 885F84FA17CC41E200590488 /* AudioToolbox.framework */, + 885F84F817CC41D900590488 /* AVFoundation.framework */, + 885F84C317CC406100590488 /* Foundation.framework */, + 885F84C517CC406100590488 /* CoreGraphics.framework */, + 885F84C717CC406100590488 /* UIKit.framework */, + 885F84E217CC406100590488 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 885F84C917CC406100590488 /* Recipe 10-1 Playing Audio */ = { + isa = PBXGroup; + children = ( + 885F84D217CC406100590488 /* AppDelegate.h */, + 885F84D317CC406100590488 /* AppDelegate.m */, + 885F84D517CC406100590488 /* Main.storyboard */, + 885F84D817CC406100590488 /* ViewController.h */, + 885F84D917CC406100590488 /* ViewController.m */, + 885F84DB17CC406100590488 /* Images.xcassets */, + 885F84CA17CC406100590488 /* Supporting Files */, + ); + path = "Recipe 10-1 Playing Audio"; + sourceTree = ""; + }; + 885F84CA17CC406100590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F84FC17CC46E200590488 /* midnight-ride.mp3 */, + 885F84CB17CC406100590488 /* Recipe 10-1 Playing Audio-Info.plist */, + 885F84CC17CC406100590488 /* InfoPlist.strings */, + 885F84CF17CC406100590488 /* main.m */, + 885F84D117CC406100590488 /* Recipe 10-1 Playing Audio-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 885F84E817CC406100590488 /* Recipe 10-1 Playing AudioTests */ = { + isa = PBXGroup; + children = ( + 885F84EE17CC406100590488 /* Recipe_10_1_Playing_AudioTests.m */, + 885F84E917CC406100590488 /* Supporting Files */, + ); + path = "Recipe 10-1 Playing AudioTests"; + sourceTree = ""; + }; + 885F84E917CC406100590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F84EA17CC406100590488 /* Recipe 10-1 Playing AudioTests-Info.plist */, + 885F84EB17CC406100590488 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 885F84BF17CC406100590488 /* Recipe 10-1 Playing Audio */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F84F217CC406100590488 /* Build configuration list for PBXNativeTarget "Recipe 10-1 Playing Audio" */; + buildPhases = ( + 885F84BC17CC406100590488 /* Sources */, + 885F84BD17CC406100590488 /* Frameworks */, + 885F84BE17CC406100590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 10-1 Playing Audio"; + productName = "Recipe 10-1 Playing Audio"; + productReference = 885F84C017CC406100590488 /* Recipe 10-1 Playing Audio.app */; + productType = "com.apple.product-type.application"; + }; + 885F84E017CC406100590488 /* Recipe 10-1 Playing AudioTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F84F517CC406100590488 /* Build configuration list for PBXNativeTarget "Recipe 10-1 Playing AudioTests" */; + buildPhases = ( + 885F84DD17CC406100590488 /* Sources */, + 885F84DE17CC406100590488 /* Frameworks */, + 885F84DF17CC406100590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 885F84E717CC406100590488 /* PBXTargetDependency */, + ); + name = "Recipe 10-1 Playing AudioTests"; + productName = "Recipe 10-1 Playing AudioTests"; + productReference = 885F84E117CC406100590488 /* Recipe 10-1 Playing AudioTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 885F84B817CC406100590488 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 885F84E017CC406100590488 = { + TestTargetID = 885F84BF17CC406100590488; + }; + }; + }; + buildConfigurationList = 885F84BB17CC406100590488 /* Build configuration list for PBXProject "Recipe 10-1 Playing Audio" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 885F84B717CC406100590488; + productRefGroup = 885F84C117CC406100590488 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 885F84BF17CC406100590488 /* Recipe 10-1 Playing Audio */, + 885F84E017CC406100590488 /* Recipe 10-1 Playing AudioTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 885F84BE17CC406100590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84FD17CC46E200590488 /* midnight-ride.mp3 in Resources */, + 885F84DC17CC406100590488 /* Images.xcassets in Resources */, + 885F84CE17CC406100590488 /* InfoPlist.strings in Resources */, + 885F84D717CC406100590488 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F84DF17CC406100590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84ED17CC406100590488 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 885F84BC17CC406100590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84DA17CC406100590488 /* ViewController.m in Sources */, + 885F84D417CC406100590488 /* AppDelegate.m in Sources */, + 885F84D017CC406100590488 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F84DD17CC406100590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84EF17CC406100590488 /* Recipe_10_1_Playing_AudioTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 885F84E717CC406100590488 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 885F84BF17CC406100590488 /* Recipe 10-1 Playing Audio */; + targetProxy = 885F84E617CC406100590488 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 885F84CC17CC406100590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F84CD17CC406100590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 885F84D517CC406100590488 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 885F84D617CC406100590488 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 885F84EB17CC406100590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F84EC17CC406100590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 885F84F017CC406100590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 885F84F117CC406100590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 885F84F317CC406100590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 885F84F417CC406100590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 885F84F617CC406100590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-1 Playing Audio.app/Recipe 10-1 Playing Audio"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 10-1 Playing AudioTests/Recipe 10-1 Playing AudioTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 885F84F717CC406100590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-1 Playing Audio.app/Recipe 10-1 Playing Audio"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-1 Playing AudioTests/Recipe 10-1 Playing AudioTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 885F84BB17CC406100590488 /* Build configuration list for PBXProject "Recipe 10-1 Playing Audio" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F84F017CC406100590488 /* Debug */, + 885F84F117CC406100590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 885F84F217CC406100590488 /* Build configuration list for PBXNativeTarget "Recipe 10-1 Playing Audio" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F84F317CC406100590488 /* Debug */, + 885F84F417CC406100590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 885F84F517CC406100590488 /* Build configuration list for PBXNativeTarget "Recipe 10-1 Playing AudioTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F84F617CC406100590488 /* Debug */, + 885F84F717CC406100590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 885F84B817CC406100590488 /* Project object */; +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..7fda88e --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState (1).xcuserstate b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState (1).xcuserstate new file mode 100644 index 0000000..60cf889 Binary files /dev/null and b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState (1).xcuserstate differ diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2270d5d Binary files /dev/null and b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..1805dff --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-1 Playing Audio.xcscheme b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-1 Playing Audio.xcscheme new file mode 100644 index 0000000..068c049 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-1 Playing Audio.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6569a8b --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 10-1 Playing Audio.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 885F84BF17CC406100590488 + + primary + + + 885F84E017CC406100590488 + + primary + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/AppDelegate.h b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/AppDelegate.h new file mode 100644 index 0000000..5fd12c9 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 10-1 Playing Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/AppDelegate.m b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/AppDelegate.m new file mode 100644 index 0000000..eadcc0b --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 10-1 Playing Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Base.lproj/Main.storyboard b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f743ead --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Base.lproj/Main.storyboard @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Images.xcassets/AppIcon.appiconset/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Prefix.pch b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/ViewController.h b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/ViewController.h new file mode 100644 index 0000000..6e18dfc --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/ViewController.h @@ -0,0 +1,33 @@ +// +// ViewController.h +// Recipe 10-1: Playing Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UISlider *rateSlider; +@property (weak, nonatomic) IBOutlet UISlider *panSlider; +@property (weak, nonatomic) IBOutlet UISlider *volumeSlider; + +@property (weak, nonatomic) IBOutlet UILabel *averageLabel; +@property (weak, nonatomic) IBOutlet UILabel *peakLabel; + +@property (strong, nonatomic) AVAudioPlayer *player; + +- (IBAction)updateRate:(id)sender; +- (IBAction)updatePan:(id)sender; +- (IBAction)updateVolume:(id)sender; + + +- (IBAction)playVibrateSound:(id)sender; +- (IBAction)startPlayer:(id)sender; +- (IBAction)pausePlayer:(id)sender; + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/ViewController.m b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/ViewController.m new file mode 100644 index 0000000..67e33a6 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/ViewController.m @@ -0,0 +1,108 @@ +// +// ViewController.m +// Recipe 10-1 Playing Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + NSString *fileName = @"midnight-ride"; // Change this to your own file + NSString *fileType = @"mp3"; + NSString *soundFilePath = + [[NSBundle mainBundle] pathForResource:fileName ofType:fileType]; + NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath]; + + NSError *error; + self.player = + [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:&error]; + if (error) + { + NSLog(@"Error creating the audio player: %@", error); + } + self.player.enableRate = YES; //Allows us to change the playback rate. + self.player.meteringEnabled = YES; //Allows us to monitor levels + self.player.delegate = self; + self.volumeSlider.value = self.player.volume; + self.rateSlider.value = self.player.rate; + self.panSlider.value = self.player.pan; + + [self.player prepareToPlay]; //Preload audio to decrease lag + + [NSTimer scheduledTimerWithTimeInterval:0.1 + target:self selector:@selector(updateLabels) userInfo:nil repeats:YES]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)updateRate:(id)sender +{ + self.player.rate = self.rateSlider.value; +} + +- (IBAction)updatePan:(id)sender +{ + self.player.pan = self.panSlider.value; +} + +- (IBAction)updateVolume:(id)sender +{ + self.player.volume = self.volumeSlider.value; +} + +- (IBAction)playVibrateSound:(id)sender +{ + AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); +} + +- (IBAction)startPlayer:(id)sender +{ + [self.player play]; +} + +- (IBAction)pausePlayer:(id)sender +{ + [self.player pause]; +} + +-(void)updateLabels +{ + [self.player updateMeters]; + self.averageLabel.text = + [NSString stringWithFormat:@"%f", [self.player averagePowerForChannel:0]]; + self.peakLabel.text = + [NSString stringWithFormat:@"%f", [self.player peakPowerForChannel:0]]; +} + +#pragma mark - delegate methods + +-(void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error +{ + NSLog(@"Error playing file: %@", [error localizedDescription]); +} + +- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withOptions:(NSUInteger)flags +{ + if (flags == AVAudioSessionInterruptionOptionShouldResume) + { + [player play]; + } +} + + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/main.m b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/main.m new file mode 100644 index 0000000..752b6c2 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 10-1 Playing Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/midnight-ride.mp3 b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/midnight-ride.mp3 new file mode 100644 index 0000000..2abe26b Binary files /dev/null and b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing Audio/midnight-ride.mp3 differ diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/Recipe 10-1 Playing AudioTests-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/Recipe 10-1 Playing AudioTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/Recipe 10-1 Playing AudioTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/Recipe_10_1_Playing_AudioTests.m b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/Recipe_10_1_Playing_AudioTests.m new file mode 100644 index 0000000..5308324 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/Recipe_10_1_Playing_AudioTests.m @@ -0,0 +1,34 @@ +// +// Recipe_10_1_Playing_AudioTests.m +// Recipe 10-1 Playing AudioTests +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_10_1_Playing_AudioTests : XCTestCase + +@end + +@implementation Recipe_10_1_Playing_AudioTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-1 Playing Audio/Recipe 10-1 Playing AudioTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.pbxproj b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.pbxproj new file mode 100644 index 0000000..383307e --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 885F850B17CC4BBC00590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F850A17CC4BBC00590488 /* Foundation.framework */; }; + 885F850D17CC4BBC00590488 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F850C17CC4BBC00590488 /* CoreGraphics.framework */; }; + 885F850F17CC4BBC00590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F850E17CC4BBC00590488 /* UIKit.framework */; }; + 885F851517CC4BBC00590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F851317CC4BBC00590488 /* InfoPlist.strings */; }; + 885F851717CC4BBC00590488 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F851617CC4BBC00590488 /* main.m */; }; + 885F851B17CC4BBC00590488 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F851A17CC4BBC00590488 /* AppDelegate.m */; }; + 885F851E17CC4BBC00590488 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 885F851C17CC4BBC00590488 /* Main.storyboard */; }; + 885F852117CC4BBC00590488 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F852017CC4BBC00590488 /* ViewController.m */; }; + 885F852317CC4BBC00590488 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 885F852217CC4BBC00590488 /* Images.xcassets */; }; + 885F852A17CC4BBC00590488 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F852917CC4BBC00590488 /* XCTest.framework */; }; + 885F852B17CC4BBC00590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F850A17CC4BBC00590488 /* Foundation.framework */; }; + 885F852C17CC4BBC00590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F850E17CC4BBC00590488 /* UIKit.framework */; }; + 885F853417CC4BBC00590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F853217CC4BBC00590488 /* InfoPlist.strings */; }; + 885F853617CC4BBC00590488 /* Recipe_10_2_Recording_AudioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F853517CC4BBC00590488 /* Recipe_10_2_Recording_AudioTests.m */; }; + 885F854017CC4BF800590488 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F853F17CC4BF800590488 /* AVFoundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 885F852D17CC4BBC00590488 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 885F84FF17CC4BBC00590488 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 885F850617CC4BBC00590488; + remoteInfo = "Recipe 10-2 Recording Audio"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 885F850717CC4BBC00590488 /* Recipe 10-2 Recording Audio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 10-2 Recording Audio.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F850A17CC4BBC00590488 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 885F850C17CC4BBC00590488 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 885F850E17CC4BBC00590488 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 885F851217CC4BBC00590488 /* Recipe 10-2 Recording Audio-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-2 Recording Audio-Info.plist"; sourceTree = ""; }; + 885F851417CC4BBC00590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F851617CC4BBC00590488 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 885F851817CC4BBC00590488 /* Recipe 10-2 Recording Audio-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 10-2 Recording Audio-Prefix.pch"; sourceTree = ""; }; + 885F851917CC4BBC00590488 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 885F851A17CC4BBC00590488 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 885F851D17CC4BBC00590488 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 885F851F17CC4BBC00590488 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 885F852017CC4BBC00590488 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 885F852217CC4BBC00590488 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 885F852817CC4BBC00590488 /* Recipe 10-2 Recording AudioTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 10-2 Recording AudioTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F852917CC4BBC00590488 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 885F853117CC4BBC00590488 /* Recipe 10-2 Recording AudioTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-2 Recording AudioTests-Info.plist"; sourceTree = ""; }; + 885F853317CC4BBC00590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F853517CC4BBC00590488 /* Recipe_10_2_Recording_AudioTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_10_2_Recording_AudioTests.m; sourceTree = ""; }; + 885F853F17CC4BF800590488 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 885F850417CC4BBC00590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F854017CC4BF800590488 /* AVFoundation.framework in Frameworks */, + 885F850D17CC4BBC00590488 /* CoreGraphics.framework in Frameworks */, + 885F850F17CC4BBC00590488 /* UIKit.framework in Frameworks */, + 885F850B17CC4BBC00590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F852517CC4BBC00590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F852A17CC4BBC00590488 /* XCTest.framework in Frameworks */, + 885F852C17CC4BBC00590488 /* UIKit.framework in Frameworks */, + 885F852B17CC4BBC00590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 885F84FE17CC4BBC00590488 = { + isa = PBXGroup; + children = ( + 885F851017CC4BBC00590488 /* Recipe 10-2 Recording Audio */, + 885F852F17CC4BBC00590488 /* Recipe 10-2 Recording AudioTests */, + 885F850917CC4BBC00590488 /* Frameworks */, + 885F850817CC4BBC00590488 /* Products */, + ); + sourceTree = ""; + }; + 885F850817CC4BBC00590488 /* Products */ = { + isa = PBXGroup; + children = ( + 885F850717CC4BBC00590488 /* Recipe 10-2 Recording Audio.app */, + 885F852817CC4BBC00590488 /* Recipe 10-2 Recording AudioTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 885F850917CC4BBC00590488 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 885F853F17CC4BF800590488 /* AVFoundation.framework */, + 885F850A17CC4BBC00590488 /* Foundation.framework */, + 885F850C17CC4BBC00590488 /* CoreGraphics.framework */, + 885F850E17CC4BBC00590488 /* UIKit.framework */, + 885F852917CC4BBC00590488 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 885F851017CC4BBC00590488 /* Recipe 10-2 Recording Audio */ = { + isa = PBXGroup; + children = ( + 885F851917CC4BBC00590488 /* AppDelegate.h */, + 885F851A17CC4BBC00590488 /* AppDelegate.m */, + 885F851C17CC4BBC00590488 /* Main.storyboard */, + 885F851F17CC4BBC00590488 /* ViewController.h */, + 885F852017CC4BBC00590488 /* ViewController.m */, + 885F852217CC4BBC00590488 /* Images.xcassets */, + 885F851117CC4BBC00590488 /* Supporting Files */, + ); + path = "Recipe 10-2 Recording Audio"; + sourceTree = ""; + }; + 885F851117CC4BBC00590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F851217CC4BBC00590488 /* Recipe 10-2 Recording Audio-Info.plist */, + 885F851317CC4BBC00590488 /* InfoPlist.strings */, + 885F851617CC4BBC00590488 /* main.m */, + 885F851817CC4BBC00590488 /* Recipe 10-2 Recording Audio-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 885F852F17CC4BBC00590488 /* Recipe 10-2 Recording AudioTests */ = { + isa = PBXGroup; + children = ( + 885F853517CC4BBC00590488 /* Recipe_10_2_Recording_AudioTests.m */, + 885F853017CC4BBC00590488 /* Supporting Files */, + ); + path = "Recipe 10-2 Recording AudioTests"; + sourceTree = ""; + }; + 885F853017CC4BBC00590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F853117CC4BBC00590488 /* Recipe 10-2 Recording AudioTests-Info.plist */, + 885F853217CC4BBC00590488 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 885F850617CC4BBC00590488 /* Recipe 10-2 Recording Audio */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F853917CC4BBC00590488 /* Build configuration list for PBXNativeTarget "Recipe 10-2 Recording Audio" */; + buildPhases = ( + 885F850317CC4BBC00590488 /* Sources */, + 885F850417CC4BBC00590488 /* Frameworks */, + 885F850517CC4BBC00590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 10-2 Recording Audio"; + productName = "Recipe 10-2 Recording Audio"; + productReference = 885F850717CC4BBC00590488 /* Recipe 10-2 Recording Audio.app */; + productType = "com.apple.product-type.application"; + }; + 885F852717CC4BBC00590488 /* Recipe 10-2 Recording AudioTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F853C17CC4BBC00590488 /* Build configuration list for PBXNativeTarget "Recipe 10-2 Recording AudioTests" */; + buildPhases = ( + 885F852417CC4BBC00590488 /* Sources */, + 885F852517CC4BBC00590488 /* Frameworks */, + 885F852617CC4BBC00590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 885F852E17CC4BBC00590488 /* PBXTargetDependency */, + ); + name = "Recipe 10-2 Recording AudioTests"; + productName = "Recipe 10-2 Recording AudioTests"; + productReference = 885F852817CC4BBC00590488 /* Recipe 10-2 Recording AudioTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 885F84FF17CC4BBC00590488 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 885F852717CC4BBC00590488 = { + TestTargetID = 885F850617CC4BBC00590488; + }; + }; + }; + buildConfigurationList = 885F850217CC4BBC00590488 /* Build configuration list for PBXProject "Recipe 10-2 Recording Audio" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 885F84FE17CC4BBC00590488; + productRefGroup = 885F850817CC4BBC00590488 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 885F850617CC4BBC00590488 /* Recipe 10-2 Recording Audio */, + 885F852717CC4BBC00590488 /* Recipe 10-2 Recording AudioTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 885F850517CC4BBC00590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F852317CC4BBC00590488 /* Images.xcassets in Resources */, + 885F851517CC4BBC00590488 /* InfoPlist.strings in Resources */, + 885F851E17CC4BBC00590488 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F852617CC4BBC00590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F853417CC4BBC00590488 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 885F850317CC4BBC00590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F852117CC4BBC00590488 /* ViewController.m in Sources */, + 885F851B17CC4BBC00590488 /* AppDelegate.m in Sources */, + 885F851717CC4BBC00590488 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F852417CC4BBC00590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F853617CC4BBC00590488 /* Recipe_10_2_Recording_AudioTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 885F852E17CC4BBC00590488 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 885F850617CC4BBC00590488 /* Recipe 10-2 Recording Audio */; + targetProxy = 885F852D17CC4BBC00590488 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 885F851317CC4BBC00590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F851417CC4BBC00590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 885F851C17CC4BBC00590488 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 885F851D17CC4BBC00590488 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 885F853217CC4BBC00590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F853317CC4BBC00590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 885F853717CC4BBC00590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 885F853817CC4BBC00590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 885F853A17CC4BBC00590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 885F853B17CC4BBC00590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 885F853D17CC4BBC00590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-2 Recording Audio.app/Recipe 10-2 Recording Audio"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 10-2 Recording AudioTests/Recipe 10-2 Recording AudioTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 885F853E17CC4BBC00590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-2 Recording Audio.app/Recipe 10-2 Recording Audio"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-2 Recording AudioTests/Recipe 10-2 Recording AudioTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 885F850217CC4BBC00590488 /* Build configuration list for PBXProject "Recipe 10-2 Recording Audio" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F853717CC4BBC00590488 /* Debug */, + 885F853817CC4BBC00590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 885F853917CC4BBC00590488 /* Build configuration list for PBXNativeTarget "Recipe 10-2 Recording Audio" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F853A17CC4BBC00590488 /* Debug */, + 885F853B17CC4BBC00590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 885F853C17CC4BBC00590488 /* Build configuration list for PBXNativeTarget "Recipe 10-2 Recording AudioTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F853D17CC4BBC00590488 /* Debug */, + 885F853E17CC4BBC00590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 885F84FF17CC4BBC00590488 /* Project object */; +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..cfe5522 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0f378c5 Binary files /dev/null and b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..392cce5 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-2 Recording Audio.xcscheme b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-2 Recording Audio.xcscheme new file mode 100644 index 0000000..3c71944 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-2 Recording Audio.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..a007fb2 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 10-2 Recording Audio.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 885F850617CC4BBC00590488 + + primary + + + 885F852717CC4BBC00590488 + + primary + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/AppDelegate.h b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/AppDelegate.h new file mode 100644 index 0000000..fd25a31 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 10-2 Recording Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/AppDelegate.m b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/AppDelegate.m new file mode 100644 index 0000000..059dda0 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 10-2 Recording Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Base.lproj/Main.storyboard b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Base.lproj/Main.storyboard new file mode 100644 index 0000000..9126ab4 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Base.lproj/Main.storyboard @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Images.xcassets/AppIcon.appiconset/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Prefix.pch b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/ViewController.h b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/ViewController.h new file mode 100644 index 0000000..0b0a8ec --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/ViewController.h @@ -0,0 +1,31 @@ +// +// ViewController.h +// Recipe 10-2 Recording Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + @private + BOOL _newRecordingAvailable; +} + +@property (weak, nonatomic) IBOutlet UILabel *averageLabel; +@property (weak, nonatomic) IBOutlet UILabel *peakLabel; +@property (weak, nonatomic) IBOutlet UIButton *recordButton; +@property (weak, nonatomic) IBOutlet UIButton *playButton; + +@property (strong, nonatomic) AVAudioPlayer *player; +@property (strong, nonatomic) AVAudioRecorder *recorder; +@property (strong, nonatomic) AVAudioSession *session; +@property (strong, nonatomic) NSString *recordedFilePath; + +- (IBAction)toggleRecording:(id)sender; +- (IBAction)togglePlaying:(id)sender; + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/ViewController.m b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/ViewController.m new file mode 100644 index 0000000..bc0441d --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/ViewController.m @@ -0,0 +1,155 @@ +// +// ViewController.m +// Recipe 10-2 Recording Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.session = [AVAudioSession sharedInstance]; + [self.session setActive:YES error:nil]; + + NSError *error; + + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&error]; + + + self.recordedFilePath = [[NSString alloc] initWithFormat:@"%@%@", + NSTemporaryDirectory(), @"recording.wav"]; + NSURL *url = [[NSURL alloc] initFileURLWithPath:self.recordedFilePath]; + + self.recorder = [[AVAudioRecorder alloc] initWithURL:url settings:nil error:&error]; + if (error) + { + NSLog(@"Error initializing recorder: %@", error); + } + self.recorder.meteringEnabled = YES; + self.recorder.delegate = self; + [self.recorder prepareToRecord]; + + [NSTimer scheduledTimerWithTimeInterval:0.01 target:self + selector:@selector(updateLabels) userInfo:nil repeats:YES]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Actions + +- (IBAction)toggleRecording:(id)sender +{ + + if ([self.recorder isRecording]) + { + [self.recorder stop]; + [self.recordButton setTitle:@"Record" forState:UIControlStateNormal]; + } + else + { + [self.session requestRecordPermission:^(BOOL granted) { + + if(granted) + { + [self.recorder record]; + [self.recordButton setTitle:@"Stop" forState:UIControlStateNormal]; + } + else + { + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Recording Permission Denied" message:@"Verify microphone access is turned on in Settings->Privacy->Microphone" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + } + }]; + + } +} + +- (IBAction)togglePlaying:(id)sender +{ + if (self.player.playing) + { + [self.player pause]; + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; + } + else if (_newRecordingAvailable) + { + NSURL *url = [[NSURL alloc] initFileURLWithPath:self.recordedFilePath]; + NSError *error; + self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; + if (!error) + { + self.player.delegate = self; + [self.player play]; + } + else + { + NSLog(@"Error initializing player: %@", error); + } + [self.playButton setTitle:@"Pause" forState:UIControlStateNormal]; + _newRecordingAvailable = NO; + } + else if (self.player) + { + [self.player play]; + [self.playButton setTitle:@"Pause" forState:UIControlStateNormal]; + } +} + +#pragma mark - private methods + +-(void)updateLabels +{ + [self.recorder updateMeters]; + self.averageLabel.text = + [NSString stringWithFormat:@"%f", [self.recorder averagePowerForChannel:0]]; + self.peakLabel.text = + [NSString stringWithFormat:@"%f", [self.recorder peakPowerForChannel:0]]; +} + +#pragma mark - delegate methods + +- (void)audioRecorderDidFinishRecording:(AVAudioRecorder *)recorder successfully:(BOOL)flag +{ + _newRecordingAvailable = flag; + [self.recordButton setTitle:@"Record" forState:UIControlStateNormal]; + NSLog(@"Did finish recording: %hhd",_newRecordingAvailable); +} + +-(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag +{ + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; +} + +- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withOptions:(NSUInteger)flags +{ + if (flags == AVAudioSessionInterruptionOptionShouldResume) + { + [player play]; + } +} + +- (void)audioRecorderEndInterruption:(AVAudioRecorder *)recorder withOptions:(NSUInteger)flags +{ + if (flags == AVAudioSessionInterruptionOptionShouldResume) + { + [recorder record]; + } +} + + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/main.m b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/main.m new file mode 100644 index 0000000..4022e81 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording Audio/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 10-2 Recording Audio +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/Recipe 10-2 Recording AudioTests-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/Recipe 10-2 Recording AudioTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/Recipe 10-2 Recording AudioTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/Recipe_10_2_Recording_AudioTests.m b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/Recipe_10_2_Recording_AudioTests.m new file mode 100644 index 0000000..aee2139 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/Recipe_10_2_Recording_AudioTests.m @@ -0,0 +1,34 @@ +// +// Recipe_10_2_Recording_AudioTests.m +// Recipe 10-2 Recording AudioTests +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_10_2_Recording_AudioTests : XCTestCase + +@end + +@implementation Recipe_10_2_Recording_AudioTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-2 Recording Audio/Recipe 10-2 Recording AudioTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.pbxproj b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a5898c6 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 885F854E17CC51E400590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F854D17CC51E400590488 /* Foundation.framework */; }; + 885F855017CC51E400590488 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F854F17CC51E400590488 /* CoreGraphics.framework */; }; + 885F855217CC51E400590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F855117CC51E400590488 /* UIKit.framework */; }; + 885F855817CC51E400590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F855617CC51E400590488 /* InfoPlist.strings */; }; + 885F855A17CC51E400590488 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F855917CC51E400590488 /* main.m */; }; + 885F855E17CC51E400590488 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F855D17CC51E400590488 /* AppDelegate.m */; }; + 885F856117CC51E400590488 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 885F855F17CC51E400590488 /* Main.storyboard */; }; + 885F856417CC51E400590488 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F856317CC51E400590488 /* ViewController.m */; }; + 885F856617CC51E400590488 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 885F856517CC51E400590488 /* Images.xcassets */; }; + 885F856D17CC51E400590488 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F856C17CC51E400590488 /* XCTest.framework */; }; + 885F856E17CC51E400590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F854D17CC51E400590488 /* Foundation.framework */; }; + 885F856F17CC51E400590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F855117CC51E400590488 /* UIKit.framework */; }; + 885F857717CC51E400590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F857517CC51E400590488 /* InfoPlist.strings */; }; + 885F857917CC51E400590488 /* Recipe_10_3_Accessing_the_Music_LibraryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F857817CC51E400590488 /* Recipe_10_3_Accessing_the_Music_LibraryTests.m */; }; + 885F858317CC531A00590488 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F858217CC531A00590488 /* MediaPlayer.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 885F857017CC51E400590488 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 885F854217CC51E400590488 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 885F854917CC51E400590488; + remoteInfo = "Recipe 10-3 Accessing the Music Library"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 885F854A17CC51E400590488 /* Recipe 10-3 Accessing the Music Library.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 10-3 Accessing the Music Library.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F854D17CC51E400590488 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 885F854F17CC51E400590488 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 885F855117CC51E400590488 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 885F855517CC51E400590488 /* Recipe 10-3 Accessing the Music Library-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-3 Accessing the Music Library-Info.plist"; sourceTree = ""; }; + 885F855717CC51E400590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F855917CC51E400590488 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 885F855B17CC51E400590488 /* Recipe 10-3 Accessing the Music Library-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 10-3 Accessing the Music Library-Prefix.pch"; sourceTree = ""; }; + 885F855C17CC51E400590488 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 885F855D17CC51E400590488 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 885F856017CC51E400590488 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 885F856217CC51E400590488 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 885F856317CC51E400590488 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 885F856517CC51E400590488 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 885F856B17CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 10-3 Accessing the Music LibraryTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F856C17CC51E400590488 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 885F857417CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-3 Accessing the Music LibraryTests-Info.plist"; sourceTree = ""; }; + 885F857617CC51E400590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F857817CC51E400590488 /* Recipe_10_3_Accessing_the_Music_LibraryTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_10_3_Accessing_the_Music_LibraryTests.m; sourceTree = ""; }; + 885F858217CC531A00590488 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 885F854717CC51E400590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F858317CC531A00590488 /* MediaPlayer.framework in Frameworks */, + 885F855017CC51E400590488 /* CoreGraphics.framework in Frameworks */, + 885F855217CC51E400590488 /* UIKit.framework in Frameworks */, + 885F854E17CC51E400590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F856817CC51E400590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F856D17CC51E400590488 /* XCTest.framework in Frameworks */, + 885F856F17CC51E400590488 /* UIKit.framework in Frameworks */, + 885F856E17CC51E400590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 885F854117CC51E400590488 = { + isa = PBXGroup; + children = ( + 885F855317CC51E400590488 /* Recipe 10-3 Accessing the Music Library */, + 885F857217CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests */, + 885F854C17CC51E400590488 /* Frameworks */, + 885F854B17CC51E400590488 /* Products */, + ); + sourceTree = ""; + }; + 885F854B17CC51E400590488 /* Products */ = { + isa = PBXGroup; + children = ( + 885F854A17CC51E400590488 /* Recipe 10-3 Accessing the Music Library.app */, + 885F856B17CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 885F854C17CC51E400590488 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 885F858217CC531A00590488 /* MediaPlayer.framework */, + 885F854D17CC51E400590488 /* Foundation.framework */, + 885F854F17CC51E400590488 /* CoreGraphics.framework */, + 885F855117CC51E400590488 /* UIKit.framework */, + 885F856C17CC51E400590488 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 885F855317CC51E400590488 /* Recipe 10-3 Accessing the Music Library */ = { + isa = PBXGroup; + children = ( + 885F855C17CC51E400590488 /* AppDelegate.h */, + 885F855D17CC51E400590488 /* AppDelegate.m */, + 885F855F17CC51E400590488 /* Main.storyboard */, + 885F856217CC51E400590488 /* ViewController.h */, + 885F856317CC51E400590488 /* ViewController.m */, + 885F856517CC51E400590488 /* Images.xcassets */, + 885F855417CC51E400590488 /* Supporting Files */, + ); + path = "Recipe 10-3 Accessing the Music Library"; + sourceTree = ""; + }; + 885F855417CC51E400590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F855517CC51E400590488 /* Recipe 10-3 Accessing the Music Library-Info.plist */, + 885F855617CC51E400590488 /* InfoPlist.strings */, + 885F855917CC51E400590488 /* main.m */, + 885F855B17CC51E400590488 /* Recipe 10-3 Accessing the Music Library-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 885F857217CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests */ = { + isa = PBXGroup; + children = ( + 885F857817CC51E400590488 /* Recipe_10_3_Accessing_the_Music_LibraryTests.m */, + 885F857317CC51E400590488 /* Supporting Files */, + ); + path = "Recipe 10-3 Accessing the Music LibraryTests"; + sourceTree = ""; + }; + 885F857317CC51E400590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F857417CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests-Info.plist */, + 885F857517CC51E400590488 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 885F854917CC51E400590488 /* Recipe 10-3 Accessing the Music Library */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F857C17CC51E400590488 /* Build configuration list for PBXNativeTarget "Recipe 10-3 Accessing the Music Library" */; + buildPhases = ( + 885F854617CC51E400590488 /* Sources */, + 885F854717CC51E400590488 /* Frameworks */, + 885F854817CC51E400590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 10-3 Accessing the Music Library"; + productName = "Recipe 10-3 Accessing the Music Library"; + productReference = 885F854A17CC51E400590488 /* Recipe 10-3 Accessing the Music Library.app */; + productType = "com.apple.product-type.application"; + }; + 885F856A17CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F857F17CC51E400590488 /* Build configuration list for PBXNativeTarget "Recipe 10-3 Accessing the Music LibraryTests" */; + buildPhases = ( + 885F856717CC51E400590488 /* Sources */, + 885F856817CC51E400590488 /* Frameworks */, + 885F856917CC51E400590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 885F857117CC51E400590488 /* PBXTargetDependency */, + ); + name = "Recipe 10-3 Accessing the Music LibraryTests"; + productName = "Recipe 10-3 Accessing the Music LibraryTests"; + productReference = 885F856B17CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 885F854217CC51E400590488 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 885F856A17CC51E400590488 = { + TestTargetID = 885F854917CC51E400590488; + }; + }; + }; + buildConfigurationList = 885F854517CC51E400590488 /* Build configuration list for PBXProject "Recipe 10-3 Accessing the Music Library" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 885F854117CC51E400590488; + productRefGroup = 885F854B17CC51E400590488 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 885F854917CC51E400590488 /* Recipe 10-3 Accessing the Music Library */, + 885F856A17CC51E400590488 /* Recipe 10-3 Accessing the Music LibraryTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 885F854817CC51E400590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F856617CC51E400590488 /* Images.xcassets in Resources */, + 885F855817CC51E400590488 /* InfoPlist.strings in Resources */, + 885F856117CC51E400590488 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F856917CC51E400590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F857717CC51E400590488 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 885F854617CC51E400590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F856417CC51E400590488 /* ViewController.m in Sources */, + 885F855E17CC51E400590488 /* AppDelegate.m in Sources */, + 885F855A17CC51E400590488 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F856717CC51E400590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F857917CC51E400590488 /* Recipe_10_3_Accessing_the_Music_LibraryTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 885F857117CC51E400590488 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 885F854917CC51E400590488 /* Recipe 10-3 Accessing the Music Library */; + targetProxy = 885F857017CC51E400590488 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 885F855617CC51E400590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F855717CC51E400590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 885F855F17CC51E400590488 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 885F856017CC51E400590488 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 885F857517CC51E400590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F857617CC51E400590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 885F857A17CC51E400590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 885F857B17CC51E400590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 885F857D17CC51E400590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 885F857E17CC51E400590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 885F858017CC51E400590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-3 Accessing the Music Library.app/Recipe 10-3 Accessing the Music Library"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 10-3 Accessing the Music LibraryTests/Recipe 10-3 Accessing the Music LibraryTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 885F858117CC51E400590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-3 Accessing the Music Library.app/Recipe 10-3 Accessing the Music Library"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-3 Accessing the Music LibraryTests/Recipe 10-3 Accessing the Music LibraryTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 885F854517CC51E400590488 /* Build configuration list for PBXProject "Recipe 10-3 Accessing the Music Library" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F857A17CC51E400590488 /* Debug */, + 885F857B17CC51E400590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 885F857C17CC51E400590488 /* Build configuration list for PBXNativeTarget "Recipe 10-3 Accessing the Music Library" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F857D17CC51E400590488 /* Debug */, + 885F857E17CC51E400590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 885F857F17CC51E400590488 /* Build configuration list for PBXNativeTarget "Recipe 10-3 Accessing the Music LibraryTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F858017CC51E400590488 /* Debug */, + 885F858117CC51E400590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 885F854217CC51E400590488 /* Project object */; +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..30ed225 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..7f3cb84 Binary files /dev/null and b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-3 Accessing the Music Library.xcscheme b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-3 Accessing the Music Library.xcscheme new file mode 100644 index 0000000..f9d2ee6 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-3 Accessing the Music Library.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..3a486ca --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 10-3 Accessing the Music Library.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 885F854917CC51E400590488 + + primary + + + 885F856A17CC51E400590488 + + primary + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/AppDelegate.h b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/AppDelegate.h new file mode 100644 index 0000000..ac63d66 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 10-3 Accessing the Music Library +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/AppDelegate.m b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/AppDelegate.m new file mode 100644 index 0000000..53309cb --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 10-3 Accessing the Music Library +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Base.lproj/Main.storyboard b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Base.lproj/Main.storyboard new file mode 100644 index 0000000..19db61f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Base.lproj/Main.storyboard @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Images.xcassets/AppIcon.appiconset/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Prefix.pch b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/ViewController.h b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/ViewController.h new file mode 100644 index 0000000..dfe649b --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/ViewController.h @@ -0,0 +1,29 @@ +// +// ViewController.h +// Recipe 10-3 Accessing the Music Library +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *infoLabel; +@property (weak, nonatomic) IBOutlet MPVolumeView *volumeView; +@property (weak, nonatomic) IBOutlet UIButton *playButton; +@property (strong, nonatomic) MPMediaItemCollection *myCollection; +@property (strong, nonatomic) MPMusicPlayerController *player; +@property (weak, nonatomic) IBOutlet UITextField *artistTextField; + +- (IBAction)addItems:(id)sender; +- (IBAction)prevTapped:(id)sender; +- (IBAction)playTapped:(id)sender; +- (IBAction)nextTapped:(id)sender; +- (IBAction)queueMusicByArtist:(id)sender; + + + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/ViewController.m b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/ViewController.m new file mode 100644 index 0000000..6c49056 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/ViewController.m @@ -0,0 +1,245 @@ +// +// ViewController.m +// Recipe 10-3 Accessing the Music Library +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.infoLabel.text = @"..."; + + self.player = [MPMusicPlayerController applicationMusicPlayer]; + + [self setNotifications]; + + [self.player beginGeneratingPlaybackNotifications]; + + [self.player setShuffleMode:MPMusicShuffleModeOff]; + self.player.repeatMode = MPMusicRepeatModeNone; + + self.volumeView.backgroundColor = [UIColor clearColor]; + MPVolumeView *myVolumeView = + [[MPVolumeView alloc] initWithFrame: self.volumeView.bounds]; + [self.volumeView addSubview: myVolumeView]; + + + self.artistTextField.delegate = self; + self.artistTextField.enablesReturnKeyAutomatically = YES; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +# pragma mark - action methods + +- (IBAction)addItems:(id)sender +{ + + MPMediaPickerController *picker = + [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic]; + picker.delegate = self; + picker.allowsPickingMultipleItems = YES; + picker.prompt = NSLocalizedString (@"Add songs to play", + "Prompt in media item picker"); + [self presentViewController:picker animated:YES completion:NULL]; +} + +- (IBAction)prevTapped:(id)sender +{ + if ([self.player currentPlaybackTime] > 5.0) + { + [self.player skipToBeginning]; + } + else + { + [self.player skipToPreviousItem]; + } + +} + +- (IBAction)playTapped:(id)sender +{ + if ((self.myCollection != nil) && + (self.player.playbackState != MPMusicPlaybackStatePlaying)) + { + [self.player play]; + [self.playButton setTitle:@"Pause" forState:UIControlStateNormal]; + } + else if (self.player.playbackState == MPMusicPlaybackStatePlaying) + { + [self.player pause]; + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; + } + +} + +- (IBAction)nextTapped:(id)sender +{ + [self.player skipToNextItem]; + +} + + + +- (IBAction)queueMusicByArtist:(id)sender +{ + NSString *artist = self.artistTextField.text; + if (artist != nil && ![artist isEqual: @""]) + { + MPMediaPropertyPredicate *artistPredicate = + [MPMediaPropertyPredicate + predicateWithValue:artist + forProperty:MPMediaItemPropertyArtist + comparisonType:MPMediaPredicateComparisonContains]; + MPMediaQuery *query = [[MPMediaQuery alloc] init]; + [query addFilterPredicate:artistPredicate]; + + NSArray *result = [query items]; + if ([result count] > 0) + { + [self updateQueueWithMediaItemCollection: + [MPMediaItemCollection collectionWithItems:result]]; + } + else + self.infoLabel.text = @"Artist Not Found."; + } +} + +#pragma mark - helper methods + +-(void)setNotifications +{ + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter + addObserver: self + selector: @selector(handleNowPlayingItemChanged:) + name: MPMusicPlayerControllerNowPlayingItemDidChangeNotification + object: self.player]; + + [notificationCenter + addObserver: self + selector: @selector(handlePlaybackStateChanged:) + name: MPMusicPlayerControllerPlaybackStateDidChangeNotification + object: self.player]; + + +} + + + +- (void) handlePlaybackStateChanged: (id) notification +{ + MPMusicPlaybackState playbackState = [self.player playbackState]; + + if (playbackState == MPMusicPlaybackStateStopped) + { + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; + } + else if (playbackState == MPMusicPlaybackStatePaused) + { + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; + } + else if (playbackState == MPMusicPlaybackStatePlaying) + { + [self.playButton setTitle:@"Pause" forState:UIControlStateNormal]; + } +} + +- (void) handleNowPlayingItemChanged: (id) notification +{ + MPMediaItem *currentItemPlaying = [self.player nowPlayingItem]; + if (currentItemPlaying) + { + NSString *info = [NSString stringWithFormat:@"%@ - %@", + [currentItemPlaying valueForProperty:MPMediaItemPropertyTitle], + [currentItemPlaying valueForProperty:MPMediaItemPropertyArtist]]; + self.infoLabel.text = info; + } + else + { + self.infoLabel.text = @"..."; + } +} + +-(void)updateQueueWithMediaItemCollection:(MPMediaItemCollection *)collection +{ + if (collection) + { + if (self.myCollection == nil) + { + self.myCollection = collection; + [self.player setQueueWithItemCollection: self.myCollection]; + [self.player play]; + } + else + { + BOOL wasPlaying = NO; + if (self.player.playbackState == MPMusicPlaybackStatePlaying) + { + wasPlaying = YES; + } + + MPMediaItem *nowPlayingItem = self.player.nowPlayingItem; + NSTimeInterval currentPlaybackTime = self.player.currentPlaybackTime; + + NSMutableArray *combinedMediaItems = + [[self.myCollection items] mutableCopy]; + NSArray *newMediaItems = [collection items]; + [combinedMediaItems addObjectsFromArray: newMediaItems]; + + self.myCollection = + [MPMediaItemCollection collectionWithItems:combinedMediaItems]; + + [self.player setQueueWithItemCollection:self.myCollection]; + + self.player.nowPlayingItem = nowPlayingItem; + self.player.currentPlaybackTime = currentPlaybackTime; + + if (wasPlaying) + { + [self.player play]; + } + } + } +} + +#pragma mark - delegate methods + +-(void)mediaPickerDidCancel:(MPMediaPickerController *)mediaPicker +{ + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(void)mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection +{ + [self updateQueueWithMediaItemCollection:mediaItemCollection]; + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + [self queueMusicByArtist:self]; + return NO; +} + + + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/main.m b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/main.m new file mode 100644 index 0000000..8418b79 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music Library/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 10-3 Accessing the Music Library +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/Recipe 10-3 Accessing the Music LibraryTests-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/Recipe 10-3 Accessing the Music LibraryTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/Recipe 10-3 Accessing the Music LibraryTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/Recipe_10_3_Accessing_the_Music_LibraryTests.m b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/Recipe_10_3_Accessing_the_Music_LibraryTests.m new file mode 100644 index 0000000..38f4ddd --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/Recipe_10_3_Accessing_the_Music_LibraryTests.m @@ -0,0 +1,34 @@ +// +// Recipe_10_3_Accessing_the_Music_LibraryTests.m +// Recipe 10-3 Accessing the Music LibraryTests +// +// Created by joseph hoffman on 8/26/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_10_3_Accessing_the_Music_LibraryTests : XCTestCase + +@end + +@implementation Recipe_10_3_Accessing_the_Music_LibraryTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-3 Accessing the Music Library/Recipe 10-3 Accessing the Music LibraryTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.pbxproj b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8d7d4f0 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 885F859117CD7F7300590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F859017CD7F7300590488 /* Foundation.framework */; }; + 885F859317CD7F7300590488 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F859217CD7F7300590488 /* CoreGraphics.framework */; }; + 885F859517CD7F7300590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F859417CD7F7300590488 /* UIKit.framework */; }; + 885F859B17CD7F7300590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F859917CD7F7300590488 /* InfoPlist.strings */; }; + 885F859D17CD7F7300590488 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F859C17CD7F7300590488 /* main.m */; }; + 885F85A117CD7F7300590488 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F85A017CD7F7300590488 /* AppDelegate.m */; }; + 885F85A417CD7F7300590488 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 885F85A217CD7F7300590488 /* Main.storyboard */; }; + 885F85A717CD7F7300590488 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F85A617CD7F7300590488 /* ViewController.m */; }; + 885F85A917CD7F7300590488 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 885F85A817CD7F7300590488 /* Images.xcassets */; }; + 885F85B017CD7F7300590488 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F85AF17CD7F7300590488 /* XCTest.framework */; }; + 885F85B117CD7F7300590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F859017CD7F7300590488 /* Foundation.framework */; }; + 885F85B217CD7F7300590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F859417CD7F7300590488 /* UIKit.framework */; }; + 885F85BA17CD7F7300590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F85B817CD7F7300590488 /* InfoPlist.strings */; }; + 885F85BC17CD7F7300590488 /* Recipe_10_4_Playing_Background_AudioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F85BB17CD7F7300590488 /* Recipe_10_4_Playing_Background_AudioTests.m */; }; + 885F85C617CD7F9F00590488 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F85C517CD7F9F00590488 /* AVFoundation.framework */; }; + 885F85C817CD7FAA00590488 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F85C717CD7FAA00590488 /* MediaPlayer.framework */; }; + 885F85CA17CD7FB300590488 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F85C917CD7FB300590488 /* CoreMedia.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 885F85B317CD7F7300590488 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 885F858517CD7F7300590488 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 885F858C17CD7F7300590488; + remoteInfo = "Recipe 10-4 Playing Background Audio"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 885F858D17CD7F7300590488 /* Recipe 10-4 Playing Background Audio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 10-4 Playing Background Audio.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F859017CD7F7300590488 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 885F859217CD7F7300590488 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 885F859417CD7F7300590488 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 885F859817CD7F7300590488 /* Recipe 10-4 Playing Background Audio-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-4 Playing Background Audio-Info.plist"; sourceTree = ""; }; + 885F859A17CD7F7300590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F859C17CD7F7300590488 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 885F859E17CD7F7300590488 /* Recipe 10-4 Playing Background Audio-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 10-4 Playing Background Audio-Prefix.pch"; sourceTree = ""; }; + 885F859F17CD7F7300590488 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 885F85A017CD7F7300590488 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 885F85A317CD7F7300590488 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 885F85A517CD7F7300590488 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 885F85A617CD7F7300590488 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 885F85A817CD7F7300590488 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 885F85AE17CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 10-4 Playing Background AudioTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F85AF17CD7F7300590488 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 885F85B717CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 10-4 Playing Background AudioTests-Info.plist"; sourceTree = ""; }; + 885F85B917CD7F7300590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F85BB17CD7F7300590488 /* Recipe_10_4_Playing_Background_AudioTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_10_4_Playing_Background_AudioTests.m; sourceTree = ""; }; + 885F85C517CD7F9F00590488 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 885F85C717CD7FAA00590488 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; + 885F85C917CD7FB300590488 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 885F858A17CD7F7300590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F85CA17CD7FB300590488 /* CoreMedia.framework in Frameworks */, + 885F85C817CD7FAA00590488 /* MediaPlayer.framework in Frameworks */, + 885F85C617CD7F9F00590488 /* AVFoundation.framework in Frameworks */, + 885F859317CD7F7300590488 /* CoreGraphics.framework in Frameworks */, + 885F859517CD7F7300590488 /* UIKit.framework in Frameworks */, + 885F859117CD7F7300590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F85AB17CD7F7300590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F85B017CD7F7300590488 /* XCTest.framework in Frameworks */, + 885F85B217CD7F7300590488 /* UIKit.framework in Frameworks */, + 885F85B117CD7F7300590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 885F858417CD7F7300590488 = { + isa = PBXGroup; + children = ( + 885F859617CD7F7300590488 /* Recipe 10-4 Playing Background Audio */, + 885F85B517CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests */, + 885F858F17CD7F7300590488 /* Frameworks */, + 885F858E17CD7F7300590488 /* Products */, + ); + sourceTree = ""; + }; + 885F858E17CD7F7300590488 /* Products */ = { + isa = PBXGroup; + children = ( + 885F858D17CD7F7300590488 /* Recipe 10-4 Playing Background Audio.app */, + 885F85AE17CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 885F858F17CD7F7300590488 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 885F85C917CD7FB300590488 /* CoreMedia.framework */, + 885F85C717CD7FAA00590488 /* MediaPlayer.framework */, + 885F85C517CD7F9F00590488 /* AVFoundation.framework */, + 885F859017CD7F7300590488 /* Foundation.framework */, + 885F859217CD7F7300590488 /* CoreGraphics.framework */, + 885F859417CD7F7300590488 /* UIKit.framework */, + 885F85AF17CD7F7300590488 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 885F859617CD7F7300590488 /* Recipe 10-4 Playing Background Audio */ = { + isa = PBXGroup; + children = ( + 885F859F17CD7F7300590488 /* AppDelegate.h */, + 885F85A017CD7F7300590488 /* AppDelegate.m */, + 885F85A217CD7F7300590488 /* Main.storyboard */, + 885F85A517CD7F7300590488 /* ViewController.h */, + 885F85A617CD7F7300590488 /* ViewController.m */, + 885F85A817CD7F7300590488 /* Images.xcassets */, + 885F859717CD7F7300590488 /* Supporting Files */, + ); + path = "Recipe 10-4 Playing Background Audio"; + sourceTree = ""; + }; + 885F859717CD7F7300590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F859817CD7F7300590488 /* Recipe 10-4 Playing Background Audio-Info.plist */, + 885F859917CD7F7300590488 /* InfoPlist.strings */, + 885F859C17CD7F7300590488 /* main.m */, + 885F859E17CD7F7300590488 /* Recipe 10-4 Playing Background Audio-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 885F85B517CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests */ = { + isa = PBXGroup; + children = ( + 885F85BB17CD7F7300590488 /* Recipe_10_4_Playing_Background_AudioTests.m */, + 885F85B617CD7F7300590488 /* Supporting Files */, + ); + path = "Recipe 10-4 Playing Background AudioTests"; + sourceTree = ""; + }; + 885F85B617CD7F7300590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F85B717CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests-Info.plist */, + 885F85B817CD7F7300590488 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 885F858C17CD7F7300590488 /* Recipe 10-4 Playing Background Audio */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F85BF17CD7F7300590488 /* Build configuration list for PBXNativeTarget "Recipe 10-4 Playing Background Audio" */; + buildPhases = ( + 885F858917CD7F7300590488 /* Sources */, + 885F858A17CD7F7300590488 /* Frameworks */, + 885F858B17CD7F7300590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 10-4 Playing Background Audio"; + productName = "Recipe 10-4 Playing Background Audio"; + productReference = 885F858D17CD7F7300590488 /* Recipe 10-4 Playing Background Audio.app */; + productType = "com.apple.product-type.application"; + }; + 885F85AD17CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F85C217CD7F7300590488 /* Build configuration list for PBXNativeTarget "Recipe 10-4 Playing Background AudioTests" */; + buildPhases = ( + 885F85AA17CD7F7300590488 /* Sources */, + 885F85AB17CD7F7300590488 /* Frameworks */, + 885F85AC17CD7F7300590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 885F85B417CD7F7300590488 /* PBXTargetDependency */, + ); + name = "Recipe 10-4 Playing Background AudioTests"; + productName = "Recipe 10-4 Playing Background AudioTests"; + productReference = 885F85AE17CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 885F858517CD7F7300590488 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 885F85AD17CD7F7300590488 = { + TestTargetID = 885F858C17CD7F7300590488; + }; + }; + }; + buildConfigurationList = 885F858817CD7F7300590488 /* Build configuration list for PBXProject "Recipe 10-4 Playing Background Audio" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 885F858417CD7F7300590488; + productRefGroup = 885F858E17CD7F7300590488 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 885F858C17CD7F7300590488 /* Recipe 10-4 Playing Background Audio */, + 885F85AD17CD7F7300590488 /* Recipe 10-4 Playing Background AudioTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 885F858B17CD7F7300590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F85A917CD7F7300590488 /* Images.xcassets in Resources */, + 885F859B17CD7F7300590488 /* InfoPlist.strings in Resources */, + 885F85A417CD7F7300590488 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F85AC17CD7F7300590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F85BA17CD7F7300590488 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 885F858917CD7F7300590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F85A717CD7F7300590488 /* ViewController.m in Sources */, + 885F85A117CD7F7300590488 /* AppDelegate.m in Sources */, + 885F859D17CD7F7300590488 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F85AA17CD7F7300590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F85BC17CD7F7300590488 /* Recipe_10_4_Playing_Background_AudioTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 885F85B417CD7F7300590488 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 885F858C17CD7F7300590488 /* Recipe 10-4 Playing Background Audio */; + targetProxy = 885F85B317CD7F7300590488 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 885F859917CD7F7300590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F859A17CD7F7300590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 885F85A217CD7F7300590488 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 885F85A317CD7F7300590488 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 885F85B817CD7F7300590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F85B917CD7F7300590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 885F85BD17CD7F7300590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 885F85BE17CD7F7300590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 885F85C017CD7F7300590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 885F85C117CD7F7300590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 885F85C317CD7F7300590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-4 Playing Background Audio.app/Recipe 10-4 Playing Background Audio"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 10-4 Playing Background AudioTests/Recipe 10-4 Playing Background AudioTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 885F85C417CD7F7300590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 10-4 Playing Background Audio.app/Recipe 10-4 Playing Background Audio"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Prefix.pch"; + INFOPLIST_FILE = "Recipe 10-4 Playing Background AudioTests/Recipe 10-4 Playing Background AudioTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 885F858817CD7F7300590488 /* Build configuration list for PBXProject "Recipe 10-4 Playing Background Audio" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F85BD17CD7F7300590488 /* Debug */, + 885F85BE17CD7F7300590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 885F85BF17CD7F7300590488 /* Build configuration list for PBXNativeTarget "Recipe 10-4 Playing Background Audio" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F85C017CD7F7300590488 /* Debug */, + 885F85C117CD7F7300590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 885F85C217CD7F7300590488 /* Build configuration list for PBXNativeTarget "Recipe 10-4 Playing Background AudioTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F85C317CD7F7300590488 /* Debug */, + 885F85C417CD7F7300590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 885F858517CD7F7300590488 /* Project object */; +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a29d925 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..58e3a85 Binary files /dev/null and b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..285dd42 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-4 Playing Background Audio.xcscheme b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-4 Playing Background Audio.xcscheme new file mode 100644 index 0000000..54a3f37 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 10-4 Playing Background Audio.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f7b61f8 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 10-4 Playing Background Audio.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 885F858C17CD7F7300590488 + + primary + + + 885F85AD17CD7F7300590488 + + primary + + + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/AppDelegate.h b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/AppDelegate.h new file mode 100644 index 0000000..9d6a79f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 10-4 Playing Background Audio +// +// Created by joseph hoffman on 8/27/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/AppDelegate.m b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/AppDelegate.m new file mode 100644 index 0000000..337e227 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 10-4 Playing Background Audio +// +// Created by joseph hoffman on 8/27/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Base.lproj/Main.storyboard b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8d38aa1 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Base.lproj/Main.storyboard @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Images.xcassets/AppIcon.appiconset/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Info.plist new file mode 100644 index 0000000..1c18426 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Info.plist @@ -0,0 +1,44 @@ + + + + + UIBackgroundModes + + audio + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Prefix.pch b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/ViewController.h b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/ViewController.h new file mode 100644 index 0000000..83c1abf --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/ViewController.h @@ -0,0 +1,30 @@ +// +// ViewController.h +// Recipe 10-4: Playing Background Audio +// +// Created by joseph hoffman on 8/27/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *infoLabel; +@property (weak, nonatomic) IBOutlet UIButton *playButton; +@property (weak, nonatomic) IBOutlet UIImageView *artworkImageView; +@property (nonatomic, strong) AVPlayer *player; +@property (nonatomic, strong) NSMutableArray *playlist; +@property (nonatomic) NSInteger currentIndex; + +@property (nonatomic, strong) AVAudioSession *session; + +- (IBAction)queueFromLibrary:(id)sender; +- (IBAction)goToPrevTrack:(id)sender; +- (IBAction)togglePlay:(id)sender; +- (IBAction)goToNextTrack:(id)sender; +- (IBAction)clearPlaylist:(id)sender; + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/ViewController.m b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/ViewController.m new file mode 100644 index 0000000..7504570 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/ViewController.m @@ -0,0 +1,262 @@ +// +// ViewController.m +// Recipe 10-4: Playing Background Audio +// +// Created by joseph hoffman on 8/27/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.session = [AVAudioSession sharedInstance]; + NSError *error; + [self.session setCategory:AVAudioSessionCategoryPlayback error:&error]; + if (error) + { + NSLog(@"Error setting audio session category: %@", error); + } + [self.session setActive:YES error:&error]; + if (error) + { + NSLog(@"Error activating audio session: %@", error); + } + + self.playlist = [[NSMutableArray alloc] init]; + self.player = [[AVPlayer alloc] init]; + +} +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; + [self becomeFirstResponder]; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [[UIApplication sharedApplication] endReceivingRemoteControlEvents]; + [self resignFirstResponder]; + [super viewWillDisappear:animated]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(BOOL)canBecomeFirstResponder +{ + return YES; +} + +- (IBAction)queueFromLibrary:(id)sender +{ + MPMediaPickerController *picker = + [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic]; + picker.delegate = self; + picker.allowsPickingMultipleItems = YES; + picker.prompt = @"Choose Some Music!"; + [self presentViewController:picker animated:YES completion:NULL]; +} + +- (IBAction)goToPrevTrack:(id)sender { + if (self.playlist.count == 0) + return; + + if (CMTimeCompare(self.player.currentTime, CMTimeMake(5.0, 1)) > 0) + { + [self.player seekToTime:kCMTimeZero]; + } + else + { + if (self.currentIndex == 0) + { + self.currentIndex = self.playlist.count - 1; + } + else + { + self.currentIndex -= 1; + } + MPMediaItem *previousItem = [self.playlist objectAtIndex:self.currentIndex]; + [self startPlaybackWithItem:previousItem]; + } +} + +- (IBAction)togglePlay:(id)sender { + if (self.playlist.count > 0) + { + if (self.player.currentItem == nil) + { + [self startPlaybackWithItem:[self.playlist objectAtIndex:0]]; + } + else + { + // Player has an item, pause or resume playing it + BOOL isPlaying = self.player.currentItem && self.player.rate != 0; + if (isPlaying) + { + [self pausePlayback]; + } + else + { + [self startPlayback]; + } + } + } +} + +- (IBAction)goToNextTrack:(id)sender +{ + if (self.playlist.count == 0) + return; + + if (self.currentIndex == self.playlist.count - 1) + { + self.currentIndex = 0; + } + else + { + self.currentIndex += 1; + } + MPMediaItem *nextItem = [self.playlist objectAtIndex:self.currentIndex]; + [self startPlaybackWithItem: nextItem]; +} + +- (IBAction)clearPlaylist:(id)sender +{ + [self.player replaceCurrentItemWithPlayerItem:nil]; + [self.playlist removeAllObjects]; + [self updateNowPlaying]; + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; +} + +#pragma mark - delegate methods + +- (void)remoteControlReceivedWithEvent: (UIEvent *) receivedEvent +{ + if (receivedEvent.type == UIEventTypeRemoteControl) + { + switch (receivedEvent.subtype) + { + case UIEventSubtypeRemoteControlTogglePlayPause: + [self togglePlay:self]; + break; + + case UIEventSubtypeRemoteControlPreviousTrack: + [self goToPrevTrack:self]; + break; + + case UIEventSubtypeRemoteControlNextTrack: + [self goToNextTrack:self]; + break; + + default: + break; + } + } +} + +-(void)mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection +{ + BOOL shallStartPlayer = self.playlist.count == 0; + + [self.playlist addObjectsFromArray:mediaItemCollection.items]; + + if (shallStartPlayer) + [self startPlaybackWithItem:[self.playlist objectAtIndex:0]]; + + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(void)startPlaybackWithItem:(MPMediaItem *)mpItem +{ + [self.player replaceCurrentItemWithPlayerItem:[self avItemFromMPItem:mpItem]]; + [self.player seekToTime:kCMTimeZero]; + [self startPlayback]; +} + +-(AVPlayerItem *)avItemFromMPItem:(MPMediaItem *)mpItem +{ + NSURL *url = [mpItem valueForProperty:MPMediaItemPropertyAssetURL]; + + AVPlayerItem *item = [AVPlayerItem playerItemWithURL:url]; + + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(playerItemDidReachEnd:) + name:AVPlayerItemDidPlayToEndTimeNotification + object:item]; + + return item; +} + +- (void)playerItemDidReachEnd:(NSNotification *)notification +{ + [self goToNextTrack:self]; +} + +-(void)startPlayback +{ + [self.player play]; + [self.playButton setTitle:@"Pause" forState:UIControlStateNormal]; + [self updateNowPlaying]; +} +-(void)updateNowPlaying +{ + if (self.player.currentItem != nil) + { + MPMediaItem *currentMPItem = [self.playlist objectAtIndex:self.currentIndex]; + + self.infoLabel.text = + [NSString stringWithFormat:@"%@ - %@", + [currentMPItem valueForProperty:MPMediaItemPropertyTitle], + [currentMPItem valueForProperty:MPMediaItemPropertyArtist]]; + + UIImage *artwork = + [[currentMPItem valueForProperty:MPMediaItemPropertyArtwork] + imageWithSize:self.artworkImageView.frame.size]; + self.artworkImageView.image = artwork; + + NSString *title = [currentMPItem valueForProperty:MPMediaItemPropertyTitle]; + NSString *artist = + [currentMPItem valueForProperty:MPMediaItemPropertyArtist]; + NSString *album = + [currentMPItem valueForProperty:MPMediaItemPropertyAlbumTitle]; + + NSDictionary *mediaInfo = + [NSDictionary dictionaryWithObjectsAndKeys: + artist, MPMediaItemPropertyArtist, + title, MPMediaItemPropertyTitle, + album, MPMediaItemPropertyAlbumTitle, + [currentMPItem valueForProperty:MPMediaItemPropertyArtwork], + MPMediaItemPropertyArtwork, + nil]; + [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = mediaInfo; + } + else + { + self.infoLabel.text = @"..."; + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; + self.artworkImageView.image = nil; + } +} + +-(void)pausePlayback +{ + [self.player pause]; + [self.playButton setTitle:@"Play" forState:UIControlStateNormal]; +} + + + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/main.m b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/main.m new file mode 100644 index 0000000..24b7ca1 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background Audio/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 10-4 Playing Background Audio +// +// Created by joseph hoffman on 8/27/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/Recipe 10-4 Playing Background AudioTests-Info.plist b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/Recipe 10-4 Playing Background AudioTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/Recipe 10-4 Playing Background AudioTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/Recipe_10_4_Playing_Background_AudioTests.m b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/Recipe_10_4_Playing_Background_AudioTests.m new file mode 100644 index 0000000..39e19fc --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/Recipe_10_4_Playing_Background_AudioTests.m @@ -0,0 +1,34 @@ +// +// Recipe_10_4_Playing_Background_AudioTests.m +// Recipe 10-4 Playing Background AudioTests +// +// Created by joseph hoffman on 8/27/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_10_4_Playing_Background_AudioTests : XCTestCase + +@end + +@implementation Recipe_10_4_Playing_Background_AudioTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/en.lproj/InfoPlist.strings b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH10 - Multimedia Recipes/Recipe 10-4 Playing Background Audio/Recipe 10-4 Playing Background AudioTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.pbxproj b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5814234 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88E080F517CFBF99008D2206 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F417CFBF99008D2206 /* Foundation.framework */; }; + 88E080F717CFBF99008D2206 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F617CFBF99008D2206 /* CoreGraphics.framework */; }; + 88E080F917CFBF99008D2206 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F817CFBF99008D2206 /* UIKit.framework */; }; + 88E080FF17CFBF99008D2206 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E080FD17CFBF99008D2206 /* InfoPlist.strings */; }; + 88E0810117CFBF99008D2206 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810017CFBF99008D2206 /* main.m */; }; + 88E0810517CFBF99008D2206 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810417CFBF99008D2206 /* AppDelegate.m */; }; + 88E0810817CFBF99008D2206 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88E0810617CFBF99008D2206 /* Main.storyboard */; }; + 88E0810B17CFBF99008D2206 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810A17CFBF99008D2206 /* MasterViewController.m */; }; + 88E0810E17CFBF99008D2206 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810D17CFBF99008D2206 /* DetailViewController.m */; }; + 88E0811017CFBF9A008D2206 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88E0810F17CFBF9A008D2206 /* Images.xcassets */; }; + 88E0811717CFBF9A008D2206 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E0811617CFBF9A008D2206 /* XCTest.framework */; }; + 88E0811817CFBF9A008D2206 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F417CFBF99008D2206 /* Foundation.framework */; }; + 88E0811917CFBF9A008D2206 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F817CFBF99008D2206 /* UIKit.framework */; }; + 88E0812117CFBF9A008D2206 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */; }; + 88E0812317CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88E0811A17CFBF9A008D2206 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88E080E917CFBF99008D2206 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E080F017CFBF99008D2206; + remoteInfo = "Recipe 11-1 Using Image Views"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88E080F117CFBF99008D2206 /* Recipe 11-1 Using Image Views.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 11-1 Using Image Views.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E080F417CFBF99008D2206 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88E080F617CFBF99008D2206 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88E080F817CFBF99008D2206 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88E080FC17CFBF99008D2206 /* Recipe 11-1 Using Image Views-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-1 Using Image Views-Info.plist"; sourceTree = ""; }; + 88E080FE17CFBF99008D2206 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E0810017CFBF99008D2206 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88E0810217CFBF99008D2206 /* Recipe 11-1 Using Image Views-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 11-1 Using Image Views-Prefix.pch"; sourceTree = ""; }; + 88E0810317CFBF99008D2206 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88E0810417CFBF99008D2206 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88E0810717CFBF99008D2206 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88E0810917CFBF99008D2206 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; + 88E0810A17CFBF99008D2206 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; + 88E0810C17CFBF99008D2206 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; + 88E0810D17CFBF99008D2206 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; + 88E0810F17CFBF9A008D2206 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88E0811517CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 11-1 Using Image ViewsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E0811617CFBF9A008D2206 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88E0811E17CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-1 Using Image ViewsTests-Info.plist"; sourceTree = ""; }; + 88E0812017CFBF9A008D2206 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_11_1_Using_Image_ViewsTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88E080EE17CFBF99008D2206 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E080F717CFBF99008D2206 /* CoreGraphics.framework in Frameworks */, + 88E080F917CFBF99008D2206 /* UIKit.framework in Frameworks */, + 88E080F517CFBF99008D2206 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811217CFBF9A008D2206 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0811717CFBF9A008D2206 /* XCTest.framework in Frameworks */, + 88E0811917CFBF9A008D2206 /* UIKit.framework in Frameworks */, + 88E0811817CFBF9A008D2206 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88E080E817CFBF99008D2206 = { + isa = PBXGroup; + children = ( + 88E080FA17CFBF99008D2206 /* Recipe 11-1 Using Image Views */, + 88E0811C17CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests */, + 88E080F317CFBF99008D2206 /* Frameworks */, + 88E080F217CFBF99008D2206 /* Products */, + ); + sourceTree = ""; + }; + 88E080F217CFBF99008D2206 /* Products */ = { + isa = PBXGroup; + children = ( + 88E080F117CFBF99008D2206 /* Recipe 11-1 Using Image Views.app */, + 88E0811517CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88E080F317CFBF99008D2206 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88E080F417CFBF99008D2206 /* Foundation.framework */, + 88E080F617CFBF99008D2206 /* CoreGraphics.framework */, + 88E080F817CFBF99008D2206 /* UIKit.framework */, + 88E0811617CFBF9A008D2206 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88E080FA17CFBF99008D2206 /* Recipe 11-1 Using Image Views */ = { + isa = PBXGroup; + children = ( + 88E0810317CFBF99008D2206 /* AppDelegate.h */, + 88E0810417CFBF99008D2206 /* AppDelegate.m */, + 88E0810617CFBF99008D2206 /* Main.storyboard */, + 88E0810917CFBF99008D2206 /* MasterViewController.h */, + 88E0810A17CFBF99008D2206 /* MasterViewController.m */, + 88E0810C17CFBF99008D2206 /* DetailViewController.h */, + 88E0810D17CFBF99008D2206 /* DetailViewController.m */, + 88E0810F17CFBF9A008D2206 /* Images.xcassets */, + 88E080FB17CFBF99008D2206 /* Supporting Files */, + ); + path = "Recipe 11-1 Using Image Views"; + sourceTree = ""; + }; + 88E080FB17CFBF99008D2206 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E080FC17CFBF99008D2206 /* Recipe 11-1 Using Image Views-Info.plist */, + 88E080FD17CFBF99008D2206 /* InfoPlist.strings */, + 88E0810017CFBF99008D2206 /* main.m */, + 88E0810217CFBF99008D2206 /* Recipe 11-1 Using Image Views-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88E0811C17CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests */ = { + isa = PBXGroup; + children = ( + 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */, + 88E0811D17CFBF9A008D2206 /* Supporting Files */, + ); + path = "Recipe 11-1 Using Image ViewsTests"; + sourceTree = ""; + }; + 88E0811D17CFBF9A008D2206 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E0811E17CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests-Info.plist */, + 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88E080F017CFBF99008D2206 /* Recipe 11-1 Using Image Views */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E0812617CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-1 Using Image Views" */; + buildPhases = ( + 88E080ED17CFBF99008D2206 /* Sources */, + 88E080EE17CFBF99008D2206 /* Frameworks */, + 88E080EF17CFBF99008D2206 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 11-1 Using Image Views"; + productName = "Recipe 11-1 Using Image Views"; + productReference = 88E080F117CFBF99008D2206 /* Recipe 11-1 Using Image Views.app */; + productType = "com.apple.product-type.application"; + }; + 88E0811417CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E0812917CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-1 Using Image ViewsTests" */; + buildPhases = ( + 88E0811117CFBF9A008D2206 /* Sources */, + 88E0811217CFBF9A008D2206 /* Frameworks */, + 88E0811317CFBF9A008D2206 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88E0811B17CFBF9A008D2206 /* PBXTargetDependency */, + ); + name = "Recipe 11-1 Using Image ViewsTests"; + productName = "Recipe 11-1 Using Image ViewsTests"; + productReference = 88E0811517CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88E080E917CFBF99008D2206 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88E0811417CFBF9A008D2206 = { + TestTargetID = 88E080F017CFBF99008D2206; + }; + }; + }; + buildConfigurationList = 88E080EC17CFBF99008D2206 /* Build configuration list for PBXProject "Recipe 11-1 Using Image Views" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88E080E817CFBF99008D2206; + productRefGroup = 88E080F217CFBF99008D2206 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E080F017CFBF99008D2206 /* Recipe 11-1 Using Image Views */, + 88E0811417CFBF9A008D2206 /* Recipe 11-1 Using Image ViewsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88E080EF17CFBF99008D2206 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0811017CFBF9A008D2206 /* Images.xcassets in Resources */, + 88E080FF17CFBF99008D2206 /* InfoPlist.strings in Resources */, + 88E0810817CFBF99008D2206 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811317CFBF9A008D2206 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0812117CFBF9A008D2206 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88E080ED17CFBF99008D2206 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0810517CFBF99008D2206 /* AppDelegate.m in Sources */, + 88E0810B17CFBF99008D2206 /* MasterViewController.m in Sources */, + 88E0810117CFBF99008D2206 /* main.m in Sources */, + 88E0810E17CFBF99008D2206 /* DetailViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811117CFBF9A008D2206 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0812317CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88E0811B17CFBF9A008D2206 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88E080F017CFBF99008D2206 /* Recipe 11-1 Using Image Views */; + targetProxy = 88E0811A17CFBF9A008D2206 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88E080FD17CFBF99008D2206 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E080FE17CFBF99008D2206 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88E0810617CFBF99008D2206 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88E0810717CFBF99008D2206 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E0812017CFBF9A008D2206 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88E0812417CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + }; + name = Debug; + }; + 88E0812517CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88E0812717CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88E0812817CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88E0812A17CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-1 Using Image Views.app/Recipe 11-1 Using Image Views"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 11-1 Using Image ViewsTests/Recipe 11-1 Using Image ViewsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88E0812B17CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-1 Using Image Views.app/Recipe 11-1 Using Image Views"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image ViewsTests/Recipe 11-1 Using Image ViewsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88E080EC17CFBF99008D2206 /* Build configuration list for PBXProject "Recipe 11-1 Using Image Views" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812417CFBF9A008D2206 /* Debug */, + 88E0812517CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E0812617CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-1 Using Image Views" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812717CFBF9A008D2206 /* Debug */, + 88E0812817CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 88E0812917CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-1 Using Image ViewsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812A17CFBF9A008D2206 /* Debug */, + 88E0812B17CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88E080E917CFBF99008D2206 /* Project object */; +} diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3f75aed --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..4ca63db Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme new file mode 100644 index 0000000..01f7ce0 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1dc3850 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 11-1 Using Image Views.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88E080F017CFBF99008D2206 + + primary + + + 88E0811417CFBF9A008D2206 + + primary + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/AppDelegate.h b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/AppDelegate.h new file mode 100644 index 0000000..6a484fc --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/AppDelegate.m b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/AppDelegate.m new file mode 100644 index 0000000..17e540c --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/AppDelegate.m @@ -0,0 +1,49 @@ +// +// AppDelegate.m +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; + UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; + splitViewController.delegate = (id)navigationController.topViewController; + 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/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard new file mode 100644 index 0000000..6e6d217 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/DetailViewController.h b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/DetailViewController.h new file mode 100644 index 0000000..b30ae86 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/DetailViewController.h @@ -0,0 +1,26 @@ +// +// DetailViewController.h +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface DetailViewController : UIViewController + +@property (strong, nonatomic) id detailItem; + +@property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; + +@property (strong, nonatomic) UIPopoverController *pop; + +- (IBAction)selectImage:(id)sender; +- (IBAction)clearImage:(id)sender; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/DetailViewController.m b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/DetailViewController.m new file mode 100644 index 0000000..1a761c4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/DetailViewController.m @@ -0,0 +1,108 @@ +// +// DetailViewController.m +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "DetailViewController.h" + +@interface DetailViewController () +@property (strong, nonatomic) UIPopoverController *masterPopoverController; +- (void)configureView; +@end + +@implementation DetailViewController + +#pragma mark - Managing the detail item + +- (void)setDetailItem:(id)newDetailItem +{ + if (_detailItem != newDetailItem) { + _detailItem = newDetailItem; + + // Update the view. + [self configureView]; + } + + if (self.masterPopoverController != nil) { + [self.masterPopoverController dismissPopoverAnimated:YES]; + } +} + +- (void)configureView +{ + // Update the user interface for the detail item. + + if (self.detailItem) { + self.detailDescriptionLabel.text = [self.detailItem description]; + } +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + [self configureView]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Split view + +- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController +{ + barButtonItem.title = NSLocalizedString(@"Master", @"Master"); + [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; + self.masterPopoverController = popoverController; +} + +- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +{ + // Called when the view is shown again in the split view, invalidating the button and popover controller. + [self.navigationItem setLeftBarButtonItem:nil animated:YES]; + self.masterPopoverController = nil; +} + +#pragma mark - actions +- (IBAction)selectImage:(UIButton*)sender +{ + UIImagePickerController *picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + picker.delegate = self; + + self.pop = [[UIPopoverController alloc] initWithContentViewController:picker]; + self.pop.delegate = self; + [self.pop presentPopoverFromRect:sender.frame inView:self.view + permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; + } +} + +- (IBAction)clearImage:(id)sender +{ + self.imageView.image = nil; +} + +#pragma mark - delegate methods + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.pop dismissPopoverAnimated:YES]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + UIImage *image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.image = image; + + [self.pop dismissPopoverAnimated:YES]; +} +@end diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a4645e6 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..a0ad363 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,36 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/MasterViewController.h b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/MasterViewController.h new file mode 100644 index 0000000..63bcf0c --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/MasterViewController.h @@ -0,0 +1,17 @@ +// +// MasterViewController.h +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@class DetailViewController; + +@interface MasterViewController : UITableViewController + +@property (strong, nonatomic) DetailViewController *detailViewController; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/MasterViewController.m b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/MasterViewController.m new file mode 100644 index 0000000..275f705 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/MasterViewController.m @@ -0,0 +1,113 @@ +// +// MasterViewController.m +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MasterViewController.h" + +#import "DetailViewController.h" + +@interface MasterViewController () { + NSMutableArray *_objects; +} +@end + +@implementation MasterViewController + +- (void)awakeFromNib +{ + self.clearsSelectionOnViewWillAppear = NO; + self.preferredContentSize = CGSizeMake(320.0, 600.0); + [super awakeFromNib]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.navigationItem.leftBarButtonItem = self.editButtonItem; + + UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)]; + self.navigationItem.rightBarButtonItem = addButton; + self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)insertNewObject:(id)sender +{ + if (!_objects) { + _objects = [[NSMutableArray alloc] init]; + } + [_objects insertObject:[NSDate date] atIndex:0]; + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; + [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; +} + +#pragma mark - Table View + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return _objects.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + + NSDate *object = _objects[indexPath.row]; + cell.textLabel.text = [object description]; + return cell; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Return NO if you do not want the specified item to be editable. + return YES; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) { + [_objects removeObjectAtIndex:indexPath.row]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. + } +} + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath +{ +} +*/ + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSDate *object = _objects[indexPath.row]; + self.detailViewController.detailItem = object; +} + +@end diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Info.plist b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Info.plist new file mode 100644 index 0000000..37e39f3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Info.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/main.m b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/main.m new file mode 100644 index 0000000..31d40e3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/Recipe 11-1 Using Image ViewsTests-Info.plist b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/Recipe 11-1 Using Image ViewsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/Recipe 11-1 Using Image ViewsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m new file mode 100644 index 0000000..bcfed88 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_11_1_Using_Image_ViewsTests.m +// Recipe 11-1 Using Image ViewsTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_11_1_Using_Image_ViewsTests : XCTestCase + +@end + +@implementation Recipe_11_1_Using_Image_ViewsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-1 Using Image Views/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/.DS_Store b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/.DS_Store new file mode 100644 index 0000000..b32ad99 Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/.DS_Store differ diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/AppDelegate.h b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/AppDelegate.h new file mode 100644 index 0000000..7602c89 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 11-2 Scaling Images +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/AppDelegate.m b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/AppDelegate.m new file mode 100644 index 0000000..dfebb5f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/AppDelegate.m @@ -0,0 +1,49 @@ +// +// AppDelegate.m +// Recipe 11-2 Scaling Images +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; + UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; + splitViewController.delegate = (id)navigationController.topViewController; + 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/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ff1e3da --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/DetailViewController.h b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/DetailViewController.h new file mode 100644 index 0000000..76ab1f4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/DetailViewController.h @@ -0,0 +1,42 @@ +// +// DetailViewController.h +// Recipe 11-2 Scaling Images +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@protocol DetailViewControllerDelegateProtocol; + +@interface DetailViewController : UIViewController + +@property (nonatomic, weak) id delegate; + +@property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; + +@property (nonatomic, strong) IBOutlet UIButton *selectImageButton; +@property (nonatomic, strong) IBOutlet UIButton *clearImageButton; + +@property (strong, nonatomic) UIPopoverController *pop; + +- (IBAction)selectImage:(id)sender; +- (IBAction)clearImage:(id)sender; + +- (void)configureDetailsWithImage:(UIImage *)image label:(NSString *)label showsButtons:(BOOL)showsButton; + +@end + + + +@protocol DetailViewControllerDelegateProtocol + +- (void)detailViewController:(DetailViewController *)controller didSelectImage:(UIImage *)image; +- (void)detailViewControllerDidClearImage:(DetailViewController *)controller; + +@end \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/DetailViewController.m b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/DetailViewController.m new file mode 100644 index 0000000..d1d634e --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/DetailViewController.m @@ -0,0 +1,103 @@ +// +// DetailViewController.m +// Recipe 11-2 Scaling Images +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "DetailViewController.h" + +@interface DetailViewController () + +@property (strong, nonatomic) UIPopoverController *masterPopoverController; + +@end + +@implementation DetailViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Public + +- (void)configureDetailsWithImage:(UIImage *)image label:(NSString *)label showsButtons:(BOOL)showsButton +{ + self.imageView.image = image; + self.detailDescriptionLabel.text = label; + if (showsButton == NO) + { + self.selectImageButton.hidden = YES; + self.clearImageButton.hidden = YES; + } + else if (showsButton == YES) + { + self.selectImageButton.hidden = NO; + self.clearImageButton.hidden = NO; + } +} + +#pragma mark - Split view + +- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController +{ + barButtonItem.title = NSLocalizedString(@"Master", @"Master"); + [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; + self.masterPopoverController = popoverController; +} + +- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +{ + // Called when the view is shown again in the split view, invalidating the button and popover controller. + [self.navigationItem setLeftBarButtonItem:nil animated:YES]; + self.masterPopoverController = nil; +} + +#pragma mark - actions +- (IBAction)selectImage:(UIButton *)sender +{ + UIImagePickerController *picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + picker.delegate = self; + + self.pop = [[UIPopoverController alloc] initWithContentViewController:picker]; + self.pop.delegate = self; + [self.pop presentPopoverFromRect:sender.frame inView:self.view + permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; + } +} + +- (IBAction)clearImage:(id)sender +{ + self.imageView.image = nil; + [self.delegate detailViewControllerDidClearImage:self]; +} + +#pragma mark - delegate methods + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.pop dismissPopoverAnimated:YES]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + UIImage *image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.image = image; + + [self.pop dismissPopoverAnimated:YES]; + + [self.delegate detailViewController:self didSelectImage:image]; +} +@end diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a4645e6 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..a0ad363 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,36 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/MasterViewController.h b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/MasterViewController.h new file mode 100644 index 0000000..17a8ea8 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/MasterViewController.h @@ -0,0 +1,19 @@ +// +// MasterViewController.h +// Recipe 11-2 Scaling Images +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "DetailViewController.h" + +@class DetailViewController; + +@interface MasterViewController : UITableViewController + +@property (strong, nonatomic) DetailViewController *detailViewController; +@property (nonatomic, strong) UIImage *mainImage; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/MasterViewController.m b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/MasterViewController.m new file mode 100644 index 0000000..b8e127f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/MasterViewController.m @@ -0,0 +1,143 @@ +// +// MasterViewController.m +// Recipe 11-2 Scaling Images +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MasterViewController.h" + + +@interface MasterViewController () + + + +@end + +@implementation MasterViewController + +- (void)awakeFromNib +{ + self.clearsSelectionOnViewWillAppear = NO; + self.preferredContentSize = CGSizeMake(320.0, 600.0); + [super awakeFromNib]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; + self.detailViewController.delegate = self; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Class + +-(UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)size +{ + UIGraphicsBeginImageContext(size); + [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; + UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return scaledImage; +} + +-(UIImage *)aspectScaleImage:(UIImage *)image toSize:(CGSize)size +{ + if (image.size.height < image.size.width) + { + float ratio = size.height / image.size.height; + CGSize newSize = CGSizeMake(image.size.width * ratio, size.height); + UIGraphicsBeginImageContext(newSize); + [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; + } + else { + float ratio = size.width / image.size.width; + CGSize newSize = CGSizeMake(size.width, image.size.height * ratio); + UIGraphicsBeginImageContext(newSize); + [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; + } + UIImage *aspectScaledImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return aspectScaledImage; +} + +#pragma mark - Table View + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + if (self.mainImage == nil) + return 1; + else + return 3; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + + if (indexPath.row == 0) + cell.textLabel.text = NSLocalizedString(@"Selected Image", @"Detail"); + else if (indexPath.row == 1) + cell.textLabel.text = NSLocalizedString(@"Resized Image", @"Detail"); + else if (indexPath.row == 2) + cell.textLabel.text = NSLocalizedString(@"Scaled Image", @"Detail"); + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (self.mainImage != nil) + { + UIImage *image; + NSString *label; + BOOL showsButtons = NO; + if (indexPath.row == 0) + { + image = self.mainImage; + label = @"Select an Image to Display"; + showsButtons = YES; + } + else if (indexPath.row == 1) + { + image = [self scaleImage:self.mainImage + toSize:self.detailViewController.imageView.frame.size]; + label = @"Chosen Image Resized"; + } + else if (indexPath.row == 2) + { + image = [self aspectScaleImage:self.mainImage + toSize:self.detailViewController.imageView.frame.size]; + label = @"Chosen Image Scaled"; + } + [self.detailViewController configureDetailsWithImage:image label:label + showsButtons:showsButtons]; + } +} + +#pragma mark - DetailViewControllerDelegateProtocol + +- (void)detailViewController:(DetailViewController *)controller didSelectImage:(UIImage *)image +{ + self.mainImage = image; + [self.tableView reloadData]; +} + +- (void)detailViewControllerDidClearImage:(DetailViewController *)controller +{ + self.mainImage = nil; + [self.tableView reloadData]; +} + +@end diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Info.plist b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Info.plist new file mode 100644 index 0000000..37e39f3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Info.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Prefix.pch b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/main.m b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/main.m new file mode 100644 index 0000000..31d40e3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image Views/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/Recipe 11-2 Scaling ImagesTests-Info.plist b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/Recipe 11-2 Scaling ImagesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/Recipe 11-2 Scaling ImagesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m new file mode 100644 index 0000000..bcfed88 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_11_1_Using_Image_ViewsTests.m +// Recipe 11-1 Using Image ViewsTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_11_1_Using_Image_ViewsTests : XCTestCase + +@end + +@implementation Recipe_11_1_Using_Image_ViewsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.pbxproj b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.pbxproj new file mode 100644 index 0000000..db90fdc --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.pbxproj @@ -0,0 +1,485 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88BB65F317E2B13400F11FEA /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB65F217E2B13400F11FEA /* CoreImage.framework */; }; + 88E080F517CFBF99008D2206 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F417CFBF99008D2206 /* Foundation.framework */; }; + 88E080F717CFBF99008D2206 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F617CFBF99008D2206 /* CoreGraphics.framework */; }; + 88E080F917CFBF99008D2206 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F817CFBF99008D2206 /* UIKit.framework */; }; + 88E080FF17CFBF99008D2206 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E080FD17CFBF99008D2206 /* InfoPlist.strings */; }; + 88E0810117CFBF99008D2206 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810017CFBF99008D2206 /* main.m */; }; + 88E0810517CFBF99008D2206 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810417CFBF99008D2206 /* AppDelegate.m */; }; + 88E0810817CFBF99008D2206 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88E0810617CFBF99008D2206 /* Main.storyboard */; }; + 88E0810B17CFBF99008D2206 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810A17CFBF99008D2206 /* MasterViewController.m */; }; + 88E0810E17CFBF99008D2206 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810D17CFBF99008D2206 /* DetailViewController.m */; }; + 88E0811017CFBF9A008D2206 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88E0810F17CFBF9A008D2206 /* Images.xcassets */; }; + 88E0811717CFBF9A008D2206 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E0811617CFBF9A008D2206 /* XCTest.framework */; }; + 88E0811817CFBF9A008D2206 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F417CFBF99008D2206 /* Foundation.framework */; }; + 88E0811917CFBF9A008D2206 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F817CFBF99008D2206 /* UIKit.framework */; }; + 88E0812117CFBF9A008D2206 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */; }; + 88E0812317CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88E0811A17CFBF9A008D2206 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88E080E917CFBF99008D2206 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E080F017CFBF99008D2206; + remoteInfo = "Recipe 11-1 Using Image Views"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88BB65F217E2B13400F11FEA /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; + 88E080F117CFBF99008D2206 /* Recipe 11-2 Scaling Images.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 11-2 Scaling Images.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E080F417CFBF99008D2206 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88E080F617CFBF99008D2206 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88E080F817CFBF99008D2206 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88E080FC17CFBF99008D2206 /* Recipe 11-2 Scaling Images-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-2 Scaling Images-Info.plist"; sourceTree = ""; }; + 88E080FE17CFBF99008D2206 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E0810017CFBF99008D2206 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88E0810217CFBF99008D2206 /* Recipe 11-2 Scaling Images-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 11-2 Scaling Images-Prefix.pch"; sourceTree = ""; }; + 88E0810317CFBF99008D2206 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88E0810417CFBF99008D2206 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88E0810717CFBF99008D2206 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88E0810917CFBF99008D2206 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; + 88E0810A17CFBF99008D2206 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; + 88E0810C17CFBF99008D2206 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; + 88E0810D17CFBF99008D2206 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; + 88E0810F17CFBF9A008D2206 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88E0811517CFBF9A008D2206 /* Recipe 11-2 Scaling ImagesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 11-2 Scaling ImagesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E0811617CFBF9A008D2206 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88E0811E17CFBF9A008D2206 /* Recipe 11-2 Scaling ImagesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-2 Scaling ImagesTests-Info.plist"; sourceTree = ""; }; + 88E0812017CFBF9A008D2206 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_11_1_Using_Image_ViewsTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88E080EE17CFBF99008D2206 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB65F317E2B13400F11FEA /* CoreImage.framework in Frameworks */, + 88E080F717CFBF99008D2206 /* CoreGraphics.framework in Frameworks */, + 88E080F917CFBF99008D2206 /* UIKit.framework in Frameworks */, + 88E080F517CFBF99008D2206 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811217CFBF9A008D2206 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0811717CFBF9A008D2206 /* XCTest.framework in Frameworks */, + 88E0811917CFBF9A008D2206 /* UIKit.framework in Frameworks */, + 88E0811817CFBF9A008D2206 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88E080E817CFBF99008D2206 = { + isa = PBXGroup; + children = ( + 88E080FA17CFBF99008D2206 /* Recipe 11-2 Scaling Images */, + 88E0811C17CFBF9A008D2206 /* Recipe 11-2 Scaling Images Tests */, + 88E080F317CFBF99008D2206 /* Frameworks */, + 88E080F217CFBF99008D2206 /* Products */, + ); + sourceTree = ""; + }; + 88E080F217CFBF99008D2206 /* Products */ = { + isa = PBXGroup; + children = ( + 88E080F117CFBF99008D2206 /* Recipe 11-2 Scaling Images.app */, + 88E0811517CFBF9A008D2206 /* Recipe 11-2 Scaling ImagesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88E080F317CFBF99008D2206 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88BB65F217E2B13400F11FEA /* CoreImage.framework */, + 88E080F417CFBF99008D2206 /* Foundation.framework */, + 88E080F617CFBF99008D2206 /* CoreGraphics.framework */, + 88E080F817CFBF99008D2206 /* UIKit.framework */, + 88E0811617CFBF9A008D2206 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88E080FA17CFBF99008D2206 /* Recipe 11-2 Scaling Images */ = { + isa = PBXGroup; + children = ( + 88E0810317CFBF99008D2206 /* AppDelegate.h */, + 88E0810417CFBF99008D2206 /* AppDelegate.m */, + 88E0810617CFBF99008D2206 /* Main.storyboard */, + 88E0810917CFBF99008D2206 /* MasterViewController.h */, + 88E0810A17CFBF99008D2206 /* MasterViewController.m */, + 88E0810C17CFBF99008D2206 /* DetailViewController.h */, + 88E0810D17CFBF99008D2206 /* DetailViewController.m */, + 88E0810F17CFBF9A008D2206 /* Images.xcassets */, + 88E080FB17CFBF99008D2206 /* Supporting Files */, + ); + name = "Recipe 11-2 Scaling Images"; + path = "Recipe 11-1 Using Image Views"; + sourceTree = ""; + }; + 88E080FB17CFBF99008D2206 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E080FC17CFBF99008D2206 /* Recipe 11-2 Scaling Images-Info.plist */, + 88E080FD17CFBF99008D2206 /* InfoPlist.strings */, + 88E0810017CFBF99008D2206 /* main.m */, + 88E0810217CFBF99008D2206 /* Recipe 11-2 Scaling Images-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88E0811C17CFBF9A008D2206 /* Recipe 11-2 Scaling Images Tests */ = { + isa = PBXGroup; + children = ( + 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */, + 88E0811D17CFBF9A008D2206 /* Supporting Files */, + ); + name = "Recipe 11-2 Scaling Images Tests"; + path = "Recipe 11-1 Using Image ViewsTests"; + sourceTree = ""; + }; + 88E0811D17CFBF9A008D2206 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E0811E17CFBF9A008D2206 /* Recipe 11-2 Scaling ImagesTests-Info.plist */, + 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88E080F017CFBF99008D2206 /* Recipe 11-2 Scaling Images */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E0812617CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-2 Scaling Images" */; + buildPhases = ( + 88E080ED17CFBF99008D2206 /* Sources */, + 88E080EE17CFBF99008D2206 /* Frameworks */, + 88E080EF17CFBF99008D2206 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 11-2 Scaling Images"; + productName = "Recipe 11-1 Using Image Views"; + productReference = 88E080F117CFBF99008D2206 /* Recipe 11-2 Scaling Images.app */; + productType = "com.apple.product-type.application"; + }; + 88E0811417CFBF9A008D2206 /* Recipe 11-2 Scaling ImagesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E0812917CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-2 Scaling ImagesTests" */; + buildPhases = ( + 88E0811117CFBF9A008D2206 /* Sources */, + 88E0811217CFBF9A008D2206 /* Frameworks */, + 88E0811317CFBF9A008D2206 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88E0811B17CFBF9A008D2206 /* PBXTargetDependency */, + ); + name = "Recipe 11-2 Scaling ImagesTests"; + productName = "Recipe 11-1 Using Image ViewsTests"; + productReference = 88E0811517CFBF9A008D2206 /* Recipe 11-2 Scaling ImagesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88E080E917CFBF99008D2206 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88E0811417CFBF9A008D2206 = { + TestTargetID = 88E080F017CFBF99008D2206; + }; + }; + }; + buildConfigurationList = 88E080EC17CFBF99008D2206 /* Build configuration list for PBXProject "Recipe 11-2 Scaling Images" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88E080E817CFBF99008D2206; + productRefGroup = 88E080F217CFBF99008D2206 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E080F017CFBF99008D2206 /* Recipe 11-2 Scaling Images */, + 88E0811417CFBF9A008D2206 /* Recipe 11-2 Scaling ImagesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88E080EF17CFBF99008D2206 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0811017CFBF9A008D2206 /* Images.xcassets in Resources */, + 88E080FF17CFBF99008D2206 /* InfoPlist.strings in Resources */, + 88E0810817CFBF99008D2206 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811317CFBF9A008D2206 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0812117CFBF9A008D2206 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88E080ED17CFBF99008D2206 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0810517CFBF99008D2206 /* AppDelegate.m in Sources */, + 88E0810B17CFBF99008D2206 /* MasterViewController.m in Sources */, + 88E0810117CFBF99008D2206 /* main.m in Sources */, + 88E0810E17CFBF99008D2206 /* DetailViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811117CFBF9A008D2206 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0812317CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88E0811B17CFBF9A008D2206 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88E080F017CFBF99008D2206 /* Recipe 11-2 Scaling Images */; + targetProxy = 88E0811A17CFBF9A008D2206 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88E080FD17CFBF99008D2206 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E080FE17CFBF99008D2206 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88E0810617CFBF99008D2206 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88E0810717CFBF99008D2206 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E0812017CFBF9A008D2206 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88E0812417CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + }; + name = Debug; + }; + 88E0812517CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88E0812717CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Info.plist"; + PRODUCT_NAME = "Recipe 11-2 Scaling Images"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88E0812817CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image Views/Recipe 11-2 Scaling Images-Info.plist"; + PRODUCT_NAME = "Recipe 11-2 Scaling Images"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88E0812A17CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-1 Using Image Views.app/Recipe 11-1 Using Image Views"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 11-1 Using Image ViewsTests/Recipe 11-2 Scaling ImagesTests-Info.plist"; + PRODUCT_NAME = "Recipe 11-2 Scaling ImagesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88E0812B17CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-1 Using Image Views.app/Recipe 11-1 Using Image Views"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image ViewsTests/Recipe 11-2 Scaling ImagesTests-Info.plist"; + PRODUCT_NAME = "Recipe 11-2 Scaling ImagesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88E080EC17CFBF99008D2206 /* Build configuration list for PBXProject "Recipe 11-2 Scaling Images" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812417CFBF9A008D2206 /* Debug */, + 88E0812517CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E0812617CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-2 Scaling Images" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812717CFBF9A008D2206 /* Debug */, + 88E0812817CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E0812917CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-2 Scaling ImagesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812A17CFBF9A008D2206 /* Debug */, + 88E0812B17CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88E080E917CFBF99008D2206 /* Project object */; +} diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..703ab8f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..7ee698e Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..e1c2251 Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-2 Scaling Images.xcscheme b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-2 Scaling Images.xcscheme new file mode 100644 index 0000000..394ff71 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-2 Scaling Images.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..c08057a --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 11-2 Scaling Images.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88E080F017CFBF99008D2206 + + primary + + + 88E0811417CFBF9A008D2206 + + primary + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme new file mode 100644 index 0000000..76e51ab --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image ViewsTests.xcscheme b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image ViewsTests.xcscheme new file mode 100644 index 0000000..48160f1 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image ViewsTests.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1a8ead6 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-2 Scaling Image/Recipe 11-2 Scaling Images.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + Recipe 11-1 Using Image Views.xcscheme + + orderHint + 0 + + Recipe 11-1 Using Image ViewsTests.xcscheme + + orderHint + 1 + + + SuppressBuildableAutocreation + + 88E080F017CFBF99008D2206 + + primary + + + 88E0811417CFBF9A008D2206 + + primary + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/AppDelegate.h b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/AppDelegate.h new file mode 100644 index 0000000..e16db8b --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 11-3 Manipulating Images with Filters +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/AppDelegate.m b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/AppDelegate.m new file mode 100644 index 0000000..7502673 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/AppDelegate.m @@ -0,0 +1,49 @@ +// +// AppDelegate.m +// Recipe 11-3 Manipulating Images with Filters +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; + UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; + splitViewController.delegate = (id)navigationController.topViewController; + 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/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ff1e3da --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Base.lproj/Main.storyboard @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/DetailViewController.h b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/DetailViewController.h new file mode 100644 index 0000000..4d6c990 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/DetailViewController.h @@ -0,0 +1,42 @@ +// +// DetailViewController.h +// Recipe 11-3 Manipulating Images with Filters +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@protocol DetailViewControllerDelegateProtocol; + +@interface DetailViewController : UIViewController + +@property (nonatomic, weak) id delegate; + +@property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; + +@property (nonatomic, strong) IBOutlet UIButton *selectImageButton; +@property (nonatomic, strong) IBOutlet UIButton *clearImageButton; + +@property (strong, nonatomic) UIPopoverController *pop; + +- (IBAction)selectImage:(id)sender; +- (IBAction)clearImage:(id)sender; + +- (void)configureDetailsWithImage:(UIImage *)image label:(NSString *)label showsButtons:(BOOL)showsButton; + +@end + + + +@protocol DetailViewControllerDelegateProtocol + +- (void)detailViewController:(DetailViewController *)controller didSelectImage:(UIImage *)image; +- (void)detailViewControllerDidClearImage:(DetailViewController *)controller; + +@end \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/DetailViewController.m b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/DetailViewController.m new file mode 100644 index 0000000..8667f20 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/DetailViewController.m @@ -0,0 +1,103 @@ +// +// DetailViewController.m +// Recipe 11-3 Manipulating Images with Filters +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "DetailViewController.h" + +@interface DetailViewController () + +@property (strong, nonatomic) UIPopoverController *masterPopoverController; + +@end + +@implementation DetailViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Public + +- (void)configureDetailsWithImage:(UIImage *)image label:(NSString *)label showsButtons:(BOOL)showsButton +{ + self.imageView.image = image; + self.detailDescriptionLabel.text = label; + if (showsButton == NO) + { + self.selectImageButton.hidden = YES; + self.clearImageButton.hidden = YES; + } + else if (showsButton == YES) + { + self.selectImageButton.hidden = NO; + self.clearImageButton.hidden = NO; + } +} + +#pragma mark - Split view + +- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController +{ + barButtonItem.title = NSLocalizedString(@"Master", @"Master"); + [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; + self.masterPopoverController = popoverController; +} + +- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +{ + // Called when the view is shown again in the split view, invalidating the button and popover controller. + [self.navigationItem setLeftBarButtonItem:nil animated:YES]; + self.masterPopoverController = nil; +} + +#pragma mark - actions +- (IBAction)selectImage:(UIButton *)sender +{ + UIImagePickerController *picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + picker.delegate = self; + + self.pop = [[UIPopoverController alloc] initWithContentViewController:picker]; + self.pop.delegate = self; + [self.pop presentPopoverFromRect:sender.frame inView:self.view + permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; + } +} + +- (IBAction)clearImage:(id)sender +{ + self.imageView.image = nil; + [self.delegate detailViewControllerDidClearImage:self]; +} + +#pragma mark - delegate methods + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.pop dismissPopoverAnimated:YES]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + UIImage *image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.image = image; + + [self.pop dismissPopoverAnimated:YES]; + + [self.delegate detailViewController:self didSelectImage:image]; +} +@end diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a4645e6 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..a0ad363 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,36 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/MasterViewController.h b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/MasterViewController.h new file mode 100644 index 0000000..c3ebf83 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/MasterViewController.h @@ -0,0 +1,19 @@ +// +// MasterViewController.h +// Recipe 11-3 Manipulating Images with Filters +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import "DetailViewController.h" + +@interface MasterViewController : UITableViewController + +@property (strong, nonatomic) DetailViewController *detailViewController; +@property (nonatomic, strong) UIImage *mainImage; +@property (strong, nonatomic) NSMutableArray *filteredImages; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/MasterViewController.m b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/MasterViewController.m new file mode 100644 index 0000000..ff5ceb4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/MasterViewController.m @@ -0,0 +1,260 @@ +// +// MasterViewController.m +// Recipe 11-3 Manipulating Images with Filters +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MasterViewController.h" + + +@interface MasterViewController () + + +@end + +@implementation MasterViewController + +- (void)awakeFromNib +{ + self.clearsSelectionOnViewWillAppear = NO; + self.preferredContentSize = CGSizeMake(320.0, 600.0); + [super awakeFromNib]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; + self.detailViewController.delegate = self; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +-(NSMutableArray *)filteredImages +{ + if (!_filteredImages) + { + _filteredImages = [[NSMutableArray alloc] initWithCapacity:3]; + } + return _filteredImages; +} + +-(void)populateImageViewWithImage:(UIImage *)image +{ + CIImage *main = [[CIImage alloc] initWithImage:image]; + + CIFilter *hueAdjust = [CIFilter filterWithName:@"CIHueAdjust"]; + [hueAdjust setDefaults]; + [hueAdjust setValue:main forKey:@"inputImage"]; + [hueAdjust setValue:[NSNumber numberWithFloat: 3.14/2.0f] + forKey:@"inputAngle"]; + CIImage *outputHueAdjust = [hueAdjust valueForKey:@"outputImage"]; + CIContext *context = [CIContext contextWithOptions:nil]; + CGImageRef cgImage1 = [context createCGImage:outputHueAdjust + fromRect:outputHueAdjust.extent]; + UIImage *outputImage1 = [UIImage imageWithCGImage:cgImage1]; + CGImageRelease(cgImage1); + [self.filteredImages addObject:outputImage1]; + + CIFilter *strFilter = [CIFilter filterWithName:@"CIStraightenFilter"]; + [strFilter setDefaults]; + [strFilter setValue:main forKey:@"inputImage"]; + [strFilter setValue:[NSNumber numberWithFloat:3.14f] forKey:@"inputAngle"]; + CIImage *outputStr = [strFilter valueForKey:@"outputImage"]; + CGImageRef cgImage2 = [context createCGImage:outputStr fromRect:outputStr.extent]; + UIImage *outputImage2 = [UIImage imageWithCGImage:cgImage2]; + CGImageRelease(cgImage2); + [self.filteredImages addObject:outputImage2]; + + CIFilter *seriesFilter = [CIFilter filterWithName:@"CIStraightenFilter"]; + [seriesFilter setDefaults]; + [seriesFilter setValue:outputHueAdjust forKey:@"inputImage"]; + [seriesFilter setValue:[NSNumber numberWithFloat:3.14/2.0f] forKey:@"inputAngle"]; + CIImage *outputSeries = [seriesFilter valueForKey:@"outputImage"]; + CGImageRef cgImage3 = [context createCGImage:outputSeries + fromRect:outputSeries.extent]; + UIImage *outputImage3 = [UIImage imageWithCGImage:cgImage3]; + [self.filteredImages addObject:outputImage3]; + +} + +-(UIImage *)aspectFillImage:(UIImage *)image toSize:(CGSize)size +{ + UIGraphicsBeginImageContext(size); + if (image.size.height< image.size.width) + { + float ratio = size.height/image.size.height; + [image drawInRect:CGRectMake(0, 0, image.size.width*ratio, size.height)]; + } + else + { + float ratio = size.width/image.size.width; + [image drawInRect:CGRectMake(0, 0, size.width, image.size.height*ratio)]; + } + UIImage *aspectScaledImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return aspectScaledImage; +} + + + +#pragma mark - Class + +-(UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)size +{ + UIGraphicsBeginImageContext(size); + [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; + UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return scaledImage; +} + +-(UIImage *)aspectScaleImage:(UIImage *)image toSize:(CGSize)size +{ + if (image.size.height < image.size.width) + { + float ratio = size.height / image.size.height; + CGSize newSize = CGSizeMake(image.size.width * ratio, size.height); + UIGraphicsBeginImageContext(newSize); + [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; + } + else { + float ratio = size.width / image.size.width; + CGSize newSize = CGSizeMake(size.width, image.size.height * ratio); + UIGraphicsBeginImageContext(newSize); + [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; + } + UIImage *aspectScaledImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return aspectScaledImage; +} + +#pragma mark - Table View + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + if (self.mainImage == nil) + return 1; + else + return 6; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + + if (indexPath.row == 0) + cell.textLabel.text = NSLocalizedString(@"Selected Image", @"Detail"); + else if (indexPath.row == 1) + cell.textLabel.text = NSLocalizedString(@"Resized Image", @"Detail"); + else if (indexPath.row == 2) + cell.textLabel.text = NSLocalizedString(@"Scaled Image", @"Detail"); + else if (indexPath.row == 3) + { + CGSize thumbnailSize = CGSizeMake(120, 75); + UIImage *displayImage = [self.filteredImages objectAtIndex:0]; + UIImage *thumbnailImage = [self aspectFillImage:displayImage + toSize:thumbnailSize]; + cell.imageView.image = thumbnailImage; + cell.textLabel.text = NSLocalizedString(@"Hue Adjust", @"Detail"); + } + else if (indexPath.row == 4) + { + CGSize thumbnailSize = CGSizeMake(120, 75); + UIImage *displayImage = [self.filteredImages objectAtIndex:1]; + UIImage *thumbnailImage = [self aspectFillImage:displayImage + toSize:thumbnailSize]; + cell.imageView.image = thumbnailImage; + cell.textLabel.text = NSLocalizedString(@"Straighten Filter", @"Detail"); + } + else if (indexPath.row == 5) + { + CGSize thumbnailSize = CGSizeMake(120, 75); + UIImage *displayImage = [self.filteredImages objectAtIndex:2]; + UIImage *thumbnailImage = [self aspectFillImage:displayImage + toSize:thumbnailSize]; + cell.imageView.image = thumbnailImage; + + cell.textLabel.text = NSLocalizedString(@"Series Filter", @"Detail"); + } + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (self.mainImage != nil) + { + UIImage *image; + NSString *label; + BOOL showsButtons = NO; + if (indexPath.row == 0) + { + image = self.mainImage; + label = @"Select an Image to Display"; + showsButtons = YES; + } + else if (indexPath.row == 1) + { + image = [self scaleImage:self.mainImage + toSize:self.detailViewController.imageView.frame.size]; + label = @"Chosen Image Resized"; + } + else if (indexPath.row == 2) + { + image = [self aspectScaleImage:self.mainImage + toSize:self.detailViewController.imageView.frame.size]; + label = @"Chosen Image Scaled"; + } + else if (indexPath.row == 3) + { + image = [self.filteredImages objectAtIndex:0]; + image = [self aspectScaleImage:image toSize:self.detailViewController.imageView.frame.size]; + label = @"Hue Adjustment"; + } + else if (indexPath.row == 4) + { + image = [self.filteredImages objectAtIndex:1]; + image = [self aspectScaleImage:image toSize:self.detailViewController.imageView.frame.size]; + label = @"Straightening Filter"; + } + else if (indexPath.row == 5) + { + image = [self.filteredImages objectAtIndex:2]; + image = [self aspectScaleImage:image toSize:self.detailViewController.imageView.frame.size]; + label = @"Series Filter"; + } + + [self.detailViewController configureDetailsWithImage:image label:label + showsButtons:showsButtons]; + } +} + +#pragma mark - DetailViewControllerDelegateProtocol + +- (void)detailViewController:(DetailViewController *)controller didSelectImage:(UIImage *)image +{ + self.mainImage = image; + [self populateImageViewWithImage:image]; + [self.tableView reloadData]; +} + +- (void)detailViewControllerDidClearImage:(DetailViewController *)controller +{ + self.mainImage = nil; + [self.filteredImages removeAllObjects]; + [self.tableView reloadData]; +} + +@end diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Info.plist b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Info.plist new file mode 100644 index 0000000..37e39f3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Info.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Prefix.pch b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/main.m b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/main.m new file mode 100644 index 0000000..31d40e3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image Views/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 11-1 Using Image Views +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/Recipe 11-3 Manipulating Images with FiltersTests-Info.plist b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/Recipe 11-3 Manipulating Images with FiltersTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/Recipe 11-3 Manipulating Images with FiltersTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m new file mode 100644 index 0000000..bcfed88 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/Recipe_11_1_Using_Image_ViewsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_11_1_Using_Image_ViewsTests.m +// Recipe 11-1 Using Image ViewsTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_11_1_Using_Image_ViewsTests : XCTestCase + +@end + +@implementation Recipe_11_1_Using_Image_ViewsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-1 Using Image ViewsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.pbxproj b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.pbxproj new file mode 100644 index 0000000..da30d99 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.pbxproj @@ -0,0 +1,485 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88BB65F317E2B13400F11FEA /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB65F217E2B13400F11FEA /* CoreImage.framework */; }; + 88E080F517CFBF99008D2206 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F417CFBF99008D2206 /* Foundation.framework */; }; + 88E080F717CFBF99008D2206 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F617CFBF99008D2206 /* CoreGraphics.framework */; }; + 88E080F917CFBF99008D2206 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F817CFBF99008D2206 /* UIKit.framework */; }; + 88E080FF17CFBF99008D2206 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E080FD17CFBF99008D2206 /* InfoPlist.strings */; }; + 88E0810117CFBF99008D2206 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810017CFBF99008D2206 /* main.m */; }; + 88E0810517CFBF99008D2206 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810417CFBF99008D2206 /* AppDelegate.m */; }; + 88E0810817CFBF99008D2206 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88E0810617CFBF99008D2206 /* Main.storyboard */; }; + 88E0810B17CFBF99008D2206 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810A17CFBF99008D2206 /* MasterViewController.m */; }; + 88E0810E17CFBF99008D2206 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0810D17CFBF99008D2206 /* DetailViewController.m */; }; + 88E0811017CFBF9A008D2206 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88E0810F17CFBF9A008D2206 /* Images.xcassets */; }; + 88E0811717CFBF9A008D2206 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E0811617CFBF9A008D2206 /* XCTest.framework */; }; + 88E0811817CFBF9A008D2206 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F417CFBF99008D2206 /* Foundation.framework */; }; + 88E0811917CFBF9A008D2206 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E080F817CFBF99008D2206 /* UIKit.framework */; }; + 88E0812117CFBF9A008D2206 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */; }; + 88E0812317CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88E0811A17CFBF9A008D2206 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88E080E917CFBF99008D2206 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E080F017CFBF99008D2206; + remoteInfo = "Recipe 11-1 Using Image Views"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88BB65F217E2B13400F11FEA /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; + 88E080F117CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 11-3 Manipulating Images with Filters.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E080F417CFBF99008D2206 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88E080F617CFBF99008D2206 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88E080F817CFBF99008D2206 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88E080FC17CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-3 Manipulating Images with Filters-Info.plist"; sourceTree = ""; }; + 88E080FE17CFBF99008D2206 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E0810017CFBF99008D2206 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88E0810217CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 11-3 Manipulating Images with Filters-Prefix.pch"; sourceTree = ""; }; + 88E0810317CFBF99008D2206 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88E0810417CFBF99008D2206 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88E0810717CFBF99008D2206 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88E0810917CFBF99008D2206 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; + 88E0810A17CFBF99008D2206 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; + 88E0810C17CFBF99008D2206 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; + 88E0810D17CFBF99008D2206 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; + 88E0810F17CFBF9A008D2206 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88E0811517CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 11-3 Manipulating Images with FiltersTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E0811617CFBF9A008D2206 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88E0811E17CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-3 Manipulating Images with FiltersTests-Info.plist"; sourceTree = ""; }; + 88E0812017CFBF9A008D2206 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_11_1_Using_Image_ViewsTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88E080EE17CFBF99008D2206 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB65F317E2B13400F11FEA /* CoreImage.framework in Frameworks */, + 88E080F717CFBF99008D2206 /* CoreGraphics.framework in Frameworks */, + 88E080F917CFBF99008D2206 /* UIKit.framework in Frameworks */, + 88E080F517CFBF99008D2206 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811217CFBF9A008D2206 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0811717CFBF9A008D2206 /* XCTest.framework in Frameworks */, + 88E0811917CFBF9A008D2206 /* UIKit.framework in Frameworks */, + 88E0811817CFBF9A008D2206 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88E080E817CFBF99008D2206 = { + isa = PBXGroup; + children = ( + 88E080FA17CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters */, + 88E0811C17CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests */, + 88E080F317CFBF99008D2206 /* Frameworks */, + 88E080F217CFBF99008D2206 /* Products */, + ); + sourceTree = ""; + }; + 88E080F217CFBF99008D2206 /* Products */ = { + isa = PBXGroup; + children = ( + 88E080F117CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters.app */, + 88E0811517CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88E080F317CFBF99008D2206 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88BB65F217E2B13400F11FEA /* CoreImage.framework */, + 88E080F417CFBF99008D2206 /* Foundation.framework */, + 88E080F617CFBF99008D2206 /* CoreGraphics.framework */, + 88E080F817CFBF99008D2206 /* UIKit.framework */, + 88E0811617CFBF9A008D2206 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88E080FA17CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters */ = { + isa = PBXGroup; + children = ( + 88E0810317CFBF99008D2206 /* AppDelegate.h */, + 88E0810417CFBF99008D2206 /* AppDelegate.m */, + 88E0810617CFBF99008D2206 /* Main.storyboard */, + 88E0810917CFBF99008D2206 /* MasterViewController.h */, + 88E0810A17CFBF99008D2206 /* MasterViewController.m */, + 88E0810C17CFBF99008D2206 /* DetailViewController.h */, + 88E0810D17CFBF99008D2206 /* DetailViewController.m */, + 88E0810F17CFBF9A008D2206 /* Images.xcassets */, + 88E080FB17CFBF99008D2206 /* Supporting Files */, + ); + name = "Recipe 11-3 Manipulating Images with Filters"; + path = "Recipe 11-1 Using Image Views"; + sourceTree = ""; + }; + 88E080FB17CFBF99008D2206 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E080FC17CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters-Info.plist */, + 88E080FD17CFBF99008D2206 /* InfoPlist.strings */, + 88E0810017CFBF99008D2206 /* main.m */, + 88E0810217CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88E0811C17CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests */ = { + isa = PBXGroup; + children = ( + 88E0812217CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m */, + 88E0811D17CFBF9A008D2206 /* Supporting Files */, + ); + name = "Recipe 11-3 Manipulating Images with FiltersTests"; + path = "Recipe 11-1 Using Image ViewsTests"; + sourceTree = ""; + }; + 88E0811D17CFBF9A008D2206 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E0811E17CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests-Info.plist */, + 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88E080F017CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E0812617CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-3 Manipulating Images with Filters" */; + buildPhases = ( + 88E080ED17CFBF99008D2206 /* Sources */, + 88E080EE17CFBF99008D2206 /* Frameworks */, + 88E080EF17CFBF99008D2206 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 11-3 Manipulating Images with Filters"; + productName = "Recipe 11-1 Using Image Views"; + productReference = 88E080F117CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters.app */; + productType = "com.apple.product-type.application"; + }; + 88E0811417CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E0812917CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-3 Manipulating Images with FiltersTests" */; + buildPhases = ( + 88E0811117CFBF9A008D2206 /* Sources */, + 88E0811217CFBF9A008D2206 /* Frameworks */, + 88E0811317CFBF9A008D2206 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88E0811B17CFBF9A008D2206 /* PBXTargetDependency */, + ); + name = "Recipe 11-3 Manipulating Images with FiltersTests"; + productName = "Recipe 11-1 Using Image ViewsTests"; + productReference = 88E0811517CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88E080E917CFBF99008D2206 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88E0811417CFBF9A008D2206 = { + TestTargetID = 88E080F017CFBF99008D2206; + }; + }; + }; + buildConfigurationList = 88E080EC17CFBF99008D2206 /* Build configuration list for PBXProject "Recipe 11-3 Manipulating Images with Filters" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88E080E817CFBF99008D2206; + productRefGroup = 88E080F217CFBF99008D2206 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E080F017CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters */, + 88E0811417CFBF9A008D2206 /* Recipe 11-3 Manipulating Images with FiltersTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88E080EF17CFBF99008D2206 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0811017CFBF9A008D2206 /* Images.xcassets in Resources */, + 88E080FF17CFBF99008D2206 /* InfoPlist.strings in Resources */, + 88E0810817CFBF99008D2206 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811317CFBF9A008D2206 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0812117CFBF9A008D2206 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88E080ED17CFBF99008D2206 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0810517CFBF99008D2206 /* AppDelegate.m in Sources */, + 88E0810B17CFBF99008D2206 /* MasterViewController.m in Sources */, + 88E0810117CFBF99008D2206 /* main.m in Sources */, + 88E0810E17CFBF99008D2206 /* DetailViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E0811117CFBF9A008D2206 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E0812317CFBF9A008D2206 /* Recipe_11_1_Using_Image_ViewsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88E0811B17CFBF9A008D2206 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88E080F017CFBF99008D2206 /* Recipe 11-3 Manipulating Images with Filters */; + targetProxy = 88E0811A17CFBF9A008D2206 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88E080FD17CFBF99008D2206 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E080FE17CFBF99008D2206 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88E0810617CFBF99008D2206 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88E0810717CFBF99008D2206 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88E0811F17CFBF9A008D2206 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E0812017CFBF9A008D2206 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88E0812417CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + }; + name = Debug; + }; + 88E0812517CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88E0812717CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Info.plist"; + PRODUCT_NAME = "Recipe 11-3 Manipulating Images with Filters"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88E0812817CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image Views/Recipe 11-3 Manipulating Images with Filters-Info.plist"; + PRODUCT_NAME = "Recipe 11-3 Manipulating Images with Filters"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88E0812A17CFBF9A008D2206 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-1 Using Image Views.app/Recipe 11-1 Using Image Views"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 11-1 Using Image ViewsTests/Recipe 11-3 Manipulating Images with FiltersTests-Info.plist"; + PRODUCT_NAME = "Recipe 11-3 Manipulating Images with FiltersTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88E0812B17CFBF9A008D2206 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-1 Using Image Views.app/Recipe 11-1 Using Image Views"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-1 Using Image Views/Recipe 11-1 Using Image Views-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-1 Using Image ViewsTests/Recipe 11-3 Manipulating Images with FiltersTests-Info.plist"; + PRODUCT_NAME = "Recipe 11-3 Manipulating Images with FiltersTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88E080EC17CFBF99008D2206 /* Build configuration list for PBXProject "Recipe 11-3 Manipulating Images with Filters" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812417CFBF9A008D2206 /* Debug */, + 88E0812517CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E0812617CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-3 Manipulating Images with Filters" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812717CFBF9A008D2206 /* Debug */, + 88E0812817CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E0812917CFBF9A008D2206 /* Build configuration list for PBXNativeTarget "Recipe 11-3 Manipulating Images with FiltersTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E0812A17CFBF9A008D2206 /* Debug */, + 88E0812B17CFBF9A008D2206 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88E080E917CFBF99008D2206 /* Project object */; +} diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..8216dfc --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..60339db Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..e1c2251 Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..8f94031 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..22c59cc --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 11-3 Manipulating Images with Filters.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88E080F017CFBF99008D2206 + + primary + + + 88E0811417CFBF9A008D2206 + + primary + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme new file mode 100644 index 0000000..76e51ab --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image Views.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image ViewsTests.xcscheme b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image ViewsTests.xcscheme new file mode 100644 index 0000000..48160f1 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/Recipe 11-1 Using Image ViewsTests.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1a8ead6 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-3 Manipulating Images with Filters/Recipe 11-3 Manipulating Images with Filters.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + Recipe 11-1 Using Image Views.xcscheme + + orderHint + 0 + + Recipe 11-1 Using Image ViewsTests.xcscheme + + orderHint + 1 + + + SuppressBuildableAutocreation + + 88E080F017CFBF99008D2206 + + primary + + + 88E0811417CFBF9A008D2206 + + primary + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.pbxproj b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.pbxproj new file mode 100644 index 0000000..bbe6d37 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.pbxproj @@ -0,0 +1,485 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8849A7F518050B4300CA0A76 /* Dashboard_Widgets.zip in Resources */ = {isa = PBXBuildFile; fileRef = 8849A7F418050B4300CA0A76 /* Dashboard_Widgets.zip */; }; + 8849A7F718050B7400CA0A76 /* joentater.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 8849A7F618050B7400CA0A76 /* joentater.jpg */; }; + 88BB664B17E2C62E00F11FEA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB664A17E2C62E00F11FEA /* Foundation.framework */; }; + 88BB664D17E2C62E00F11FEA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB664C17E2C62E00F11FEA /* CoreGraphics.framework */; }; + 88BB664F17E2C62E00F11FEA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB664E17E2C62E00F11FEA /* UIKit.framework */; }; + 88BB665517E2C62E00F11FEA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88BB665317E2C62E00F11FEA /* InfoPlist.strings */; }; + 88BB665717E2C62E00F11FEA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88BB665617E2C62E00F11FEA /* main.m */; }; + 88BB665B17E2C62E00F11FEA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88BB665A17E2C62E00F11FEA /* AppDelegate.m */; }; + 88BB665E17E2C62E00F11FEA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88BB665C17E2C62E00F11FEA /* Main.storyboard */; }; + 88BB666117E2C62E00F11FEA /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88BB666017E2C62E00F11FEA /* ViewController.m */; }; + 88BB666317E2C62E00F11FEA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88BB666217E2C62E00F11FEA /* Images.xcassets */; }; + 88BB666A17E2C62E00F11FEA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB666917E2C62E00F11FEA /* XCTest.framework */; }; + 88BB666B17E2C62E00F11FEA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB664A17E2C62E00F11FEA /* Foundation.framework */; }; + 88BB666C17E2C62E00F11FEA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88BB664E17E2C62E00F11FEA /* UIKit.framework */; }; + 88BB667417E2C62E00F11FEA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88BB667217E2C62E00F11FEA /* InfoPlist.strings */; }; + 88BB667617E2C62E00F11FEA /* Recipe_11_4__Detecting_FeaturesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88BB667517E2C62E00F11FEA /* Recipe_11_4__Detecting_FeaturesTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88BB666D17E2C62E00F11FEA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88BB663F17E2C62E00F11FEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88BB664617E2C62E00F11FEA; + remoteInfo = "Recipe 11-4: Detecting Features"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8849A7F418050B4300CA0A76 /* Dashboard_Widgets.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Dashboard_Widgets.zip; sourceTree = ""; }; + 8849A7F618050B7400CA0A76 /* joentater.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = joentater.jpg; sourceTree = ""; }; + 88BB664717E2C62E00F11FEA /* Recipe 11-4 Detecting Features.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 11-4 Detecting Features.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88BB664A17E2C62E00F11FEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88BB664C17E2C62E00F11FEA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88BB664E17E2C62E00F11FEA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88BB665217E2C62E00F11FEA /* Recipe 11-4 Detecting Features-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-4 Detecting Features-Info.plist"; sourceTree = ""; }; + 88BB665417E2C62E00F11FEA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88BB665617E2C62E00F11FEA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88BB665817E2C62E00F11FEA /* Recipe 11-4 Detecting Features-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 11-4 Detecting Features-Prefix.pch"; sourceTree = ""; }; + 88BB665917E2C62E00F11FEA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88BB665A17E2C62E00F11FEA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88BB665D17E2C62E00F11FEA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88BB665F17E2C62E00F11FEA /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88BB666017E2C62E00F11FEA /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88BB666217E2C62E00F11FEA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88BB666817E2C62E00F11FEA /* Recipe 11-4 Detecting FeaturesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 11-4 Detecting FeaturesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88BB666917E2C62E00F11FEA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88BB667117E2C62E00F11FEA /* Recipe 11-4 Detecting FeaturesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 11-4 Detecting FeaturesTests-Info.plist"; sourceTree = ""; }; + 88BB667317E2C62E00F11FEA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88BB667517E2C62E00F11FEA /* Recipe_11_4__Detecting_FeaturesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_11_4__Detecting_FeaturesTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88BB664417E2C62E00F11FEA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB664D17E2C62E00F11FEA /* CoreGraphics.framework in Frameworks */, + 88BB664F17E2C62E00F11FEA /* UIKit.framework in Frameworks */, + 88BB664B17E2C62E00F11FEA /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88BB666517E2C62E00F11FEA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB666A17E2C62E00F11FEA /* XCTest.framework in Frameworks */, + 88BB666C17E2C62E00F11FEA /* UIKit.framework in Frameworks */, + 88BB666B17E2C62E00F11FEA /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88BB663E17E2C62E00F11FEA = { + isa = PBXGroup; + children = ( + 88BB665017E2C62E00F11FEA /* Recipe 11-4: Detecting Features */, + 88BB666F17E2C62E00F11FEA /* Recipe 11-4: Detecting FeaturesTests */, + 88BB664917E2C62E00F11FEA /* Frameworks */, + 88BB664817E2C62E00F11FEA /* Products */, + ); + sourceTree = ""; + }; + 88BB664817E2C62E00F11FEA /* Products */ = { + isa = PBXGroup; + children = ( + 88BB664717E2C62E00F11FEA /* Recipe 11-4 Detecting Features.app */, + 88BB666817E2C62E00F11FEA /* Recipe 11-4 Detecting FeaturesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88BB664917E2C62E00F11FEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88BB664A17E2C62E00F11FEA /* Foundation.framework */, + 88BB664C17E2C62E00F11FEA /* CoreGraphics.framework */, + 88BB664E17E2C62E00F11FEA /* UIKit.framework */, + 88BB666917E2C62E00F11FEA /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88BB665017E2C62E00F11FEA /* Recipe 11-4: Detecting Features */ = { + isa = PBXGroup; + children = ( + 88BB665917E2C62E00F11FEA /* AppDelegate.h */, + 88BB665A17E2C62E00F11FEA /* AppDelegate.m */, + 88BB665C17E2C62E00F11FEA /* Main.storyboard */, + 88BB665F17E2C62E00F11FEA /* ViewController.h */, + 88BB666017E2C62E00F11FEA /* ViewController.m */, + 88BB666217E2C62E00F11FEA /* Images.xcassets */, + 88BB665117E2C62E00F11FEA /* Supporting Files */, + ); + path = "Recipe 11-4: Detecting Features"; + sourceTree = ""; + }; + 88BB665117E2C62E00F11FEA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8849A7F618050B7400CA0A76 /* joentater.jpg */, + 8849A7F418050B4300CA0A76 /* Dashboard_Widgets.zip */, + 88BB665217E2C62E00F11FEA /* Recipe 11-4 Detecting Features-Info.plist */, + 88BB665317E2C62E00F11FEA /* InfoPlist.strings */, + 88BB665617E2C62E00F11FEA /* main.m */, + 88BB665817E2C62E00F11FEA /* Recipe 11-4 Detecting Features-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88BB666F17E2C62E00F11FEA /* Recipe 11-4: Detecting FeaturesTests */ = { + isa = PBXGroup; + children = ( + 88BB667517E2C62E00F11FEA /* Recipe_11_4__Detecting_FeaturesTests.m */, + 88BB667017E2C62E00F11FEA /* Supporting Files */, + ); + path = "Recipe 11-4: Detecting FeaturesTests"; + sourceTree = ""; + }; + 88BB667017E2C62E00F11FEA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88BB667117E2C62E00F11FEA /* Recipe 11-4 Detecting FeaturesTests-Info.plist */, + 88BB667217E2C62E00F11FEA /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88BB664617E2C62E00F11FEA /* Recipe 11-4 Detecting Features */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88BB667917E2C62E00F11FEA /* Build configuration list for PBXNativeTarget "Recipe 11-4 Detecting Features" */; + buildPhases = ( + 88BB664317E2C62E00F11FEA /* Sources */, + 88BB664417E2C62E00F11FEA /* Frameworks */, + 88BB664517E2C62E00F11FEA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 11-4 Detecting Features"; + productName = "Recipe 11-4: Detecting Features"; + productReference = 88BB664717E2C62E00F11FEA /* Recipe 11-4 Detecting Features.app */; + productType = "com.apple.product-type.application"; + }; + 88BB666717E2C62E00F11FEA /* Recipe 11-4 Detecting FeaturesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88BB667C17E2C62E00F11FEA /* Build configuration list for PBXNativeTarget "Recipe 11-4 Detecting FeaturesTests" */; + buildPhases = ( + 88BB666417E2C62E00F11FEA /* Sources */, + 88BB666517E2C62E00F11FEA /* Frameworks */, + 88BB666617E2C62E00F11FEA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88BB666E17E2C62E00F11FEA /* PBXTargetDependency */, + ); + name = "Recipe 11-4 Detecting FeaturesTests"; + productName = "Recipe 11-4: Detecting FeaturesTests"; + productReference = 88BB666817E2C62E00F11FEA /* Recipe 11-4 Detecting FeaturesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88BB663F17E2C62E00F11FEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88BB666717E2C62E00F11FEA = { + TestTargetID = 88BB664617E2C62E00F11FEA; + }; + }; + }; + buildConfigurationList = 88BB664217E2C62E00F11FEA /* Build configuration list for PBXProject "Recipe 11-4 Detecting Features" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88BB663E17E2C62E00F11FEA; + productRefGroup = 88BB664817E2C62E00F11FEA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88BB664617E2C62E00F11FEA /* Recipe 11-4 Detecting Features */, + 88BB666717E2C62E00F11FEA /* Recipe 11-4 Detecting FeaturesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88BB664517E2C62E00F11FEA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB666317E2C62E00F11FEA /* Images.xcassets in Resources */, + 8849A7F718050B7400CA0A76 /* joentater.jpg in Resources */, + 8849A7F518050B4300CA0A76 /* Dashboard_Widgets.zip in Resources */, + 88BB665517E2C62E00F11FEA /* InfoPlist.strings in Resources */, + 88BB665E17E2C62E00F11FEA /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88BB666617E2C62E00F11FEA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB667417E2C62E00F11FEA /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88BB664317E2C62E00F11FEA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB666117E2C62E00F11FEA /* ViewController.m in Sources */, + 88BB665B17E2C62E00F11FEA /* AppDelegate.m in Sources */, + 88BB665717E2C62E00F11FEA /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88BB666417E2C62E00F11FEA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88BB667617E2C62E00F11FEA /* Recipe_11_4__Detecting_FeaturesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88BB666E17E2C62E00F11FEA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88BB664617E2C62E00F11FEA /* Recipe 11-4 Detecting Features */; + targetProxy = 88BB666D17E2C62E00F11FEA /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88BB665317E2C62E00F11FEA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88BB665417E2C62E00F11FEA /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88BB665C17E2C62E00F11FEA /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88BB665D17E2C62E00F11FEA /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88BB667217E2C62E00F11FEA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88BB667317E2C62E00F11FEA /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88BB667717E2C62E00F11FEA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88BB667817E2C62E00F11FEA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88BB667A17E2C62E00F11FEA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-4: Detecting Features/Recipe 11-4 Detecting Features-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-4: Detecting Features/Recipe 11-4 Detecting Features-Info.plist"; + PRODUCT_NAME = "Recipe 11-4 Detecting Features"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88BB667B17E2C62E00F11FEA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-4: Detecting Features/Recipe 11-4 Detecting Features-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-4: Detecting Features/Recipe 11-4 Detecting Features-Info.plist"; + PRODUCT_NAME = "Recipe 11-4 Detecting Features"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88BB667D17E2C62E00F11FEA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-4: Detecting Features.app/Recipe 11-4: Detecting Features"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-4: Detecting Features/Recipe 11-4: Detecting Features-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 11-4: Detecting FeaturesTests/Recipe 11-4 Detecting FeaturesTests-Info.plist"; + PRODUCT_NAME = "Recipe 11-4 Detecting FeaturesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88BB667E17E2C62E00F11FEA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 11-4: Detecting Features.app/Recipe 11-4: Detecting Features"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 11-4: Detecting Features/Recipe 11-4: Detecting Features-Prefix.pch"; + INFOPLIST_FILE = "Recipe 11-4: Detecting FeaturesTests/Recipe 11-4 Detecting FeaturesTests-Info.plist"; + PRODUCT_NAME = "Recipe 11-4 Detecting FeaturesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88BB664217E2C62E00F11FEA /* Build configuration list for PBXProject "Recipe 11-4 Detecting Features" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88BB667717E2C62E00F11FEA /* Debug */, + 88BB667817E2C62E00F11FEA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88BB667917E2C62E00F11FEA /* Build configuration list for PBXNativeTarget "Recipe 11-4 Detecting Features" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88BB667A17E2C62E00F11FEA /* Debug */, + 88BB667B17E2C62E00F11FEA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88BB667C17E2C62E00F11FEA /* Build configuration list for PBXNativeTarget "Recipe 11-4 Detecting FeaturesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88BB667D17E2C62E00F11FEA /* Debug */, + 88BB667E17E2C62E00F11FEA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88BB663F17E2C62E00F11FEA /* Project object */; +} diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6ba3a45 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..6135397 Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-4_ Detecting Features.xcscheme b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-4_ Detecting Features.xcscheme new file mode 100644 index 0000000..e66ad16 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 11-4_ Detecting Features.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..3d51a90 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 11-4: Detecting Features.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88BB664617E2C62E00F11FEA + + primary + + + 88BB666717E2C62E00F11FEA + + primary + + + + + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/AppDelegate.h b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/AppDelegate.h new file mode 100644 index 0000000..d31f21a --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 11-4: Detecting Features +// +// Created by joseph hoffman on 9/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/AppDelegate.m b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/AppDelegate.m new file mode 100644 index 0000000..553e6b4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 11-4: Detecting Features +// +// Created by joseph hoffman on 9/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Base.lproj/Main.storyboard b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Base.lproj/Main.storyboard new file mode 100644 index 0000000..2cb4383 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Base.lproj/Main.storyboard @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Dashboard_Widgets.zip b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Dashboard_Widgets.zip new file mode 100644 index 0000000..a7ba05d Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Dashboard_Widgets.zip differ diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Images.xcassets/AppIcon.appiconset/Contents.json b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features-Info.plist b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features-Info.plist new file mode 100644 index 0000000..426b098 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features-Prefix.pch b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/Recipe 11-4 Detecting Features-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/ViewController.h b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/ViewController.h new file mode 100644 index 0000000..6d755a6 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/ViewController.h @@ -0,0 +1,18 @@ +// +// ViewController.h +// Recipe 11-4: Detecting Features +// +// Created by joseph hoffman on 9/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *mainImageView; +@property (weak, nonatomic) IBOutlet UIImageView *faceImageView; +@property (weak, nonatomic) IBOutlet UIButton *findFaceButton; + +- (IBAction)findFace:(id)sender; +@end diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/ViewController.m b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/ViewController.m new file mode 100644 index 0000000..76b8cca --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/ViewController.m @@ -0,0 +1,73 @@ +// +// ViewController.m +// Recipe 11-4: Detecting Features +// +// Created by joseph hoffman on 9/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mainImageView.contentMode = UIViewContentModeScaleAspectFit; + self.faceImageView.contentMode = UIViewContentModeScaleAspectFit; + UIImage *image = [UIImage imageNamed:@"joentater.jpg"]; + if (image != nil) + { + self.mainImageView.image = image; + } + else + { + [self.findFaceButton setTitle:@"No Image" forState:UIControlStateNormal]; + self.findFaceButton.enabled = NO; + self.findFaceButton.alpha = 0.6; + } +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)findFace:(id)sender +{ + UIImage *image = self.mainImageView.image; + CIImage *coreImage = [[CIImage alloc] initWithImage:image]; + CIContext *context = [CIContext contextWithOptions:nil]; + CIDetector *detector = + [CIDetector detectorOfType:@"CIDetectorTypeFace"context:context + options:[NSDictionary dictionaryWithObjectsAndKeys: + @"CIDetectorAccuracyHigh", @"CIDetectorAccuracy", nil]]; + NSArray *features = [detector featuresInImage:coreImage]; + + if ([features count] >0) + { + CIImage *faceImage = + [coreImage imageByCroppingToRect:[[features lastObject] bounds]]; + UIImage *face = [UIImage imageWithCGImage:[context createCGImage:faceImage + fromRect:faceImage.extent]]; + self.faceImageView.image = face; + + [self.findFaceButton setTitle:[NSString stringWithFormat:@"%lu Face(s) Found", + (unsigned long)[features count]] forState:UIControlStateNormal]; + self.findFaceButton.enabled = NO; + self.findFaceButton.alpha = 0.6; + } + else + { + [self.findFaceButton setTitle:@"No Faces Found"forState:UIControlStateNormal]; + self.findFaceButton.enabled = NO; + self.findFaceButton.alpha = 0.6; + } +} +@end diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/joentater.jpg b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/joentater.jpg new file mode 100644 index 0000000..1b5195f Binary files /dev/null and b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/joentater.jpg differ diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/main.m b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/main.m new file mode 100644 index 0000000..29d7dfc --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting Features/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 11-4: Detecting Features +// +// Created by joseph hoffman on 9/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/Recipe 11-4 Detecting FeaturesTests-Info.plist b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/Recipe 11-4 Detecting FeaturesTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/Recipe 11-4 Detecting FeaturesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/Recipe_11_4__Detecting_FeaturesTests.m b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/Recipe_11_4__Detecting_FeaturesTests.m new file mode 100644 index 0000000..da005d7 --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/Recipe_11_4__Detecting_FeaturesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_11_4__Detecting_FeaturesTests.m +// Recipe 11-4: Detecting FeaturesTests +// +// Created by joseph hoffman on 9/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_11_4__Detecting_FeaturesTests : XCTestCase + +@end + +@implementation Recipe_11_4__Detecting_FeaturesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/en.lproj/InfoPlist.strings b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH11 - Image Recipes/Recipe 11-4_ Detecting Features/Recipe 11-4_ Detecting FeaturesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/.DS_Store new file mode 100644 index 0000000..53adc3d Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.pbxproj b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2e0d881 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.pbxproj @@ -0,0 +1,475 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AC17D039A90002F247 /* CoreGraphics.framework */; }; + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41B317D039A90002F247 /* InfoPlist.strings */; }; + 88CA41B717D039A90002F247 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41B617D039A90002F247 /* main.m */; }; + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41BA17D039A90002F247 /* AppDelegate.m */; }; + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41BC17D039A90002F247 /* Main.storyboard */; }; + 88CA41C117D039A90002F247 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41C017D039A90002F247 /* ViewController.m */; }; + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41C217D039A90002F247 /* Images.xcassets */; }; + 88CA41CA17D039A90002F247 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41C917D039A90002F247 /* XCTest.framework */; }; + 88CA41CB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41CC17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41D417D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41D217D039A90002F247 /* InfoPlist.strings */; }; + 88CA41D617D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */; }; + 88CA41E117D039D80002F247 /* GraphicsRecipesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CA41CD17D039A90002F247 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CA419F17D039A90002F247 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CA41A617D039A90002F247; + remoteInfo = "Recipe 12-1: Drawing Simple Shapes"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CA41A717D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 12-1 Drawing Simple Shapes.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41AA17D039A90002F247 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CA41AE17D039A90002F247 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CA41B217D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-1 Drawing Simple Shapes-Info.plist"; sourceTree = ""; }; + 88CA41B417D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41B617D039A90002F247 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CA41B817D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 12-1 Drawing Simple Shapes-Prefix.pch"; sourceTree = ""; }; + 88CA41B917D039A90002F247 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CA41BA17D039A90002F247 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CA41BD17D039A90002F247 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CA41BF17D039A90002F247 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CA41C017D039A90002F247 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CA41C217D039A90002F247 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CA41C817D039A90002F247 /* Recipe 12-1 Drawing Simple ShapesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 12-1 Drawing Simple ShapesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41C917D039A90002F247 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CA41D117D039A90002F247 /* Recipe 12-1 Drawing Simple ShapesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-1 Drawing Simple ShapesTests-Info.plist"; sourceTree = ""; }; + 88CA41D317D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_12_1__Drawing_Simple_ShapesTests.m; sourceTree = ""; }; + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsRecipesView.h; sourceTree = ""; }; + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphicsRecipesView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CA41A417D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */, + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CA41C517D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41CA17D039A90002F247 /* XCTest.framework in Frameworks */, + 88CA41CC17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41CB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CA419E17D039A90002F247 = { + isa = PBXGroup; + children = ( + 88CA41B017D039A90002F247 /* Recipe 12-1: Drawing Simple Shapes */, + 88CA41CF17D039A90002F247 /* Recipe 12-1: Drawing Simple ShapesTests */, + 88CA41A917D039A90002F247 /* Frameworks */, + 88CA41A817D039A90002F247 /* Products */, + ); + sourceTree = ""; + }; + 88CA41A817D039A90002F247 /* Products */ = { + isa = PBXGroup; + children = ( + 88CA41A717D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes.app */, + 88CA41C817D039A90002F247 /* Recipe 12-1 Drawing Simple ShapesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CA41A917D039A90002F247 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CA41AA17D039A90002F247 /* Foundation.framework */, + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */, + 88CA41AE17D039A90002F247 /* UIKit.framework */, + 88CA41C917D039A90002F247 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CA41B017D039A90002F247 /* Recipe 12-1: Drawing Simple Shapes */ = { + isa = PBXGroup; + children = ( + 88CA41B917D039A90002F247 /* AppDelegate.h */, + 88CA41BA17D039A90002F247 /* AppDelegate.m */, + 88CA41BC17D039A90002F247 /* Main.storyboard */, + 88CA41BF17D039A90002F247 /* ViewController.h */, + 88CA41C017D039A90002F247 /* ViewController.m */, + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */, + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */, + 88CA41C217D039A90002F247 /* Images.xcassets */, + 88CA41B117D039A90002F247 /* Supporting Files */, + ); + path = "Recipe 12-1: Drawing Simple Shapes"; + sourceTree = ""; + }; + 88CA41B117D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41B217D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes-Info.plist */, + 88CA41B317D039A90002F247 /* InfoPlist.strings */, + 88CA41B617D039A90002F247 /* main.m */, + 88CA41B817D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CA41CF17D039A90002F247 /* Recipe 12-1: Drawing Simple ShapesTests */ = { + isa = PBXGroup; + children = ( + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */, + 88CA41D017D039A90002F247 /* Supporting Files */, + ); + path = "Recipe 12-1: Drawing Simple ShapesTests"; + sourceTree = ""; + }; + 88CA41D017D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41D117D039A90002F247 /* Recipe 12-1 Drawing Simple ShapesTests-Info.plist */, + 88CA41D217D039A90002F247 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CA41A617D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-1 Drawing Simple Shapes" */; + buildPhases = ( + 88CA41A317D039A90002F247 /* Sources */, + 88CA41A417D039A90002F247 /* Frameworks */, + 88CA41A517D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 12-1 Drawing Simple Shapes"; + productName = "Recipe 12-1: Drawing Simple Shapes"; + productReference = 88CA41A717D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes.app */; + productType = "com.apple.product-type.application"; + }; + 88CA41C717D039A90002F247 /* Recipe 12-1 Drawing Simple ShapesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41DC17D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-1 Drawing Simple ShapesTests" */; + buildPhases = ( + 88CA41C417D039A90002F247 /* Sources */, + 88CA41C517D039A90002F247 /* Frameworks */, + 88CA41C617D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CA41CE17D039A90002F247 /* PBXTargetDependency */, + ); + name = "Recipe 12-1 Drawing Simple ShapesTests"; + productName = "Recipe 12-1: Drawing Simple ShapesTests"; + productReference = 88CA41C817D039A90002F247 /* Recipe 12-1 Drawing Simple ShapesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CA419F17D039A90002F247 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CA41C717D039A90002F247 = { + TestTargetID = 88CA41A617D039A90002F247; + }; + }; + }; + buildConfigurationList = 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-1 Drawing Simple Shapes" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CA419E17D039A90002F247; + productRefGroup = 88CA41A817D039A90002F247 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CA41A617D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes */, + 88CA41C717D039A90002F247 /* Recipe 12-1 Drawing Simple ShapesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CA41A517D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */, + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */, + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CA41C617D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41D417D039A90002F247 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CA41A317D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C117D039A90002F247 /* ViewController.m in Sources */, + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */, + 88CA41B717D039A90002F247 /* main.m in Sources */, + 88CA41E117D039D80002F247 /* GraphicsRecipesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CA41C417D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41D617D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CA41CE17D039A90002F247 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CA41A617D039A90002F247 /* Recipe 12-1 Drawing Simple Shapes */; + targetProxy = 88CA41CD17D039A90002F247 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CA41B317D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41B417D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CA41BC17D039A90002F247 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CA41BD17D039A90002F247 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CA41D217D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41D317D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CA41D717D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CA41D817D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CA41DA17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Info.plist"; + PRODUCT_NAME = "Recipe 12-1 Drawing Simple Shapes"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CA41DB17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Info.plist"; + PRODUCT_NAME = "Recipe 12-1 Drawing Simple Shapes"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CA41DD17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 12-1: Drawing Simple Shapes.app/Recipe 12-1: Drawing Simple Shapes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1: Drawing Simple Shapes-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple ShapesTests/Recipe 12-1 Drawing Simple ShapesTests-Info.plist"; + PRODUCT_NAME = "Recipe 12-1 Drawing Simple ShapesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CA41DE17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 12-1: Drawing Simple Shapes.app/Recipe 12-1: Drawing Simple Shapes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1: Drawing Simple Shapes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple ShapesTests/Recipe 12-1 Drawing Simple ShapesTests-Info.plist"; + PRODUCT_NAME = "Recipe 12-1 Drawing Simple ShapesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-1 Drawing Simple Shapes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41D717D039A90002F247 /* Debug */, + 88CA41D817D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-1 Drawing Simple Shapes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DA17D039A90002F247 /* Debug */, + 88CA41DB17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 88CA41DC17D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-1 Drawing Simple ShapesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DD17D039A90002F247 /* Debug */, + 88CA41DE17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CA419F17D039A90002F247 /* Project object */; +} diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..efeff2d --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..cecfce0 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme new file mode 100644 index 0000000..fa547c2 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..50ff320 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 12-1: Drawing Simple Shapes.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CA41A617D039A90002F247 + + primary + + + 88CA41C717D039A90002F247 + + primary + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h new file mode 100644 index 0000000..96410da --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m new file mode 100644 index 0000000..6e85d6b --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..1e936ba --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h new file mode 100644 index 0000000..4bde757 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h @@ -0,0 +1,13 @@ +// +// GraphicsRecipesView.h +// Recipe 12-1 Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface GraphicsRecipesView : UIView + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m new file mode 100644 index 0000000..313f74b --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m @@ -0,0 +1,68 @@ +// +// GraphicsRecipesView.m +// Recipe 12-1 Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GraphicsRecipesView.h" + +@implementation GraphicsRecipesView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + + CGContextRef context = UIGraphicsGetCurrentContext(); + + //Call function to draw rectangle + [self drawRectangleAtTopOfScreen:context]; + + //call function to draw circle + [self drawEllipse:context]; + +} + +-(void)drawRectangleAtTopOfScreen:(CGContextRef)context +{ + + CGContextSaveGState(context); + //Set color of current context + [[UIColor lightGrayColor] set]; + + //Draw rectangle + CGRect drawingRect = CGRectMake(0.0, 0.0f, 320.0f, 60.0f); + CGContextFillRect(context, drawingRect); + CGContextRestoreGState(context); + +} + +-(void)drawEllipse:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor whiteColor] set]; + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(60.0f, 150.0f, 200.0f, 200.0f); + CGContextFillEllipseInRect(context, ellipseRect); + CGContextRestoreGState(context); + +} + + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Info.plist b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Info.plist new file mode 100644 index 0000000..67948fe --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Prefix.pch b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1 Drawing Simple Shapes-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/ViewController.h b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/ViewController.h new file mode 100644 index 0000000..b819825 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/ViewController.m b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/ViewController.m new file mode 100644 index 0000000..96195b0 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/main.m b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/main.m new file mode 100644 index 0000000..8b72181 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple Shapes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-1 Drawing Simple ShapesTests-Info.plist b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-1 Drawing Simple ShapesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-1 Drawing Simple ShapesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m new file mode 100644 index 0000000..90fe98e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_12_1__Drawing_Simple_ShapesTests.m +// Recipe 12-1: Drawing Simple ShapesTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_12_1__Drawing_Simple_ShapesTests : XCTestCase + +@end + +@implementation Recipe_12_1__Drawing_Simple_ShapesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/.DS_Store new file mode 100644 index 0000000..52f1045 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h new file mode 100644 index 0000000..6f1f35f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 12-2 Drawing Paths +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m new file mode 100644 index 0000000..2071ad0 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 12-2 Drawing Paths +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b4da838 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h new file mode 100644 index 0000000..d7fb496 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h @@ -0,0 +1,13 @@ +// +// GraphicsRecipesView.h +// Recipe 12-2 Drawing Paths +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface GraphicsRecipesView : UIView + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m new file mode 100644 index 0000000..8b18e22 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m @@ -0,0 +1,115 @@ +// +// GraphicsRecipesView.m +// Recipe 12-2 Drawing Paths +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GraphicsRecipesView.h" + +@implementation GraphicsRecipesView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + + CGContextRef context = UIGraphicsGetCurrentContext(); + + //Call function to draw rectangle + [self drawRectangleAtTopOfScreen:context]; + + //call function to draw circle + [self drawEllipse:context]; + + //call function to draw triangle + [self drawTriangle:context]; + + //call function to draw arc + [self drawArc:context]; + +} + +-(void)drawRectangleAtTopOfScreen:(CGContextRef)context +{ + + CGContextSaveGState(context); + //Set color of current context + [[UIColor lightGrayColor] set]; + + //Draw rectangle + CGRect drawingRect = CGRectMake(0.0, 0.0f, 320.0f, 60.0f); + CGContextFillRect(context, drawingRect); + CGContextRestoreGState(context); + +} + +-(void)drawEllipse:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor whiteColor] set]; + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(60.0f, 150.0f, 200.0f, 200.0f); + CGContextFillEllipseInRect(context, ellipseRect); + CGContextRestoreGState(context); + +} + +-(void)drawTriangle:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f] set]; + + // Draw Triangle + CGContextBeginPath(context); + CGContextMoveToPoint(context, 140.0f, 380.0f); + CGContextAddLineToPoint(context, 190.0f, 400.0f); + CGContextAddLineToPoint(context, 140.0f, 420.0f); + CGContextClosePath(context); + CGContextSetGrayFillColor(context, 0.1f, 0.85f); + CGContextSetGrayStrokeColor(context, 0.0, 0.0); + CGContextFillPath(context); + CGContextRestoreGState(context); +} + +-(void)drawArc:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.30f + green:0.30f + blue:0.30f + alpha:1.0f] set]; + + //Draw Arc + CGContextAddArc(context, 160.0f, 250.0f, 70.0f, 0.0f, 3.14, 0); + CGContextSetLineWidth(context, 50.0f); + CGContextDrawPath(context, kCGPathStroke); + CGContextRestoreGState(context); +} + + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Info.plist b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Info.plist new file mode 100644 index 0000000..67948fe --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Prefix.pch b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/ViewController.h b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/ViewController.h new file mode 100644 index 0000000..f1c42d8 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 12-2 Drawing Paths +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/ViewController.m b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/ViewController.m new file mode 100644 index 0000000..d302118 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 12-2 Drawing Paths +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/main.m b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/main.m new file mode 100644 index 0000000..8b72181 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple Shapes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-2 Drawing PathsTests-Info.plist b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-2 Drawing PathsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-2 Drawing PathsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m new file mode 100644 index 0000000..90fe98e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_12_1__Drawing_Simple_ShapesTests.m +// Recipe 12-1: Drawing Simple ShapesTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_12_1__Drawing_Simple_ShapesTests : XCTestCase + +@end + +@implementation Recipe_12_1__Drawing_Simple_ShapesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.pbxproj b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b1c9436 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.pbxproj @@ -0,0 +1,479 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AC17D039A90002F247 /* CoreGraphics.framework */; }; + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41B317D039A90002F247 /* InfoPlist.strings */; }; + 88CA41B717D039A90002F247 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41B617D039A90002F247 /* main.m */; }; + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41BA17D039A90002F247 /* AppDelegate.m */; }; + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41BC17D039A90002F247 /* Main.storyboard */; }; + 88CA41C117D039A90002F247 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41C017D039A90002F247 /* ViewController.m */; }; + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41C217D039A90002F247 /* Images.xcassets */; }; + 88CA41CA17D039A90002F247 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41C917D039A90002F247 /* XCTest.framework */; }; + 88CA41CB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41CC17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41D417D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41D217D039A90002F247 /* InfoPlist.strings */; }; + 88CA41D617D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */; }; + 88CA41E117D039D80002F247 /* GraphicsRecipesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CA41CD17D039A90002F247 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CA419F17D039A90002F247 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CA41A617D039A90002F247; + remoteInfo = "Recipe 12-1: Drawing Simple Shapes"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CA41A717D039A90002F247 /* Recipe 12-2 Drawing Paths.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 12-2 Drawing Paths.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41AA17D039A90002F247 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CA41AE17D039A90002F247 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CA41B217D039A90002F247 /* Recipe 12-2 Drawing Paths-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-2 Drawing Paths-Info.plist"; sourceTree = ""; }; + 88CA41B417D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41B617D039A90002F247 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CA41B817D039A90002F247 /* Recipe 12-2 Drawing Paths-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 12-2 Drawing Paths-Prefix.pch"; sourceTree = ""; }; + 88CA41B917D039A90002F247 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CA41BA17D039A90002F247 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CA41BD17D039A90002F247 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CA41BF17D039A90002F247 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CA41C017D039A90002F247 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CA41C217D039A90002F247 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CA41C817D039A90002F247 /* Recipe 12-2 Drawing PathsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 12-2 Drawing PathsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41C917D039A90002F247 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CA41D117D039A90002F247 /* Recipe 12-2 Drawing PathsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-2 Drawing PathsTests-Info.plist"; sourceTree = ""; }; + 88CA41D317D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_12_1__Drawing_Simple_ShapesTests.m; sourceTree = ""; }; + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsRecipesView.h; sourceTree = ""; }; + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphicsRecipesView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CA41A417D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */, + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CA41C517D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41CA17D039A90002F247 /* XCTest.framework in Frameworks */, + 88CA41CC17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41CB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CA419E17D039A90002F247 = { + isa = PBXGroup; + children = ( + 88CA41B017D039A90002F247 /* Recipe 12-2 Drawing Paths */, + 88CA41CF17D039A90002F247 /* Recipe 12-2 Drawings Paths Tests */, + 88CA41A917D039A90002F247 /* Frameworks */, + 88CA41A817D039A90002F247 /* Products */, + ); + sourceTree = ""; + }; + 88CA41A817D039A90002F247 /* Products */ = { + isa = PBXGroup; + children = ( + 88CA41A717D039A90002F247 /* Recipe 12-2 Drawing Paths.app */, + 88CA41C817D039A90002F247 /* Recipe 12-2 Drawing PathsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CA41A917D039A90002F247 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CA41AA17D039A90002F247 /* Foundation.framework */, + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */, + 88CA41AE17D039A90002F247 /* UIKit.framework */, + 88CA41C917D039A90002F247 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CA41B017D039A90002F247 /* Recipe 12-2 Drawing Paths */ = { + isa = PBXGroup; + children = ( + 88CA41B917D039A90002F247 /* AppDelegate.h */, + 88CA41BA17D039A90002F247 /* AppDelegate.m */, + 88CA41BC17D039A90002F247 /* Main.storyboard */, + 88CA41BF17D039A90002F247 /* ViewController.h */, + 88CA41C017D039A90002F247 /* ViewController.m */, + 88CA41B617D039A90002F247 /* main.m */, + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */, + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */, + 88CA41C217D039A90002F247 /* Images.xcassets */, + 88CA41B117D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-2 Drawing Paths"; + path = "Recipe 12-1: Drawing Simple Shapes"; + sourceTree = ""; + }; + 88CA41B117D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41B217D039A90002F247 /* Recipe 12-2 Drawing Paths-Info.plist */, + 88CA41B317D039A90002F247 /* InfoPlist.strings */, + 88CA41B817D039A90002F247 /* Recipe 12-2 Drawing Paths-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CA41CF17D039A90002F247 /* Recipe 12-2 Drawings Paths Tests */ = { + isa = PBXGroup; + children = ( + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */, + 88CA41D017D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-2 Drawings Paths Tests"; + path = "Recipe 12-1: Drawing Simple ShapesTests"; + sourceTree = ""; + }; + 88CA41D017D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41D117D039A90002F247 /* Recipe 12-2 Drawing PathsTests-Info.plist */, + 88CA41D217D039A90002F247 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CA41A617D039A90002F247 /* Recipe 12-2 Drawing Paths */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-2 Drawing Paths" */; + buildPhases = ( + 88CA41A317D039A90002F247 /* Sources */, + 88CA41A417D039A90002F247 /* Frameworks */, + 88CA41A517D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 12-2 Drawing Paths"; + productName = "Recipe 12-1: Drawing Simple Shapes"; + productReference = 88CA41A717D039A90002F247 /* Recipe 12-2 Drawing Paths.app */; + productType = "com.apple.product-type.application"; + }; + 88CA41C717D039A90002F247 /* Recipe 12-2 Drawing PathsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41DC17D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-2 Drawing PathsTests" */; + buildPhases = ( + 88CA41C417D039A90002F247 /* Sources */, + 88CA41C517D039A90002F247 /* Frameworks */, + 88CA41C617D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CA41CE17D039A90002F247 /* PBXTargetDependency */, + ); + name = "Recipe 12-2 Drawing PathsTests"; + productName = "Recipe 12-1: Drawing Simple ShapesTests"; + productReference = 88CA41C817D039A90002F247 /* Recipe 12-2 Drawing PathsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CA419F17D039A90002F247 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CA41C717D039A90002F247 = { + TestTargetID = 88CA41A617D039A90002F247; + }; + }; + }; + buildConfigurationList = 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-2 Drawing Paths" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CA419E17D039A90002F247; + productRefGroup = 88CA41A817D039A90002F247 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CA41A617D039A90002F247 /* Recipe 12-2 Drawing Paths */, + 88CA41C717D039A90002F247 /* Recipe 12-2 Drawing PathsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CA41A517D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */, + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */, + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CA41C617D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41D417D039A90002F247 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CA41A317D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C117D039A90002F247 /* ViewController.m in Sources */, + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */, + 88CA41B717D039A90002F247 /* main.m in Sources */, + 88CA41E117D039D80002F247 /* GraphicsRecipesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CA41C417D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41D617D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CA41CE17D039A90002F247 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CA41A617D039A90002F247 /* Recipe 12-2 Drawing Paths */; + targetProxy = 88CA41CD17D039A90002F247 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CA41B317D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41B417D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CA41BC17D039A90002F247 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CA41BD17D039A90002F247 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CA41D217D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41D317D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CA41D717D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CA41D817D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CA41DA17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Info.plist"; + PRODUCT_NAME = "Recipe 12-2 Drawing Paths"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CA41DB17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-2 Drawing Paths-Info.plist"; + PRODUCT_NAME = "Recipe 12-2 Drawing Paths"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CA41DD17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 12-1: Drawing Simple Shapes.app/Recipe 12-1: Drawing Simple Shapes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1: Drawing Simple Shapes-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple ShapesTests/Recipe 12-2 Drawing PathsTests-Info.plist"; + PRODUCT_NAME = "Recipe 12-2 Drawing PathsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CA41DE17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 12-1: Drawing Simple Shapes.app/Recipe 12-1: Drawing Simple Shapes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-1: Drawing Simple Shapes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple ShapesTests/Recipe 12-2 Drawing PathsTests-Info.plist"; + PRODUCT_NAME = "Recipe 12-2 Drawing PathsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-2 Drawing Paths" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41D717D039A90002F247 /* Debug */, + 88CA41D817D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-2 Drawing Paths" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DA17D039A90002F247 /* Debug */, + 88CA41DB17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41DC17D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-2 Drawing PathsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DD17D039A90002F247 /* Debug */, + 88CA41DE17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CA419F17D039A90002F247 /* Project object */; +} diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..52dab81 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..8ce454f Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-2 Drawing Paths.xcscheme b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-2 Drawing Paths.xcscheme new file mode 100644 index 0000000..0298789 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-2 Drawing Paths.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..959a2e8 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-2 Drawing Paths/Recipe 12-2 Drawing Paths.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 12-2 Drawing Paths.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CA41A617D039A90002F247 + + primary + + + 88CA41C717D039A90002F247 + + primary + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/.DS_Store new file mode 100644 index 0000000..dd628d1 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h new file mode 100644 index 0000000..f662355 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 12-3 Adding Fonts and Drawing Text +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m new file mode 100644 index 0000000..3c31cdb --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 12-3 Adding Fonts and Drawing Text +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..1e936ba --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h new file mode 100644 index 0000000..6ebd972 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h @@ -0,0 +1,14 @@ +// +// GraphicsRecipesView.h +// Recipe 12-3 Adding Fonts and Drawing Text +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + + +@interface GraphicsRecipesView : UIView + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m new file mode 100644 index 0000000..5cfea13 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m @@ -0,0 +1,142 @@ +// +// GraphicsRecipesView.m +// Recipe 12-3 Adding Fonts and Drawing Text +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GraphicsRecipesView.h" + + +@implementation GraphicsRecipesView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + + CGContextRef context = UIGraphicsGetCurrentContext(); + + //Call function to draw rectangle + [self drawRectangleAtTopOfScreen:context]; + + //call function to draw circle + [self drawEllipse:context]; + + //call function to draw triangle + [self drawTriangle:context]; + + //call function to draw arc + [self drawArc:context]; + + //call function to draw text + [self drawTextAtTopOfScreen:context]; + +} + +-(void)drawRectangleAtTopOfScreen:(CGContextRef)context +{ + + CGContextSaveGState(context); + //Set color of current context + [[UIColor lightGrayColor] set]; + + //Draw rectangle + CGRect drawingRect = CGRectMake(0.0, 0.0f, 320.0f, 60.0f); + CGContextFillRect(context, drawingRect); + CGContextRestoreGState(context); + +} + +-(void)drawEllipse:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor whiteColor] set]; + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(60.0f, 150.0f, 200.0f, 200.0f); + CGContextFillEllipseInRect(context, ellipseRect); + CGContextRestoreGState(context); + +} + +-(void)drawTriangle:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f] set]; + + // Draw Triangle + CGContextBeginPath(context); + CGContextMoveToPoint(context, 140.0f, 380.0f); + CGContextAddLineToPoint(context, 190.0f, 400.0f); + CGContextAddLineToPoint(context, 140.0f, 420.0f); + CGContextClosePath(context); + CGContextSetGrayFillColor(context, 0.1f, 0.85f); + CGContextSetGrayStrokeColor(context, 0.0, 0.0); + CGContextFillPath(context); + CGContextRestoreGState(context); +} + +-(void)drawArc:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.30f + green:0.30f + blue:0.30f + alpha:1.0f] set]; + + //Draw Arc + CGContextAddArc(context, 160.0f, 250.0f, 70.0f, 0.0f, 3.14, 0); + CGContextSetLineWidth(context, 50.0f); + CGContextDrawPath(context, kCGPathStroke); + CGContextRestoreGState(context); +} + +-(void)drawTextAtTopOfScreen:(CGContextRef)context{ + + CGContextSaveGState(context); + + //Create UIColor to pass into text attributes + UIColor *textColor = [UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f]; + + //Set font + UIFont *customFont = [UIFont fontWithName:@"OleoScriptSwashCaps-Bold" size:40.0f ]; + //UIFont *customFont = [UIFont systemFontOfSize:20.0f]; + NSString *titleText = @"iOS Recipes!"; + + + [titleText drawAtPoint:CGPointMake(55,5) withAttributes:@{NSFontAttributeName:customFont, + NSForegroundColorAttributeName:textColor}]; + CGContextRestoreGState(context); + + +} + + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf new file mode 100644 index 0000000..81faa2a Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf differ diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Info.plist b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Info.plist new file mode 100644 index 0000000..24cdc50 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Info.plist @@ -0,0 +1,46 @@ + + + + + UIAppFonts + + OleoScriptSwashCaps-Bold.ttf + + CFBundleGetInfoString + + LSApplicationCategoryType + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/ViewController.h b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/ViewController.h new file mode 100644 index 0000000..2015ce4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 12-3 Adding Fonts and Drawing Text +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/ViewController.m b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/ViewController.m new file mode 100644 index 0000000..07c6124 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 12-3 Adding Fonts and Drawing Text +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/main.m b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/main.m new file mode 100644 index 0000000..8b72181 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple Shapes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m new file mode 100644 index 0000000..90fe98e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_12_1__Drawing_Simple_ShapesTests.m +// Recipe 12-1: Drawing Simple ShapesTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_12_1__Drawing_Simple_ShapesTests : XCTestCase + +@end + +@implementation Recipe_12_1__Drawing_Simple_ShapesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.pbxproj b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5eb9663 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.pbxproj @@ -0,0 +1,359 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */; }; + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AC17D039A90002F247 /* CoreGraphics.framework */; }; + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41B317D039A90002F247 /* InfoPlist.strings */; }; + 88CA41B717D039A90002F247 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41B617D039A90002F247 /* main.m */; }; + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41BA17D039A90002F247 /* AppDelegate.m */; }; + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41BC17D039A90002F247 /* Main.storyboard */; }; + 88CA41C117D039A90002F247 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41C017D039A90002F247 /* ViewController.m */; }; + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41C217D039A90002F247 /* Images.xcassets */; }; + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OleoScriptSwashCaps-Bold.ttf"; sourceTree = ""; }; + 88CA41A717D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 12-3 Adding Fonts and Drawing Text.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41AA17D039A90002F247 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CA41AE17D039A90002F247 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CA41B217D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-3 Adding Fonts and Drawing Text-Info.plist"; sourceTree = ""; }; + 88CA41B417D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41B617D039A90002F247 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CA41B817D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch"; sourceTree = ""; }; + 88CA41B917D039A90002F247 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CA41BA17D039A90002F247 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CA41BD17D039A90002F247 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CA41BF17D039A90002F247 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CA41C017D039A90002F247 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CA41C217D039A90002F247 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CA41C917D039A90002F247 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist"; sourceTree = ""; }; + 88CA41D317D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_12_1__Drawing_Simple_ShapesTests.m; sourceTree = ""; }; + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsRecipesView.h; sourceTree = ""; }; + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphicsRecipesView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CA41A417D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */, + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CA419E17D039A90002F247 = { + isa = PBXGroup; + children = ( + 88CA41B017D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text */, + 88CA41CF17D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text Tests */, + 88CA41A917D039A90002F247 /* Frameworks */, + 88CA41A817D039A90002F247 /* Products */, + ); + sourceTree = ""; + }; + 88CA41A817D039A90002F247 /* Products */ = { + isa = PBXGroup; + children = ( + 88CA41A717D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text.app */, + ); + name = Products; + sourceTree = ""; + }; + 88CA41A917D039A90002F247 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CA41AA17D039A90002F247 /* Foundation.framework */, + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */, + 88CA41AE17D039A90002F247 /* UIKit.framework */, + 88CA41C917D039A90002F247 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CA41B017D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text */ = { + isa = PBXGroup; + children = ( + 88CA41B917D039A90002F247 /* AppDelegate.h */, + 88CA41BA17D039A90002F247 /* AppDelegate.m */, + 88CA41BC17D039A90002F247 /* Main.storyboard */, + 88CA41BF17D039A90002F247 /* ViewController.h */, + 88CA41C017D039A90002F247 /* ViewController.m */, + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */, + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */, + 88CA41C217D039A90002F247 /* Images.xcassets */, + 88CA41B117D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-3 Adding Fonts and Drawing Text"; + path = "Recipe 12-1: Drawing Simple Shapes"; + sourceTree = ""; + }; + 88CA41B117D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */, + 88CA41B217D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text-Info.plist */, + 88CA41B317D039A90002F247 /* InfoPlist.strings */, + 88CA41B617D039A90002F247 /* main.m */, + 88CA41B817D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CA41CF17D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text Tests */ = { + isa = PBXGroup; + children = ( + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */, + 88CA41D017D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-3 Adding Fonts and Drawing Text Tests"; + path = "Recipe 12-1: Drawing Simple ShapesTests"; + sourceTree = ""; + }; + 88CA41D017D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */, + 88CA41D217D039A90002F247 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CA41A617D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-3 Adding Fonts and Drawing Text" */; + buildPhases = ( + 88CA41A317D039A90002F247 /* Sources */, + 88CA41A417D039A90002F247 /* Frameworks */, + 88CA41A517D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 12-3 Adding Fonts and Drawing Text"; + productName = "Recipe 12-1: Drawing Simple Shapes"; + productReference = 88CA41A717D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CA419F17D039A90002F247 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + }; + buildConfigurationList = 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-3 Adding Fonts and Drawing Text" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CA419E17D039A90002F247; + productRefGroup = 88CA41A817D039A90002F247 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CA41A617D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing Text */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CA41A517D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */, + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */, + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */, + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CA41A317D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C117D039A90002F247 /* ViewController.m in Sources */, + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */, + 88CA41B717D039A90002F247 /* main.m in Sources */, + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 88CA41B317D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41B417D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CA41BC17D039A90002F247 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CA41BD17D039A90002F247 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CA41D217D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41D317D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CA41D717D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CA41D817D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CA41DA17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Info.plist"; + PRODUCT_NAME = "Recipe 12-3 Adding Fonts and Drawing Text"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CA41DB17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-3 Adding Fonts and Drawing Text-Info.plist"; + PRODUCT_NAME = "Recipe 12-3 Adding Fonts and Drawing Text"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-3 Adding Fonts and Drawing Text" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41D717D039A90002F247 /* Debug */, + 88CA41D817D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-3 Adding Fonts and Drawing Text" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DA17D039A90002F247 /* Debug */, + 88CA41DB17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CA419F17D039A90002F247 /* Project object */; +} diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..4f4075b --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..3476ac7 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e0f99f6 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-3 Adding Fonts and Drawing Text/Recipe 12-3 Adding Fonts and Drawing Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 12-3 Adding Fonts and Drawing Text.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CA41A617D039A90002F247 + + primary + + + 88CA41C717D039A90002F247 + + primary + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/.DS_Store new file mode 100644 index 0000000..23cfea8 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h new file mode 100644 index 0000000..8186cf1 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 12-4 Adding Shadows +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m new file mode 100644 index 0000000..148a979 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 12-4 Adding Shadows +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..1e936ba --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h new file mode 100644 index 0000000..df5bbf8 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h @@ -0,0 +1,14 @@ +// +// GraphicsRecipesView.h +// Recipe 12-4 Adding Shadows +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + + +@interface GraphicsRecipesView : UIView + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m new file mode 100644 index 0000000..31e170c --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m @@ -0,0 +1,151 @@ +// +// GraphicsRecipesView.m +// Recipe 12-4 Adding Shadows +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GraphicsRecipesView.h" + + +@implementation GraphicsRecipesView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + + CGContextRef context = UIGraphicsGetCurrentContext(); + + //Call function to draw rectangle + [self drawRectangleAtTopOfScreen:context]; + + //call function to draw circle + [self drawEllipse:context]; + + //call function to draw triangle + [self drawTriangle:context]; + + //call function to draw arc + [self drawArc:context]; + + //call function to draw text + [self drawTextAtTopOfScreen:context]; + + + +} + +-(void)drawRectangleAtTopOfScreen:(CGContextRef)context +{ + + CGContextSaveGState(context); + //Set color of current context + [[UIColor lightGrayColor] set]; + + //Draw rectangle + CGRect drawingRect = CGRectMake(0.0, 0.0f, 320.0f, 60.0f); + CGContextFillRect(context, drawingRect); + CGContextRestoreGState(context); + +} + +-(void)drawEllipse:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor whiteColor] set]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(60.0f, 150.0f, 200.0f, 200.0f); + CGContextFillEllipseInRect(context, ellipseRect); + CGContextRestoreGState(context); + +} + +-(void)drawTriangle:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f] set]; + + // Draw Triangle + CGContextBeginPath(context); + CGContextMoveToPoint(context, 140.0f, 380.0f); + CGContextAddLineToPoint(context, 190.0f, 400.0f); + CGContextAddLineToPoint(context, 140.0f, 420.0f); + CGContextClosePath(context); + CGContextSetGrayFillColor(context, 0.1f, 0.85f); + CGContextSetGrayStrokeColor(context, 0.0, 0.0); + CGContextFillPath(context); + CGContextRestoreGState(context); +} + +-(void)drawArc:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.30f + green:0.30f + blue:0.30f + alpha:1.0f] set]; + + //Draw Arc + CGContextAddArc(context, 160.0f, 250.0f, 70.0f, 0.0f, 3.14, 0); + CGContextSetLineWidth(context, 50.0f); + CGContextDrawPath(context, kCGPathStroke); + CGContextRestoreGState(context); +} + +-(void)drawTextAtTopOfScreen:(CGContextRef)context{ + + CGContextSaveGState(context); + + //Create UIColor to pass into text attributes + UIColor *textColor = [UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Set font + UIFont *customFont = [UIFont fontWithName:@"OleoScriptSwashCaps-Bold" size:40.0f ]; + //UIFont *customFont = [UIFont systemFontOfSize:20.0f]; + NSString *titleText = @"iOS Recipes!"; + + + [titleText drawAtPoint:CGPointMake(55,5) withAttributes:@{NSFontAttributeName:customFont, + NSForegroundColorAttributeName:textColor}]; + CGContextRestoreGState(context); + + +} + + + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf new file mode 100644 index 0000000..81faa2a Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf differ diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Info.plist b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Info.plist new file mode 100644 index 0000000..24cdc50 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Info.plist @@ -0,0 +1,46 @@ + + + + + UIAppFonts + + OleoScriptSwashCaps-Bold.ttf + + CFBundleGetInfoString + + LSApplicationCategoryType + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Prefix.pch b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/ViewController.h b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/ViewController.h new file mode 100644 index 0000000..2fbd9bf --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 12-4 Adding Shadows +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/ViewController.m b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/ViewController.m new file mode 100644 index 0000000..8633c53 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 12-4 Adding Shadows +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/main.m b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/main.m new file mode 100644 index 0000000..8b72181 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple Shapes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m new file mode 100644 index 0000000..90fe98e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_12_1__Drawing_Simple_ShapesTests.m +// Recipe 12-1: Drawing Simple ShapesTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_12_1__Drawing_Simple_ShapesTests : XCTestCase + +@end + +@implementation Recipe_12_1__Drawing_Simple_ShapesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.pbxproj b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.pbxproj new file mode 100644 index 0000000..293481e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.pbxproj @@ -0,0 +1,359 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */; }; + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AC17D039A90002F247 /* CoreGraphics.framework */; }; + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41B317D039A90002F247 /* InfoPlist.strings */; }; + 88CA41B717D039A90002F247 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41B617D039A90002F247 /* main.m */; }; + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41BA17D039A90002F247 /* AppDelegate.m */; }; + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41BC17D039A90002F247 /* Main.storyboard */; }; + 88CA41C117D039A90002F247 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41C017D039A90002F247 /* ViewController.m */; }; + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41C217D039A90002F247 /* Images.xcassets */; }; + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OleoScriptSwashCaps-Bold.ttf"; sourceTree = ""; }; + 88CA41A717D039A90002F247 /* Recipe 12-4 Adding Shadows.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 12-4 Adding Shadows.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41AA17D039A90002F247 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CA41AE17D039A90002F247 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CA41B217D039A90002F247 /* Recipe 12-4 Adding Shadows-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-4 Adding Shadows-Info.plist"; sourceTree = ""; }; + 88CA41B417D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41B617D039A90002F247 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CA41B817D039A90002F247 /* Recipe 12-4 Adding Shadows-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 12-4 Adding Shadows-Prefix.pch"; sourceTree = ""; }; + 88CA41B917D039A90002F247 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CA41BA17D039A90002F247 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CA41BD17D039A90002F247 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CA41BF17D039A90002F247 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CA41C017D039A90002F247 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CA41C217D039A90002F247 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CA41C917D039A90002F247 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist"; sourceTree = ""; }; + 88CA41D317D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_12_1__Drawing_Simple_ShapesTests.m; sourceTree = ""; }; + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsRecipesView.h; sourceTree = ""; }; + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphicsRecipesView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CA41A417D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */, + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CA419E17D039A90002F247 = { + isa = PBXGroup; + children = ( + 88CA41B017D039A90002F247 /* Recipe 12-4 Adding Shadows */, + 88CA41CF17D039A90002F247 /* Recipe 12-3 Adding Shadows Tests */, + 88CA41A917D039A90002F247 /* Frameworks */, + 88CA41A817D039A90002F247 /* Products */, + ); + sourceTree = ""; + }; + 88CA41A817D039A90002F247 /* Products */ = { + isa = PBXGroup; + children = ( + 88CA41A717D039A90002F247 /* Recipe 12-4 Adding Shadows.app */, + ); + name = Products; + sourceTree = ""; + }; + 88CA41A917D039A90002F247 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CA41AA17D039A90002F247 /* Foundation.framework */, + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */, + 88CA41AE17D039A90002F247 /* UIKit.framework */, + 88CA41C917D039A90002F247 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CA41B017D039A90002F247 /* Recipe 12-4 Adding Shadows */ = { + isa = PBXGroup; + children = ( + 88CA41B917D039A90002F247 /* AppDelegate.h */, + 88CA41BA17D039A90002F247 /* AppDelegate.m */, + 88CA41BC17D039A90002F247 /* Main.storyboard */, + 88CA41BF17D039A90002F247 /* ViewController.h */, + 88CA41C017D039A90002F247 /* ViewController.m */, + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */, + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */, + 88CA41C217D039A90002F247 /* Images.xcassets */, + 88CA41B117D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-4 Adding Shadows"; + path = "Recipe 12-1: Drawing Simple Shapes"; + sourceTree = ""; + }; + 88CA41B117D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */, + 88CA41B217D039A90002F247 /* Recipe 12-4 Adding Shadows-Info.plist */, + 88CA41B317D039A90002F247 /* InfoPlist.strings */, + 88CA41B617D039A90002F247 /* main.m */, + 88CA41B817D039A90002F247 /* Recipe 12-4 Adding Shadows-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CA41CF17D039A90002F247 /* Recipe 12-3 Adding Shadows Tests */ = { + isa = PBXGroup; + children = ( + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */, + 88CA41D017D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-3 Adding Shadows Tests"; + path = "Recipe 12-1: Drawing Simple ShapesTests"; + sourceTree = ""; + }; + 88CA41D017D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */, + 88CA41D217D039A90002F247 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CA41A617D039A90002F247 /* Recipe 12-4 Adding Shadows */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-4 Adding Shadows" */; + buildPhases = ( + 88CA41A317D039A90002F247 /* Sources */, + 88CA41A417D039A90002F247 /* Frameworks */, + 88CA41A517D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 12-4 Adding Shadows"; + productName = "Recipe 12-1: Drawing Simple Shapes"; + productReference = 88CA41A717D039A90002F247 /* Recipe 12-4 Adding Shadows.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CA419F17D039A90002F247 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + }; + buildConfigurationList = 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-4 Adding Shadows" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CA419E17D039A90002F247; + productRefGroup = 88CA41A817D039A90002F247 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CA41A617D039A90002F247 /* Recipe 12-4 Adding Shadows */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CA41A517D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */, + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */, + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */, + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CA41A317D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C117D039A90002F247 /* ViewController.m in Sources */, + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */, + 88CA41B717D039A90002F247 /* main.m in Sources */, + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 88CA41B317D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41B417D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CA41BC17D039A90002F247 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CA41BD17D039A90002F247 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CA41D217D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41D317D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CA41D717D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CA41D817D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CA41DA17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Info.plist"; + PRODUCT_NAME = "Recipe 12-4 Adding Shadows"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CA41DB17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-4 Adding Shadows-Info.plist"; + PRODUCT_NAME = "Recipe 12-4 Adding Shadows"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-4 Adding Shadows" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41D717D039A90002F247 /* Debug */, + 88CA41D817D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-4 Adding Shadows" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DA17D039A90002F247 /* Debug */, + 88CA41DB17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CA419F17D039A90002F247 /* Project object */; +} diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c27c482 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..89ce5e7 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme new file mode 100644 index 0000000..e681253 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..50ff320 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-4 Adding Shadows/Recipe 12-4 Adding Shadows.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 12-1: Drawing Simple Shapes.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CA41A617D039A90002F247 + + primary + + + 88CA41C717D039A90002F247 + + primary + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/.DS_Store new file mode 100644 index 0000000..4f512e0 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h new file mode 100644 index 0000000..8f04e87 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 12-5 Creating Gradients +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m new file mode 100644 index 0000000..1b56715 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 12-5 Creating Gradients +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..1e936ba --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h new file mode 100644 index 0000000..eac15d6 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h @@ -0,0 +1,14 @@ +// +// GraphicsRecipesView.h +// Recipe 12-5 Creating Gradients +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + + +@interface GraphicsRecipesView : UIView + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m new file mode 100644 index 0000000..2c6aead --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m @@ -0,0 +1,172 @@ +// +// GraphicsRecipesView.m +// Recipe 12-5 Creating Gradients +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GraphicsRecipesView.h" + + +@implementation GraphicsRecipesView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + + CGContextRef context = UIGraphicsGetCurrentContext(); + + //Call function to draw rectangle + [self drawRectangleAtTopOfScreen:context]; + + //call function to draw circle + [self drawEllipse:context]; + + //call function to draw triangle + [self drawTriangle:context]; + + //call function to draw arc + [self drawArc:context]; + + //call function to draw text + [self drawTextAtTopOfScreen:context]; + + //draw gradient + [self drawGradient:context]; + + + +} + +-(void)drawRectangleAtTopOfScreen:(CGContextRef)context +{ + + CGContextSaveGState(context); + //Set color of current context + [[UIColor lightGrayColor] set]; + + //Draw rectangle + CGRect drawingRect = CGRectMake(0.0, 0.0f, 320.0f, 60.0f); + CGContextFillRect(context, drawingRect); + CGContextRestoreGState(context); + +} + +-(void)drawEllipse:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor whiteColor] set]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(60.0f, 150.0f, 200.0f, 200.0f); + CGContextFillEllipseInRect(context, ellipseRect); + CGContextRestoreGState(context); + +} + +-(void)drawTriangle:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f] set]; + + // Draw Triangle + CGContextBeginPath(context); + CGContextMoveToPoint(context, 140.0f, 380.0f); + CGContextAddLineToPoint(context, 190.0f, 400.0f); + CGContextAddLineToPoint(context, 140.0f, 420.0f); + CGContextClosePath(context); + CGContextSetGrayFillColor(context, 0.1f, 0.85f); + CGContextSetGrayStrokeColor(context, 0.0, 0.0); + CGContextFillPath(context); + CGContextRestoreGState(context); +} + +-(void)drawArc:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.30f + green:0.30f + blue:0.30f + alpha:1.0f] set]; + + //Draw Arc + CGContextAddArc(context, 160.0f, 250.0f, 70.0f, 0.0f, 3.14, 0); + CGContextSetLineWidth(context, 50.0f); + CGContextDrawPath(context, kCGPathStroke); + CGContextRestoreGState(context); +} + +-(void)drawTextAtTopOfScreen:(CGContextRef)context{ + + CGContextSaveGState(context); + + //Create UIColor to pass into text attributes + UIColor *textColor = [UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Set font + UIFont *customFont = [UIFont fontWithName:@"OleoScriptSwashCaps-Bold" size:40.0f ]; + //UIFont *customFont = [UIFont systemFontOfSize:20.0f]; + NSString *titleText = @"iOS Recipes!"; + + + [titleText drawAtPoint:CGPointMake(55,5) withAttributes:@{NSFontAttributeName:customFont, + NSForegroundColorAttributeName:textColor}]; + CGContextRestoreGState(context); + + +} +-(void)drawGradient:(CGContextRef)context{ + + //Define start and end colors + CGFloat colors [8] = { + 0.0, 0.0, 1.0, 1.0, // Blue + 0.0, 1.0, 0.0, 1.0 }; //Green + + //Setup a color space and gradient space + CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB(); + CGGradientRef gradient = CGGradientCreateWithColorComponents(baseSpace, colors, NULL, 2); + + //Define the gradient direction + CGPoint startPoint = CGPointMake(160.0f,100.0f); + CGPoint endPoint = CGPointMake(160.0f, 360.0f); + + //Create and Draw the gradient + CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0); +} + + + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf new file mode 100644 index 0000000..81faa2a Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf differ diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Info.plist b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Info.plist new file mode 100644 index 0000000..24cdc50 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Info.plist @@ -0,0 +1,46 @@ + + + + + UIAppFonts + + OleoScriptSwashCaps-Bold.ttf + + CFBundleGetInfoString + + LSApplicationCategoryType + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Prefix.pch b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/ViewController.h b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/ViewController.h new file mode 100644 index 0000000..094e665 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 12-5 Creating Gradients +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/ViewController.m b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/ViewController.m new file mode 100644 index 0000000..5c90a74 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 12-5 Creating Gradients +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/main.m b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/main.m new file mode 100644 index 0000000..8b72181 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple Shapes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m new file mode 100644 index 0000000..90fe98e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_12_1__Drawing_Simple_ShapesTests.m +// Recipe 12-1: Drawing Simple ShapesTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_12_1__Drawing_Simple_ShapesTests : XCTestCase + +@end + +@implementation Recipe_12_1__Drawing_Simple_ShapesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.pbxproj b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.pbxproj new file mode 100644 index 0000000..664e39e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.pbxproj @@ -0,0 +1,359 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */; }; + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AC17D039A90002F247 /* CoreGraphics.framework */; }; + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41B317D039A90002F247 /* InfoPlist.strings */; }; + 88CA41B717D039A90002F247 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41B617D039A90002F247 /* main.m */; }; + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41BA17D039A90002F247 /* AppDelegate.m */; }; + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41BC17D039A90002F247 /* Main.storyboard */; }; + 88CA41C117D039A90002F247 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41C017D039A90002F247 /* ViewController.m */; }; + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41C217D039A90002F247 /* Images.xcassets */; }; + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OleoScriptSwashCaps-Bold.ttf"; sourceTree = ""; }; + 88CA41A717D039A90002F247 /* Recipe 12-5 Creating Gradients.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 12-5 Creating Gradients.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41AA17D039A90002F247 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CA41AE17D039A90002F247 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CA41B217D039A90002F247 /* Recipe 12-5 Creating Gradients-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-5 Creating Gradients-Info.plist"; sourceTree = ""; }; + 88CA41B417D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41B617D039A90002F247 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CA41B817D039A90002F247 /* Recipe 12-5 Creating Gradients-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 12-5 Creating Gradients-Prefix.pch"; sourceTree = ""; }; + 88CA41B917D039A90002F247 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CA41BA17D039A90002F247 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CA41BD17D039A90002F247 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CA41BF17D039A90002F247 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CA41C017D039A90002F247 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CA41C217D039A90002F247 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CA41C917D039A90002F247 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist"; sourceTree = ""; }; + 88CA41D317D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_12_1__Drawing_Simple_ShapesTests.m; sourceTree = ""; }; + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsRecipesView.h; sourceTree = ""; }; + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphicsRecipesView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CA41A417D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */, + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CA419E17D039A90002F247 = { + isa = PBXGroup; + children = ( + 88CA41B017D039A90002F247 /* Recipe 12-5 Creating Gradients */, + 88CA41CF17D039A90002F247 /* Recipe 12-5 Creating Gradients Tests */, + 88CA41A917D039A90002F247 /* Frameworks */, + 88CA41A817D039A90002F247 /* Products */, + ); + sourceTree = ""; + }; + 88CA41A817D039A90002F247 /* Products */ = { + isa = PBXGroup; + children = ( + 88CA41A717D039A90002F247 /* Recipe 12-5 Creating Gradients.app */, + ); + name = Products; + sourceTree = ""; + }; + 88CA41A917D039A90002F247 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CA41AA17D039A90002F247 /* Foundation.framework */, + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */, + 88CA41AE17D039A90002F247 /* UIKit.framework */, + 88CA41C917D039A90002F247 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CA41B017D039A90002F247 /* Recipe 12-5 Creating Gradients */ = { + isa = PBXGroup; + children = ( + 88CA41B917D039A90002F247 /* AppDelegate.h */, + 88CA41BA17D039A90002F247 /* AppDelegate.m */, + 88CA41BC17D039A90002F247 /* Main.storyboard */, + 88CA41BF17D039A90002F247 /* ViewController.h */, + 88CA41C017D039A90002F247 /* ViewController.m */, + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */, + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */, + 88CA41C217D039A90002F247 /* Images.xcassets */, + 88CA41B117D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-5 Creating Gradients"; + path = "Recipe 12-1: Drawing Simple Shapes"; + sourceTree = ""; + }; + 88CA41B117D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */, + 88CA41B217D039A90002F247 /* Recipe 12-5 Creating Gradients-Info.plist */, + 88CA41B317D039A90002F247 /* InfoPlist.strings */, + 88CA41B617D039A90002F247 /* main.m */, + 88CA41B817D039A90002F247 /* Recipe 12-5 Creating Gradients-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CA41CF17D039A90002F247 /* Recipe 12-5 Creating Gradients Tests */ = { + isa = PBXGroup; + children = ( + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */, + 88CA41D017D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-5 Creating Gradients Tests"; + path = "Recipe 12-1: Drawing Simple ShapesTests"; + sourceTree = ""; + }; + 88CA41D017D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */, + 88CA41D217D039A90002F247 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CA41A617D039A90002F247 /* Recipe 12-5 Creating Gradients */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-5 Creating Gradients" */; + buildPhases = ( + 88CA41A317D039A90002F247 /* Sources */, + 88CA41A417D039A90002F247 /* Frameworks */, + 88CA41A517D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 12-5 Creating Gradients"; + productName = "Recipe 12-1: Drawing Simple Shapes"; + productReference = 88CA41A717D039A90002F247 /* Recipe 12-5 Creating Gradients.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CA419F17D039A90002F247 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + }; + buildConfigurationList = 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-5 Creating Gradients" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CA419E17D039A90002F247; + productRefGroup = 88CA41A817D039A90002F247 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CA41A617D039A90002F247 /* Recipe 12-5 Creating Gradients */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CA41A517D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */, + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */, + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */, + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CA41A317D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C117D039A90002F247 /* ViewController.m in Sources */, + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */, + 88CA41B717D039A90002F247 /* main.m in Sources */, + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 88CA41B317D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41B417D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CA41BC17D039A90002F247 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CA41BD17D039A90002F247 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CA41D217D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41D317D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CA41D717D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CA41D817D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CA41DA17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Info.plist"; + PRODUCT_NAME = "Recipe 12-5 Creating Gradients"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CA41DB17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-5 Creating Gradients-Info.plist"; + PRODUCT_NAME = "Recipe 12-5 Creating Gradients"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-5 Creating Gradients" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41D717D039A90002F247 /* Debug */, + 88CA41D817D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-5 Creating Gradients" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DA17D039A90002F247 /* Debug */, + 88CA41DB17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CA419F17D039A90002F247 /* Project object */; +} diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..36aaf35 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ec8f134 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme new file mode 100644 index 0000000..2e296eb --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-1_ Drawing Simple Shapes.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..50ff320 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-5 Creating Gradients/Recipe 12-5 Creating Gradients.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 12-1: Drawing Simple Shapes.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CA41A617D039A90002F247 + + primary + + + 88CA41C717D039A90002F247 + + primary + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/.DS_Store new file mode 100644 index 0000000..2b68e55 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h new file mode 100644 index 0000000..b69e48d --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 12-6 Clipping a Drawing to a Mask +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m new file mode 100644 index 0000000..fe98b52 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 12-6 Clipping a Drawing to a Mask +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..1e936ba --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h new file mode 100644 index 0000000..a67c1a1 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h @@ -0,0 +1,14 @@ +// +// GraphicsRecipesView.h +// Recipe 12-6 Clipping a Drawing to a Mask +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + + +@interface GraphicsRecipesView : UIView + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m new file mode 100644 index 0000000..7a82d24 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m @@ -0,0 +1,204 @@ +// +// GraphicsRecipesView.m +// Recipe 12-6 Clipping a Drawing to a Mask +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GraphicsRecipesView.h" + + +@implementation GraphicsRecipesView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + + CGContextRef context = UIGraphicsGetCurrentContext(); + + //Call function to draw rectangle + [self drawRectangleAtTopOfScreen:context]; + + //call function to draw circle + [self drawEllipse:context]; + + //call function to draw triangle + [self drawTriangle:context]; + + //call function to draw arc + [self drawArc:context]; + + //call function to draw text + [self drawTextAtTopOfScreen:context]; + + //call function to draw ellipse filled with a gradient + [self drawEllipseWithGradient:context]; + + + +} + +-(void)drawRectangleAtTopOfScreen:(CGContextRef)context +{ + + CGContextSaveGState(context); + //Set color of current context + [[UIColor lightGrayColor] set]; + + //Draw rectangle + CGRect drawingRect = CGRectMake(0.0, 0.0f, 320.0f, 60.0f); + CGContextFillRect(context, drawingRect); + CGContextRestoreGState(context); + +} + +-(void)drawEllipse:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor whiteColor] set]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(60.0f, 150.0f, 200.0f, 200.0f); + CGContextFillEllipseInRect(context, ellipseRect); + CGContextRestoreGState(context); + +} + +-(void)drawTriangle:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f] set]; + + // Draw Triangle + CGContextBeginPath(context); + CGContextMoveToPoint(context, 140.0f, 380.0f); + CGContextAddLineToPoint(context, 190.0f, 400.0f); + CGContextAddLineToPoint(context, 140.0f, 420.0f); + CGContextClosePath(context); + CGContextSetGrayFillColor(context, 0.1f, 0.85f); + CGContextSetGrayStrokeColor(context, 0.0, 0.0); + CGContextFillPath(context); + CGContextRestoreGState(context); +} + +-(void)drawArc:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.30f + green:0.30f + blue:0.30f + alpha:1.0f] set]; + + //Draw Arc + CGContextAddArc(context, 160.0f, 250.0f, 70.0f, 0.0f, 3.14, 0); + CGContextSetLineWidth(context, 50.0f); + CGContextDrawPath(context, kCGPathStroke); + CGContextRestoreGState(context); +} + +-(void)drawTextAtTopOfScreen:(CGContextRef)context{ + + CGContextSaveGState(context); + + //Create UIColor to pass into text attributes + UIColor *textColor = [UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Set font + UIFont *customFont = [UIFont fontWithName:@"OleoScriptSwashCaps-Bold" size:40.0f ]; + //UIFont *customFont = [UIFont systemFontOfSize:20.0f]; + NSString *titleText = @"iOS Recipes!"; + + + [titleText drawAtPoint:CGPointMake(55,5) withAttributes:@{NSFontAttributeName:customFont, + NSForegroundColorAttributeName:textColor}]; + CGContextRestoreGState(context); + + +} +-(void)drawGradient:(CGContextRef)context{ + + //Define start and end colors + CGFloat colors [8] = { + 0.0, 0.0, 1.0, 1.0, // Blue + 0.0, 1.0, 0.0, 1.0 }; //Green + + //Setup a color space and gradient space + CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB(); + CGGradientRef gradient = CGGradientCreateWithColorComponents(baseSpace, colors, NULL, 2); + + //Define the gradient direction + CGPoint startPoint = CGPointMake(160.0f,100.0f); + CGPoint endPoint = CGPointMake(160.0f, 360.0f); + + //Create and Draw the gradient + CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0); +} + +-(void)drawEllipseWithGradient:(CGContextRef)context{ + + CGContextSaveGState(context); + + //UIGraphicsBeginImageContextWith(self.frame.size); + UIGraphicsBeginImageContextWithOptions((self.frame.size), NO, 0.0); + + CGContextRef newContext = UIGraphicsGetCurrentContext(); + + // Translate and scale image to compnesate for Quartz's inverted coordinate system + CGContextTranslateCTM(newContext,0.0,self.frame.size.height); + CGContextScaleCTM(newContext, 1.0, -1.0); + + + //Set color of current context + [[UIColor blackColor] set]; + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(110.0f, 200.0f, 100.0f, 100.0f); + CGContextFillEllipseInRect(newContext, ellipseRect); + + CGImageRef mask = CGBitmapContextCreateImage(UIGraphicsGetCurrentContext()); + UIGraphicsEndImageContext(); + + + CGContextClipToMask(context, self.bounds, mask); + + [self drawGradient:context]; + + CGContextRestoreGState(context); + + +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf new file mode 100644 index 0000000..81faa2a Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf differ diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Info.plist b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Info.plist new file mode 100644 index 0000000..24cdc50 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Info.plist @@ -0,0 +1,46 @@ + + + + + UIAppFonts + + OleoScriptSwashCaps-Bold.ttf + + CFBundleGetInfoString + + LSApplicationCategoryType + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/ViewController.h b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/ViewController.h new file mode 100644 index 0000000..a9e9b62 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 12-6 Clipping a Drawing to a Mask +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/ViewController.m b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/ViewController.m new file mode 100644 index 0000000..cef466e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 12-6 Clipping a Drawing to a Mask +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/main.m b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/main.m new file mode 100644 index 0000000..8b72181 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple Shapes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m new file mode 100644 index 0000000..90fe98e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_12_1__Drawing_Simple_ShapesTests.m +// Recipe 12-1: Drawing Simple ShapesTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_12_1__Drawing_Simple_ShapesTests : XCTestCase + +@end + +@implementation Recipe_12_1__Drawing_Simple_ShapesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.pbxproj b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fd39af1 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.pbxproj @@ -0,0 +1,359 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */; }; + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AC17D039A90002F247 /* CoreGraphics.framework */; }; + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41B317D039A90002F247 /* InfoPlist.strings */; }; + 88CA41B717D039A90002F247 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41B617D039A90002F247 /* main.m */; }; + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41BA17D039A90002F247 /* AppDelegate.m */; }; + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41BC17D039A90002F247 /* Main.storyboard */; }; + 88CA41C117D039A90002F247 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41C017D039A90002F247 /* ViewController.m */; }; + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41C217D039A90002F247 /* Images.xcassets */; }; + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OleoScriptSwashCaps-Bold.ttf"; sourceTree = ""; }; + 88CA41A717D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 12-6 Clipping a Drawing to a Mask.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41AA17D039A90002F247 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CA41AE17D039A90002F247 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CA41B217D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-6 Clipping a Drawing to a Mask-Info.plist"; sourceTree = ""; }; + 88CA41B417D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41B617D039A90002F247 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CA41B817D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch"; sourceTree = ""; }; + 88CA41B917D039A90002F247 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CA41BA17D039A90002F247 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CA41BD17D039A90002F247 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CA41BF17D039A90002F247 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CA41C017D039A90002F247 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CA41C217D039A90002F247 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CA41C917D039A90002F247 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist"; sourceTree = ""; }; + 88CA41D317D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_12_1__Drawing_Simple_ShapesTests.m; sourceTree = ""; }; + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsRecipesView.h; sourceTree = ""; }; + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphicsRecipesView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CA41A417D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */, + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CA419E17D039A90002F247 = { + isa = PBXGroup; + children = ( + 88CA41B017D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask */, + 88CA41CF17D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask Tests */, + 88CA41A917D039A90002F247 /* Frameworks */, + 88CA41A817D039A90002F247 /* Products */, + ); + sourceTree = ""; + }; + 88CA41A817D039A90002F247 /* Products */ = { + isa = PBXGroup; + children = ( + 88CA41A717D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask.app */, + ); + name = Products; + sourceTree = ""; + }; + 88CA41A917D039A90002F247 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CA41AA17D039A90002F247 /* Foundation.framework */, + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */, + 88CA41AE17D039A90002F247 /* UIKit.framework */, + 88CA41C917D039A90002F247 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CA41B017D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask */ = { + isa = PBXGroup; + children = ( + 88CA41B917D039A90002F247 /* AppDelegate.h */, + 88CA41BA17D039A90002F247 /* AppDelegate.m */, + 88CA41BC17D039A90002F247 /* Main.storyboard */, + 88CA41BF17D039A90002F247 /* ViewController.h */, + 88CA41C017D039A90002F247 /* ViewController.m */, + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */, + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */, + 88CA41C217D039A90002F247 /* Images.xcassets */, + 88CA41B117D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-6 Clipping a Drawing to a Mask"; + path = "Recipe 12-1: Drawing Simple Shapes"; + sourceTree = ""; + }; + 88CA41B117D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */, + 88CA41B217D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask-Info.plist */, + 88CA41B317D039A90002F247 /* InfoPlist.strings */, + 88CA41B617D039A90002F247 /* main.m */, + 88CA41B817D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CA41CF17D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask Tests */ = { + isa = PBXGroup; + children = ( + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */, + 88CA41D017D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-6 Clipping a Drawing to a Mask Tests"; + path = "Recipe 12-1: Drawing Simple ShapesTests"; + sourceTree = ""; + }; + 88CA41D017D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */, + 88CA41D217D039A90002F247 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CA41A617D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-6 Clipping a Drawing to a Mask" */; + buildPhases = ( + 88CA41A317D039A90002F247 /* Sources */, + 88CA41A417D039A90002F247 /* Frameworks */, + 88CA41A517D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 12-6 Clipping a Drawing to a Mask"; + productName = "Recipe 12-1: Drawing Simple Shapes"; + productReference = 88CA41A717D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CA419F17D039A90002F247 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + }; + buildConfigurationList = 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-6 Clipping a Drawing to a Mask" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CA419E17D039A90002F247; + productRefGroup = 88CA41A817D039A90002F247 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CA41A617D039A90002F247 /* Recipe 12-6 Clipping a Drawing to a Mask */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CA41A517D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */, + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */, + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */, + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CA41A317D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C117D039A90002F247 /* ViewController.m in Sources */, + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */, + 88CA41B717D039A90002F247 /* main.m in Sources */, + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 88CA41B317D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41B417D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CA41BC17D039A90002F247 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CA41BD17D039A90002F247 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CA41D217D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41D317D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CA41D717D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CA41D817D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CA41DA17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Info.plist"; + PRODUCT_NAME = "Recipe 12-6 Clipping a Drawing to a Mask"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CA41DB17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-6 Clipping a Drawing to a Mask-Info.plist"; + PRODUCT_NAME = "Recipe 12-6 Clipping a Drawing to a Mask"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-6 Clipping a Drawing to a Mask" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41D717D039A90002F247 /* Debug */, + 88CA41D817D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-6 Clipping a Drawing to a Mask" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DA17D039A90002F247 /* Debug */, + 88CA41DB17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CA419F17D039A90002F247 /* Project object */; +} diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..2295f32 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..28de68e Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-6 Clipping a Drawing to a Mask.xcscheme b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-6 Clipping a Drawing to a Mask.xcscheme new file mode 100644 index 0000000..8cf483b --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-6 Clipping a Drawing to a Mask.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..3fc19d6 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-6 Clipping a Drawing to a Mask/Recipe 12-6 Clipping a Drawing to a Mask.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 12-6 Clipping a Drawing to a Mask.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CA41A617D039A90002F247 + + primary + + + 88CA41C717D039A90002F247 + + primary + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/.DS_Store new file mode 100644 index 0000000..1fe88c2 Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/.DS_Store b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/.DS_Store differ diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h new file mode 100644 index 0000000..502082a --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 12-7 Programming Screenshots +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m new file mode 100644 index 0000000..51505bc --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 12-7 Programming Screenshots +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bf777b1 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Base.lproj/Main.storyboard @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h new file mode 100644 index 0000000..0199716 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.h @@ -0,0 +1,16 @@ +// +// GraphicsRecipesView.h +// Recipe 12-7:Programming Screenshots +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + + +@interface GraphicsRecipesView : UIView + +@property (strong, nonatomic)UIImage *image; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m new file mode 100644 index 0000000..8bc705e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/GraphicsRecipesView.m @@ -0,0 +1,211 @@ +// +// GraphicsRecipesView.m +// Recipe 12-7:Programming Screenshots +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GraphicsRecipesView.h" + + +@implementation GraphicsRecipesView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + + CGContextRef context = UIGraphicsGetCurrentContext(); + + //Call function to draw rectangle + [self drawRectangleAtTopOfScreen:context]; + + //call function to draw circle + [self drawEllipse:context]; + + //call function to draw triangle + [self drawTriangle:context]; + + //call function to draw arc + [self drawArc:context]; + + //call function to draw text + [self drawTextAtTopOfScreen:context]; + + //call function to draw ellipse filled with a gradient + [self drawEllipseWithGradient:context]; + + if (self.image) + { + CGFloat imageWidth = self.frame.size.width / 2; + CGFloat imageHeight = self.frame.size.height / 2; + CGRect imageRect = CGRectMake(imageWidth, imageHeight, imageWidth, imageHeight); + [self.image drawInRect:imageRect]; + } + + +} + +-(void)drawRectangleAtTopOfScreen:(CGContextRef)context +{ + + CGContextSaveGState(context); + //Set color of current context + [[UIColor lightGrayColor] set]; + + //Draw rectangle + CGRect drawingRect = CGRectMake(0.0, 0.0f, 320.0f, 60.0f); + CGContextFillRect(context, drawingRect); + CGContextRestoreGState(context); + +} + +-(void)drawEllipse:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor whiteColor] set]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(60.0f, 150.0f, 200.0f, 200.0f); + CGContextFillEllipseInRect(context, ellipseRect); + CGContextRestoreGState(context); + +} + +-(void)drawTriangle:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f] set]; + + // Draw Triangle + CGContextBeginPath(context); + CGContextMoveToPoint(context, 140.0f, 380.0f); + CGContextAddLineToPoint(context, 190.0f, 400.0f); + CGContextAddLineToPoint(context, 140.0f, 420.0f); + CGContextClosePath(context); + CGContextSetGrayFillColor(context, 0.1f, 0.85f); + CGContextSetGrayStrokeColor(context, 0.0, 0.0); + CGContextFillPath(context); + CGContextRestoreGState(context); +} + +-(void)drawArc:(CGContextRef)context +{ + + CGContextSaveGState(context); + + //Set color of current context + [[UIColor colorWithRed:0.30f + green:0.30f + blue:0.30f + alpha:1.0f] set]; + + //Draw Arc + CGContextAddArc(context, 160.0f, 250.0f, 70.0f, 0.0f, 3.14, 0); + CGContextSetLineWidth(context, 50.0f); + CGContextDrawPath(context, kCGPathStroke); + CGContextRestoreGState(context); +} + +-(void)drawTextAtTopOfScreen:(CGContextRef)context{ + + CGContextSaveGState(context); + + //Create UIColor to pass into text attributes + UIColor *textColor = [UIColor colorWithRed:0.80f + green:0.85f + blue:0.95f + alpha:1.0f]; + + //Set shadow and color of shadow + CGContextSetShadowWithColor(context, CGSizeZero, 10.0f, [[UIColor blackColor] CGColor]); + + //Set font + UIFont *customFont = [UIFont fontWithName:@"OleoScriptSwashCaps-Bold" size:40.0f ]; + //UIFont *customFont = [UIFont systemFontOfSize:20.0f]; + NSString *titleText = @"iOS Recipes!"; + + + [titleText drawAtPoint:CGPointMake(55,5) withAttributes:@{NSFontAttributeName:customFont, + NSForegroundColorAttributeName:textColor}]; + CGContextRestoreGState(context); + + +} +-(void)drawGradient:(CGContextRef)context{ + + //Define start and end colors + CGFloat colors [8] = { + 0.0, 0.0, 1.0, 1.0, // Blue + 0.0, 1.0, 0.0, 1.0 }; //Green + + //Setup a color space and gradient space + CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB(); + CGGradientRef gradient = CGGradientCreateWithColorComponents(baseSpace, colors, NULL, 2); + + //Define the gradient direction + CGPoint startPoint = CGPointMake(160.0f,100.0f); + CGPoint endPoint = CGPointMake(160.0f, 360.0f); + + //Create and Draw the gradient + CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0); +} + +-(void)drawEllipseWithGradient:(CGContextRef)context{ + + CGContextSaveGState(context); + + //UIGraphicsBeginImageContextWith(self.frame.size); + UIGraphicsBeginImageContextWithOptions((self.frame.size), NO, 0.0); + + CGContextRef newContext = UIGraphicsGetCurrentContext(); + + // Translate and scale image to compnesate for Quartz's inverted coordinate system + CGContextTranslateCTM(newContext,0.0,self.frame.size.height); + CGContextScaleCTM(newContext, 1.0, -1.0); + + + //Set color of current context + [[UIColor blackColor] set]; + + //Draw ellipse <- I know we’re drawing a circle, but a circle is just a special ellipse. + CGRect ellipseRect = CGRectMake(110.0f, 200.0f, 100.0f, 100.0f); + CGContextFillEllipseInRect(newContext, ellipseRect); + + CGImageRef mask = CGBitmapContextCreateImage(UIGraphicsGetCurrentContext()); + UIGraphicsEndImageContext(); + + + CGContextClipToMask(context, self.bounds, mask); + + [self drawGradient:context]; + + CGContextRestoreGState(context); + + +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf new file mode 100644 index 0000000..81faa2a Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/OleoScriptSwashCaps-Bold.ttf differ diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Info.plist b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Info.plist new file mode 100644 index 0000000..24cdc50 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Info.plist @@ -0,0 +1,46 @@ + + + + + UIAppFonts + + OleoScriptSwashCaps-Bold.ttf + + CFBundleGetInfoString + + LSApplicationCategoryType + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Prefix.pch b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/ViewController.h b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/ViewController.h new file mode 100644 index 0000000..6419dda --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/ViewController.h @@ -0,0 +1,17 @@ +// +// ViewController.h +//// Recipe 12-7 Programming Screenshots +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import "GraphicsRecipesView.h" + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet GraphicsRecipesView *myView; + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/ViewController.m b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/ViewController.m new file mode 100644 index 0000000..0e4a604 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/ViewController.m @@ -0,0 +1,62 @@ +// +// ViewController.m +// Recipe 12-7:Programming Screenshots +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (BOOL) canBecomeFirstResponder +{ + return YES; +} + +- (void) viewWillAppear: (BOOL)animated +{ + [self.view becomeFirstResponder]; + [super viewWillAppear:animated]; +} + +- (void) viewWillDisappear: (BOOL)animated +{ + [self.view resignFirstResponder]; + [super viewWillDisappear:animated]; +} + +- (void) motionEnded: (UIEventSubtype)motion withEvent: (UIEvent *)event +{ + if (event.subtype == UIEventSubtypeMotionShake) + { + // Acquire image of current layer + UIGraphicsBeginImageContext(self.view.bounds.size); + CGContextRef context = UIGraphicsGetCurrentContext(); + [self.view.layer renderInContext:context]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + self.myView.image = image; + [self.myView setNeedsDisplay]; + + } +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/main.m b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/main.m new file mode 100644 index 0000000..8b72181 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple Shapes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 12-1: Drawing Simple Shapes +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m new file mode 100644 index 0000000..90fe98e --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/Recipe_12_1__Drawing_Simple_ShapesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_12_1__Drawing_Simple_ShapesTests.m +// Recipe 12-1: Drawing Simple ShapesTests +// +// Created by joseph hoffman on 8/29/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_12_1__Drawing_Simple_ShapesTests : XCTestCase + +@end + +@implementation Recipe_12_1__Drawing_Simple_ShapesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-1_ Drawing Simple ShapesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.pbxproj b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.pbxproj new file mode 100644 index 0000000..45fd44f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.pbxproj @@ -0,0 +1,359 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */; }; + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AA17D039A90002F247 /* Foundation.framework */; }; + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AC17D039A90002F247 /* CoreGraphics.framework */; }; + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CA41AE17D039A90002F247 /* UIKit.framework */; }; + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41B317D039A90002F247 /* InfoPlist.strings */; }; + 88CA41B717D039A90002F247 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41B617D039A90002F247 /* main.m */; }; + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41BA17D039A90002F247 /* AppDelegate.m */; }; + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41BC17D039A90002F247 /* Main.storyboard */; }; + 88CA41C117D039A90002F247 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41C017D039A90002F247 /* ViewController.m */; }; + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CA41C217D039A90002F247 /* Images.xcassets */; }; + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OleoScriptSwashCaps-Bold.ttf"; sourceTree = ""; }; + 88CA41A717D039A90002F247 /* Recipe 12-7 Programming Screenshots.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 12-7 Programming Screenshots.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CA41AA17D039A90002F247 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CA41AE17D039A90002F247 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CA41B217D039A90002F247 /* Recipe 12-7 Programming Screenshots-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-7 Programming Screenshots-Info.plist"; sourceTree = ""; }; + 88CA41B417D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41B617D039A90002F247 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CA41B817D039A90002F247 /* Recipe 12-7 Programming Screenshots-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 12-7 Programming Screenshots-Prefix.pch"; sourceTree = ""; }; + 88CA41B917D039A90002F247 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CA41BA17D039A90002F247 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CA41BD17D039A90002F247 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CA41BF17D039A90002F247 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CA41C017D039A90002F247 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CA41C217D039A90002F247 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CA41C917D039A90002F247 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist"; sourceTree = ""; }; + 88CA41D317D039A90002F247 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_12_1__Drawing_Simple_ShapesTests.m; sourceTree = ""; }; + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsRecipesView.h; sourceTree = ""; }; + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphicsRecipesView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CA41A417D039A90002F247 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41AD17D039A90002F247 /* CoreGraphics.framework in Frameworks */, + 88CA41AF17D039A90002F247 /* UIKit.framework in Frameworks */, + 88CA41AB17D039A90002F247 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CA419E17D039A90002F247 = { + isa = PBXGroup; + children = ( + 88CA41B017D039A90002F247 /* Recipe 12-7 Progrmming Screenshots */, + 88CA41CF17D039A90002F247 /* Recipe 12-7 Programming Screenshots Tests */, + 88CA41A917D039A90002F247 /* Frameworks */, + 88CA41A817D039A90002F247 /* Products */, + ); + sourceTree = ""; + }; + 88CA41A817D039A90002F247 /* Products */ = { + isa = PBXGroup; + children = ( + 88CA41A717D039A90002F247 /* Recipe 12-7 Programming Screenshots.app */, + ); + name = Products; + sourceTree = ""; + }; + 88CA41A917D039A90002F247 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CA41AA17D039A90002F247 /* Foundation.framework */, + 88CA41AC17D039A90002F247 /* CoreGraphics.framework */, + 88CA41AE17D039A90002F247 /* UIKit.framework */, + 88CA41C917D039A90002F247 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CA41B017D039A90002F247 /* Recipe 12-7 Progrmming Screenshots */ = { + isa = PBXGroup; + children = ( + 88CA41B917D039A90002F247 /* AppDelegate.h */, + 88CA41BA17D039A90002F247 /* AppDelegate.m */, + 88CA41BC17D039A90002F247 /* Main.storyboard */, + 88CA41BF17D039A90002F247 /* ViewController.h */, + 88CA41C017D039A90002F247 /* ViewController.m */, + 88CA41DF17D039D80002F247 /* GraphicsRecipesView.h */, + 88CA41E017D039D80002F247 /* GraphicsRecipesView.m */, + 88CA41C217D039A90002F247 /* Images.xcassets */, + 88CA41B117D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-7 Progrmming Screenshots"; + path = "Recipe 12-1: Drawing Simple Shapes"; + sourceTree = ""; + }; + 88CA41B117D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8857E86B17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf */, + 88CA41B217D039A90002F247 /* Recipe 12-7 Programming Screenshots-Info.plist */, + 88CA41B317D039A90002F247 /* InfoPlist.strings */, + 88CA41B617D039A90002F247 /* main.m */, + 88CA41B817D039A90002F247 /* Recipe 12-7 Programming Screenshots-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CA41CF17D039A90002F247 /* Recipe 12-7 Programming Screenshots Tests */ = { + isa = PBXGroup; + children = ( + 88CA41D517D039A90002F247 /* Recipe_12_1__Drawing_Simple_ShapesTests.m */, + 88CA41D017D039A90002F247 /* Supporting Files */, + ); + name = "Recipe 12-7 Programming Screenshots Tests"; + path = "Recipe 12-1: Drawing Simple ShapesTests"; + sourceTree = ""; + }; + 88CA41D017D039A90002F247 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CA41D117D039A90002F247 /* Recipe 12-3 Adding Fonts and Drawing TextTests-Info.plist */, + 88CA41D217D039A90002F247 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CA41A617D039A90002F247 /* Recipe 12-7 Programming Screenshots */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-7 Programming Screenshots" */; + buildPhases = ( + 88CA41A317D039A90002F247 /* Sources */, + 88CA41A417D039A90002F247 /* Frameworks */, + 88CA41A517D039A90002F247 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 12-7 Programming Screenshots"; + productName = "Recipe 12-1: Drawing Simple Shapes"; + productReference = 88CA41A717D039A90002F247 /* Recipe 12-7 Programming Screenshots.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CA419F17D039A90002F247 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + }; + buildConfigurationList = 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-7 Programming Screenshots" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CA419E17D039A90002F247; + productRefGroup = 88CA41A817D039A90002F247 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CA41A617D039A90002F247 /* Recipe 12-7 Programming Screenshots */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CA41A517D039A90002F247 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C317D039A90002F247 /* Images.xcassets in Resources */, + 88CA41B517D039A90002F247 /* InfoPlist.strings in Resources */, + 88CA41BE17D039A90002F247 /* Main.storyboard in Resources */, + 8857E86C17D069D600B5668C /* OleoScriptSwashCaps-Bold.ttf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CA41A317D039A90002F247 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CA41C117D039A90002F247 /* ViewController.m in Sources */, + 88CA41BB17D039A90002F247 /* AppDelegate.m in Sources */, + 88CA41B717D039A90002F247 /* main.m in Sources */, + 88CA41E417D0611A0002F247 /* GraphicsRecipesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 88CA41B317D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41B417D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CA41BC17D039A90002F247 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CA41BD17D039A90002F247 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CA41D217D039A90002F247 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CA41D317D039A90002F247 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CA41D717D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CA41D817D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CA41DA17D039A90002F247 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Info.plist"; + PRODUCT_NAME = "Recipe 12-7 Programming Screenshots"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CA41DB17D039A90002F247 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Prefix.pch"; + INFOPLIST_FILE = "Recipe 12-1: Drawing Simple Shapes/Recipe 12-7 Programming Screenshots-Info.plist"; + PRODUCT_NAME = "Recipe 12-7 Programming Screenshots"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CA41A217D039A90002F247 /* Build configuration list for PBXProject "Recipe 12-7 Programming Screenshots" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41D717D039A90002F247 /* Debug */, + 88CA41D817D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CA41D917D039A90002F247 /* Build configuration list for PBXNativeTarget "Recipe 12-7 Programming Screenshots" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CA41DA17D039A90002F247 /* Debug */, + 88CA41DB17D039A90002F247 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CA419F17D039A90002F247 /* Project object */; +} diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3071f8a --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..afb2cce Binary files /dev/null and b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..dd531ac --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-7 Programming Screenshots.xcscheme b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-7 Programming Screenshots.xcscheme new file mode 100644 index 0000000..2bd279f --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 12-7 Programming Screenshots.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..de8e22b --- /dev/null +++ b/CH12 - Graphics Recipes/Recipe 12-7 Programming Screenshots/Recipe 12-7 Programming Screenshots.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 12-7 Programming Screenshots.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CA41A617D039A90002F247 + + primary + + + 88CA41C717D039A90002F247 + + primary + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/.DS_Store b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/.DS_Store new file mode 100644 index 0000000..5cdaede Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/.DS_Store differ diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Ball.png b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Ball.png new file mode 100644 index 0000000..32ac3a6 Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Ball.png differ diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.pbxproj b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..637ea29 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.pbxproj @@ -0,0 +1,483 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 881290E917E648EB0057E325 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881290E817E648EB0057E325 /* Foundation.framework */; }; + 881290EB17E648EB0057E325 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881290EA17E648EB0057E325 /* CoreGraphics.framework */; }; + 881290ED17E648EB0057E325 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881290EC17E648EB0057E325 /* UIKit.framework */; }; + 881290F317E648EB0057E325 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881290F117E648EB0057E325 /* InfoPlist.strings */; }; + 881290F517E648EB0057E325 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 881290F417E648EB0057E325 /* main.m */; }; + 881290F917E648EB0057E325 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 881290F817E648EB0057E325 /* AppDelegate.m */; }; + 881290FC17E648EB0057E325 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881290FA17E648EB0057E325 /* Main.storyboard */; }; + 881290FF17E648EB0057E325 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881290FE17E648EB0057E325 /* ViewController.m */; }; + 8812910117E648EB0057E325 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8812910017E648EB0057E325 /* Images.xcassets */; }; + 8812910817E648EB0057E325 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8812910717E648EB0057E325 /* XCTest.framework */; }; + 8812910917E648EC0057E325 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881290E817E648EB0057E325 /* Foundation.framework */; }; + 8812910A17E648EC0057E325 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881290EC17E648EB0057E325 /* UIKit.framework */; }; + 8812911217E648EC0057E325 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8812911017E648EC0057E325 /* InfoPlist.strings */; }; + 8812911417E648EC0057E325 /* Recipe_13_1_View_Animation_Using_UIKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8812911317E648EC0057E325 /* Recipe_13_1_View_Animation_Using_UIKitTests.m */; }; + 8812911E17E64CC50057E325 /* Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 8812911D17E64CC50057E325 /* Ball.png */; }; + 8812912017E64E140057E325 /* Star.png in Resources */ = {isa = PBXBuildFile; fileRef = 8812911F17E64E140057E325 /* Star.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8812910B17E648EC0057E325 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 881290DD17E648EB0057E325 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 881290E417E648EB0057E325; + remoteInfo = "Recipe 13-1 View Animation Using UIKit"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 881290E517E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 13-1 View Animation Using UIKit.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881290E817E648EB0057E325 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 881290EA17E648EB0057E325 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 881290EC17E648EB0057E325 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 881290F017E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 13-1 View Animation Using UIKit-Info.plist"; sourceTree = ""; }; + 881290F217E648EB0057E325 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881290F417E648EB0057E325 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 881290F617E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 13-1 View Animation Using UIKit-Prefix.pch"; sourceTree = ""; }; + 881290F717E648EB0057E325 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 881290F817E648EB0057E325 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 881290FB17E648EB0057E325 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 881290FD17E648EB0057E325 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 881290FE17E648EB0057E325 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8812910017E648EB0057E325 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8812910617E648EB0057E325 /* Recipe 13-1 View Animation Using UIKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 13-1 View Animation Using UIKitTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8812910717E648EB0057E325 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8812910F17E648EC0057E325 /* Recipe 13-1 View Animation Using UIKitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 13-1 View Animation Using UIKitTests-Info.plist"; sourceTree = ""; }; + 8812911117E648EC0057E325 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8812911317E648EC0057E325 /* Recipe_13_1_View_Animation_Using_UIKitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_13_1_View_Animation_Using_UIKitTests.m; sourceTree = ""; }; + 8812911D17E64CC50057E325 /* Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ball.png; sourceTree = ""; }; + 8812911F17E64E140057E325 /* Star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Star.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 881290E217E648EB0057E325 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881290EB17E648EB0057E325 /* CoreGraphics.framework in Frameworks */, + 881290ED17E648EB0057E325 /* UIKit.framework in Frameworks */, + 881290E917E648EB0057E325 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8812910317E648EB0057E325 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812910817E648EB0057E325 /* XCTest.framework in Frameworks */, + 8812910A17E648EC0057E325 /* UIKit.framework in Frameworks */, + 8812910917E648EC0057E325 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 881290DC17E648EB0057E325 = { + isa = PBXGroup; + children = ( + 8812911F17E64E140057E325 /* Star.png */, + 8812911D17E64CC50057E325 /* Ball.png */, + 881290EE17E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit */, + 8812910D17E648EC0057E325 /* Recipe 13-1 View Animation Using UIKitTests */, + 881290E717E648EB0057E325 /* Frameworks */, + 881290E617E648EB0057E325 /* Products */, + ); + sourceTree = ""; + }; + 881290E617E648EB0057E325 /* Products */ = { + isa = PBXGroup; + children = ( + 881290E517E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit.app */, + 8812910617E648EB0057E325 /* Recipe 13-1 View Animation Using UIKitTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 881290E717E648EB0057E325 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 881290E817E648EB0057E325 /* Foundation.framework */, + 881290EA17E648EB0057E325 /* CoreGraphics.framework */, + 881290EC17E648EB0057E325 /* UIKit.framework */, + 8812910717E648EB0057E325 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 881290EE17E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit */ = { + isa = PBXGroup; + children = ( + 881290F717E648EB0057E325 /* AppDelegate.h */, + 881290F817E648EB0057E325 /* AppDelegate.m */, + 881290FA17E648EB0057E325 /* Main.storyboard */, + 881290FD17E648EB0057E325 /* ViewController.h */, + 881290FE17E648EB0057E325 /* ViewController.m */, + 8812910017E648EB0057E325 /* Images.xcassets */, + 881290EF17E648EB0057E325 /* Supporting Files */, + ); + path = "Recipe 13-1 View Animation Using UIKit"; + sourceTree = ""; + }; + 881290EF17E648EB0057E325 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881290F017E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit-Info.plist */, + 881290F117E648EB0057E325 /* InfoPlist.strings */, + 881290F417E648EB0057E325 /* main.m */, + 881290F617E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8812910D17E648EC0057E325 /* Recipe 13-1 View Animation Using UIKitTests */ = { + isa = PBXGroup; + children = ( + 8812911317E648EC0057E325 /* Recipe_13_1_View_Animation_Using_UIKitTests.m */, + 8812910E17E648EC0057E325 /* Supporting Files */, + ); + path = "Recipe 13-1 View Animation Using UIKitTests"; + sourceTree = ""; + }; + 8812910E17E648EC0057E325 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8812910F17E648EC0057E325 /* Recipe 13-1 View Animation Using UIKitTests-Info.plist */, + 8812911017E648EC0057E325 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 881290E417E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8812911717E648EC0057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-1 View Animation Using UIKit" */; + buildPhases = ( + 881290E117E648EB0057E325 /* Sources */, + 881290E217E648EB0057E325 /* Frameworks */, + 881290E317E648EB0057E325 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 13-1 View Animation Using UIKit"; + productName = "Recipe 13-1 View Animation Using UIKit"; + productReference = 881290E517E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit.app */; + productType = "com.apple.product-type.application"; + }; + 8812910517E648EB0057E325 /* Recipe 13-1 View Animation Using UIKitTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8812911A17E648EC0057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-1 View Animation Using UIKitTests" */; + buildPhases = ( + 8812910217E648EB0057E325 /* Sources */, + 8812910317E648EB0057E325 /* Frameworks */, + 8812910417E648EB0057E325 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8812910C17E648EC0057E325 /* PBXTargetDependency */, + ); + name = "Recipe 13-1 View Animation Using UIKitTests"; + productName = "Recipe 13-1 View Animation Using UIKitTests"; + productReference = 8812910617E648EB0057E325 /* Recipe 13-1 View Animation Using UIKitTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 881290DD17E648EB0057E325 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8812910517E648EB0057E325 = { + TestTargetID = 881290E417E648EB0057E325; + }; + }; + }; + buildConfigurationList = 881290E017E648EB0057E325 /* Build configuration list for PBXProject "Recipe 13-1 View Animation Using UIKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 881290DC17E648EB0057E325; + productRefGroup = 881290E617E648EB0057E325 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 881290E417E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit */, + 8812910517E648EB0057E325 /* Recipe 13-1 View Animation Using UIKitTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 881290E317E648EB0057E325 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812910117E648EB0057E325 /* Images.xcassets in Resources */, + 881290F317E648EB0057E325 /* InfoPlist.strings in Resources */, + 8812912017E64E140057E325 /* Star.png in Resources */, + 8812911E17E64CC50057E325 /* Ball.png in Resources */, + 881290FC17E648EB0057E325 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8812910417E648EB0057E325 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812911217E648EC0057E325 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 881290E117E648EB0057E325 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881290FF17E648EB0057E325 /* ViewController.m in Sources */, + 881290F917E648EB0057E325 /* AppDelegate.m in Sources */, + 881290F517E648EB0057E325 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8812910217E648EB0057E325 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812911417E648EC0057E325 /* Recipe_13_1_View_Animation_Using_UIKitTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8812910C17E648EC0057E325 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 881290E417E648EB0057E325 /* Recipe 13-1 View Animation Using UIKit */; + targetProxy = 8812910B17E648EC0057E325 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 881290F117E648EB0057E325 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881290F217E648EB0057E325 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 881290FA17E648EB0057E325 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 881290FB17E648EB0057E325 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8812911017E648EC0057E325 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8812911117E648EC0057E325 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8812911517E648EC0057E325 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8812911617E648EC0057E325 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8812911817E648EC0057E325 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Prefix.pch"; + INFOPLIST_FILE = "Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8812911917E648EC0057E325 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Prefix.pch"; + INFOPLIST_FILE = "Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8812911B17E648EC0057E325 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 13-1 View Animation Using UIKit.app/Recipe 13-1 View Animation Using UIKit"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 13-1 View Animation Using UIKitTests/Recipe 13-1 View Animation Using UIKitTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8812911C17E648EC0057E325 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 13-1 View Animation Using UIKit.app/Recipe 13-1 View Animation Using UIKit"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Prefix.pch"; + INFOPLIST_FILE = "Recipe 13-1 View Animation Using UIKitTests/Recipe 13-1 View Animation Using UIKitTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 881290E017E648EB0057E325 /* Build configuration list for PBXProject "Recipe 13-1 View Animation Using UIKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8812911517E648EC0057E325 /* Debug */, + 8812911617E648EC0057E325 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8812911717E648EC0057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-1 View Animation Using UIKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8812911817E648EC0057E325 /* Debug */, + 8812911917E648EC0057E325 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8812911A17E648EC0057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-1 View Animation Using UIKitTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8812911B17E648EC0057E325 /* Debug */, + 8812911C17E648EC0057E325 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 881290DD17E648EB0057E325 /* Project object */; +} diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f359306 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2016e3e Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..e396e58 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 13-1 View Animation Using UIKit.xcscheme b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 13-1 View Animation Using UIKit.xcscheme new file mode 100644 index 0000000..5186ec9 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 13-1 View Animation Using UIKit.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..0b46a8a --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 13-1 View Animation Using UIKit.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 881290E417E648EB0057E325 + + primary + + + 8812910517E648EB0057E325 + + primary + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/AppDelegate.h b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/AppDelegate.h new file mode 100644 index 0000000..fea9ae5 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 13-1 View Animation Using UIKit +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/AppDelegate.m b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/AppDelegate.m new file mode 100644 index 0000000..bf2352e --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 13-1 View Animation Using UIKit +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Base.lproj/Main.storyboard b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8fddd03 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Base.lproj/Main.storyboard @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Images.xcassets/AppIcon.appiconset/Contents.json b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Info.plist b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Info.plist new file mode 100644 index 0000000..426b098 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Prefix.pch b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/ViewController.h b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/ViewController.h new file mode 100644 index 0000000..c1c9622 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// Recipe 13-1 View Animation Using UIKit +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) UIImageView *blueBall; + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/ViewController.m b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/ViewController.m new file mode 100644 index 0000000..760e0e9 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/ViewController.m @@ -0,0 +1,72 @@ +// +// ViewController.m +// Recipe 13-1 View Animation Using UIKit +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + + //Create ball image and add it to the view + UIImage *blueBallImage = [[UIImage alloc] init]; + blueBallImage = [UIImage imageNamed:@"Ball"]; + self.blueBall = [[UIImageView alloc] initWithImage:blueBallImage]; + self.blueBall.frame = CGRectMake(self.view.frame.size.width/2-5, + 20.0f, + 10.0f, + 10.0f); + self.blueBall.alpha = 0.0f; + + [self.view addSubview:self.blueBall]; + + + [UIView animateWithDuration:3.0f + animations:^{ + self.blueBall.frame = CGRectMake(self.view.frame.size.width/2-32.0f, + self.view.frame.size.height/2 -32.0f, + 64.0f, + 64.0f); + self.blueBall.alpha = 1.0f; + + + } + completion:^(BOOL finished) { + NSLog(@"Animation Finished"); + [self startRotationOfBall]; + }]; + + +} + +-(void)startRotationOfBall +{ + + [UIView animateWithDuration:1.5f + animations:^{ + self.blueBall.transform = CGAffineTransformMakeRotation(M_PI); + } + completion:^(BOOL finished) { + NSLog(@"Rotation Finished"); + }]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/en.lproj/InfoPlist.strings b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/main.m b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/main.m new file mode 100644 index 0000000..d2d7f9a --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKit/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 13-1 View Animation Using UIKit +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/Recipe 13-1 View Animation Using UIKitTests-Info.plist b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/Recipe 13-1 View Animation Using UIKitTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/Recipe 13-1 View Animation Using UIKitTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/Recipe_13_1_View_Animation_Using_UIKitTests.m b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/Recipe_13_1_View_Animation_Using_UIKitTests.m new file mode 100644 index 0000000..b628968 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/Recipe_13_1_View_Animation_Using_UIKitTests.m @@ -0,0 +1,34 @@ +// +// Recipe_13_1_View_Animation_Using_UIKitTests.m +// Recipe 13-1 View Animation Using UIKitTests +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_13_1_View_Animation_Using_UIKitTests : XCTestCase + +@end + +@implementation Recipe_13_1_View_Animation_Using_UIKitTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/en.lproj/InfoPlist.strings b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Recipe 13-1 View Animation Using UIKitTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Star.png b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Star.png new file mode 100644 index 0000000..e759f99 Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-1 View Animation Using UIKit/Star.png differ diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/.DS_Store b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/.DS_Store new file mode 100644 index 0000000..071b3ad Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/.DS_Store differ diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/BouncingSpringBehavior.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/BouncingSpringBehavior.h new file mode 100644 index 0000000..d7383b3 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/BouncingSpringBehavior.h @@ -0,0 +1,16 @@ +// +// BouncingSpringBehavior.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/19/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface BouncingSpringBehavior : UIDynamicBehavior + +-(instancetype)initWithItems:(NSArray *)items withAnchorPoint:(NSString *)anchorPointString; + + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/BouncingSpringBehavior.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/BouncingSpringBehavior.m new file mode 100644 index 0000000..c9e66fd --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/BouncingSpringBehavior.m @@ -0,0 +1,47 @@ +// +// BouncingSpringBehavior.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/19/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "BouncingSpringBehavior.h" + +@implementation BouncingSpringBehavior + +-(instancetype)initWithItems:(NSArray *)items withAnchorPoint:(NSString *)anchorPointString +{ + if(self=[super init]) + { + + + CGPoint anchorPoint = CGPointFromString(anchorPointString); + + UIGravityBehavior *gravityBehavior = [[UIGravityBehavior alloc] initWithItems:items]; + UICollisionBehavior *collisionBehavior = [[UICollisionBehavior alloc] initWithItems:items]; + + UIAttachmentBehavior *item1AttachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:[items objectAtIndex:0] attachedToAnchor:anchorPoint]; + + UIAttachmentBehavior *item2AttachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:[items objectAtIndex:1] offsetFromCenter:UIOffsetMake(-20.0, 0) attachedToItem:[items objectAtIndex:0] offsetFromCenter:UIOffsetZero]; + + collisionBehavior.translatesReferenceBoundsIntoBoundary = YES; + + [item1AttachmentBehavior setFrequency:1.0]; + [item2AttachmentBehavior setDamping:0.65]; + + [item1AttachmentBehavior setFrequency:1.0]; + [item2AttachmentBehavior setDamping:0.65]; + + [self addChildBehavior:gravityBehavior]; + [self addChildBehavior:collisionBehavior]; + [self addChildBehavior:item1AttachmentBehavior]; + [self addChildBehavior:item2AttachmentBehavior]; + + + } + + return self; +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.pbxproj b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d37fadb --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.pbxproj @@ -0,0 +1,527 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8812927C17E6A7F70057E325 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8812927B17E6A7F70057E325 /* Foundation.framework */; }; + 8812927E17E6A7F70057E325 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8812927D17E6A7F70057E325 /* CoreGraphics.framework */; }; + 8812928017E6A7F70057E325 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8812927F17E6A7F70057E325 /* UIKit.framework */; }; + 8812928617E6A7F70057E325 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8812928417E6A7F70057E325 /* InfoPlist.strings */; }; + 8812928817E6A7F70057E325 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8812928717E6A7F70057E325 /* main.m */; }; + 8812928C17E6A7F70057E325 /* GravityAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8812928B17E6A7F70057E325 /* GravityAppDelegate.m */; }; + 8812928F17E6A7F70057E325 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8812928D17E6A7F70057E325 /* Main.storyboard */; }; + 8812929217E6A7F70057E325 /* GravityViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8812929117E6A7F70057E325 /* GravityViewController.m */; }; + 8812929417E6A7F70057E325 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8812929317E6A7F70057E325 /* Images.xcassets */; }; + 8812929B17E6A7F80057E325 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8812929A17E6A7F80057E325 /* XCTest.framework */; }; + 8812929C17E6A7F80057E325 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8812927B17E6A7F70057E325 /* Foundation.framework */; }; + 8812929D17E6A7F80057E325 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8812927F17E6A7F70057E325 /* UIKit.framework */; }; + 881292A517E6A7F80057E325 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881292A317E6A7F80057E325 /* InfoPlist.strings */; }; + 881292A717E6A7F80057E325 /* Recipe_13_2_Implementing_UIKit_DynamicsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 881292A617E6A7F80057E325 /* Recipe_13_2_Implementing_UIKit_DynamicsTests.m */; }; + 881292B117E7D9DE0057E325 /* Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 881292B017E7D9DE0057E325 /* Ball.png */; }; + 881292B417E7F7950057E325 /* GravityWithCollsionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881292B317E7F7950057E325 /* GravityWithCollsionViewController.m */; }; + 881292B717E93C040057E325 /* ItemPropertyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881292B617E93C040057E325 /* ItemPropertyViewController.m */; }; + 881292BA17E947560057E325 /* SnapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881292B917E947560057E325 /* SnapViewController.m */; }; + 881292BD17E95A2B0057E325 /* PushViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881292BC17E95A2B0057E325 /* PushViewController.m */; }; + 88C9422717EAC72900B412F9 /* Star.png in Resources */ = {isa = PBXBuildFile; fileRef = 88C9422617EAC72800B412F9 /* Star.png */; }; + 88C9422A17EAC8C100B412F9 /* SpringAttachmentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C9422917EAC8C100B412F9 /* SpringAttachmentViewController.m */; }; + 88C9422D17EB730900B412F9 /* BouncingSpringBehavior.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C9422C17EB730900B412F9 /* BouncingSpringBehavior.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8812929E17E6A7F80057E325 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8812927017E6A7F70057E325 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8812927717E6A7F70057E325; + remoteInfo = "Recipe 13-2 Implementing UIKit Dynamics"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8812927817E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 13-2 Implementing UIKit Dynamics.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8812927B17E6A7F70057E325 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8812927D17E6A7F70057E325 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8812927F17E6A7F70057E325 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8812928317E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 13-2 Implementing UIKit Dynamics-Info.plist"; sourceTree = ""; }; + 8812928517E6A7F70057E325 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8812928717E6A7F70057E325 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8812928917E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch"; sourceTree = ""; }; + 8812928A17E6A7F70057E325 /* GravityAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GravityAppDelegate.h; sourceTree = ""; }; + 8812928B17E6A7F70057E325 /* GravityAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GravityAppDelegate.m; sourceTree = ""; }; + 8812928E17E6A7F70057E325 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8812929017E6A7F70057E325 /* GravityViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GravityViewController.h; sourceTree = ""; }; + 8812929117E6A7F70057E325 /* GravityViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GravityViewController.m; sourceTree = ""; }; + 8812929317E6A7F70057E325 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8812929917E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 13-2 Implementing UIKit DynamicsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8812929A17E6A7F80057E325 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 881292A217E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist"; sourceTree = ""; }; + 881292A417E6A7F80057E325 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881292A617E6A7F80057E325 /* Recipe_13_2_Implementing_UIKit_DynamicsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_13_2_Implementing_UIKit_DynamicsTests.m; sourceTree = ""; }; + 881292B017E7D9DE0057E325 /* Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ball.png; sourceTree = ""; }; + 881292B217E7F7950057E325 /* GravityWithCollsionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GravityWithCollsionViewController.h; sourceTree = ""; }; + 881292B317E7F7950057E325 /* GravityWithCollsionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GravityWithCollsionViewController.m; sourceTree = ""; }; + 881292B517E93C040057E325 /* ItemPropertyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemPropertyViewController.h; sourceTree = ""; }; + 881292B617E93C040057E325 /* ItemPropertyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemPropertyViewController.m; sourceTree = ""; }; + 881292B817E947560057E325 /* SnapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SnapViewController.h; sourceTree = ""; }; + 881292B917E947560057E325 /* SnapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SnapViewController.m; sourceTree = ""; }; + 881292BB17E95A2B0057E325 /* PushViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PushViewController.h; sourceTree = ""; }; + 881292BC17E95A2B0057E325 /* PushViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PushViewController.m; sourceTree = ""; }; + 88C9422617EAC72800B412F9 /* Star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Star.png; sourceTree = ""; }; + 88C9422817EAC8C100B412F9 /* SpringAttachmentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpringAttachmentViewController.h; sourceTree = ""; }; + 88C9422917EAC8C100B412F9 /* SpringAttachmentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpringAttachmentViewController.m; sourceTree = ""; }; + 88C9422B17EB730900B412F9 /* BouncingSpringBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BouncingSpringBehavior.h; sourceTree = ""; }; + 88C9422C17EB730900B412F9 /* BouncingSpringBehavior.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BouncingSpringBehavior.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8812927517E6A7F70057E325 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812927E17E6A7F70057E325 /* CoreGraphics.framework in Frameworks */, + 8812928017E6A7F70057E325 /* UIKit.framework in Frameworks */, + 8812927C17E6A7F70057E325 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8812929617E6A7F80057E325 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812929B17E6A7F80057E325 /* XCTest.framework in Frameworks */, + 8812929D17E6A7F80057E325 /* UIKit.framework in Frameworks */, + 8812929C17E6A7F80057E325 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8812926F17E6A7F70057E325 = { + isa = PBXGroup; + children = ( + 88C9422B17EB730900B412F9 /* BouncingSpringBehavior.h */, + 88C9422C17EB730900B412F9 /* BouncingSpringBehavior.m */, + 8812928117E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics */, + 881292A017E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests */, + 8812927A17E6A7F70057E325 /* Frameworks */, + 8812927917E6A7F70057E325 /* Products */, + ); + sourceTree = ""; + }; + 8812927917E6A7F70057E325 /* Products */ = { + isa = PBXGroup; + children = ( + 8812927817E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics.app */, + 8812929917E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8812927A17E6A7F70057E325 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8812927B17E6A7F70057E325 /* Foundation.framework */, + 8812927D17E6A7F70057E325 /* CoreGraphics.framework */, + 8812927F17E6A7F70057E325 /* UIKit.framework */, + 8812929A17E6A7F80057E325 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8812928117E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics */ = { + isa = PBXGroup; + children = ( + 8812928A17E6A7F70057E325 /* GravityAppDelegate.h */, + 8812928B17E6A7F70057E325 /* GravityAppDelegate.m */, + 8812928D17E6A7F70057E325 /* Main.storyboard */, + 88C9422817EAC8C100B412F9 /* SpringAttachmentViewController.h */, + 88C9422917EAC8C100B412F9 /* SpringAttachmentViewController.m */, + 881292BB17E95A2B0057E325 /* PushViewController.h */, + 881292BC17E95A2B0057E325 /* PushViewController.m */, + 881292B817E947560057E325 /* SnapViewController.h */, + 881292B917E947560057E325 /* SnapViewController.m */, + 881292B517E93C040057E325 /* ItemPropertyViewController.h */, + 881292B617E93C040057E325 /* ItemPropertyViewController.m */, + 881292B217E7F7950057E325 /* GravityWithCollsionViewController.h */, + 881292B317E7F7950057E325 /* GravityWithCollsionViewController.m */, + 8812929017E6A7F70057E325 /* GravityViewController.h */, + 8812929117E6A7F70057E325 /* GravityViewController.m */, + 8812929317E6A7F70057E325 /* Images.xcassets */, + 8812928217E6A7F70057E325 /* Supporting Files */, + ); + path = "Recipe 13-2 Implementing UIKit Dynamics"; + sourceTree = ""; + }; + 8812928217E6A7F70057E325 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88C9422617EAC72800B412F9 /* Star.png */, + 881292B017E7D9DE0057E325 /* Ball.png */, + 8812928317E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics-Info.plist */, + 8812928417E6A7F70057E325 /* InfoPlist.strings */, + 8812928717E6A7F70057E325 /* main.m */, + 8812928917E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 881292A017E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests */ = { + isa = PBXGroup; + children = ( + 881292A617E6A7F80057E325 /* Recipe_13_2_Implementing_UIKit_DynamicsTests.m */, + 881292A117E6A7F80057E325 /* Supporting Files */, + ); + path = "Recipe 13-2 Implementing UIKit DynamicsTests"; + sourceTree = ""; + }; + 881292A117E6A7F80057E325 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881292A217E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist */, + 881292A317E6A7F80057E325 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8812927717E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881292AA17E6A7F80057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-2 Implementing UIKit Dynamics" */; + buildPhases = ( + 8812927417E6A7F70057E325 /* Sources */, + 8812927517E6A7F70057E325 /* Frameworks */, + 8812927617E6A7F70057E325 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 13-2 Implementing UIKit Dynamics"; + productName = "Recipe 13-2 Implementing UIKit Dynamics"; + productReference = 8812927817E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics.app */; + productType = "com.apple.product-type.application"; + }; + 8812929817E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881292AD17E6A7F80057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-2 Implementing UIKit DynamicsTests" */; + buildPhases = ( + 8812929517E6A7F80057E325 /* Sources */, + 8812929617E6A7F80057E325 /* Frameworks */, + 8812929717E6A7F80057E325 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8812929F17E6A7F80057E325 /* PBXTargetDependency */, + ); + name = "Recipe 13-2 Implementing UIKit DynamicsTests"; + productName = "Recipe 13-2 Implementing UIKit DynamicsTests"; + productReference = 8812929917E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8812927017E6A7F70057E325 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = Gravity; + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8812927717E6A7F70057E325 = { + DevelopmentTeam = H7ALWBN8YV; + }; + 8812929817E6A7F80057E325 = { + TestTargetID = 8812927717E6A7F70057E325; + }; + }; + }; + buildConfigurationList = 8812927317E6A7F70057E325 /* Build configuration list for PBXProject "Recipe 13-2 Implementing UIKit Dynamics" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8812926F17E6A7F70057E325; + productRefGroup = 8812927917E6A7F70057E325 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8812927717E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics */, + 8812929817E6A7F80057E325 /* Recipe 13-2 Implementing UIKit DynamicsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8812927617E6A7F70057E325 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812929417E6A7F70057E325 /* Images.xcassets in Resources */, + 8812928617E6A7F70057E325 /* InfoPlist.strings in Resources */, + 88C9422717EAC72900B412F9 /* Star.png in Resources */, + 881292B117E7D9DE0057E325 /* Ball.png in Resources */, + 8812928F17E6A7F70057E325 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8812929717E6A7F80057E325 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881292A517E6A7F80057E325 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8812927417E6A7F70057E325 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8812928817E6A7F70057E325 /* main.m in Sources */, + 88C9422D17EB730900B412F9 /* BouncingSpringBehavior.m in Sources */, + 881292B717E93C040057E325 /* ItemPropertyViewController.m in Sources */, + 8812928C17E6A7F70057E325 /* GravityAppDelegate.m in Sources */, + 881292B417E7F7950057E325 /* GravityWithCollsionViewController.m in Sources */, + 88C9422A17EAC8C100B412F9 /* SpringAttachmentViewController.m in Sources */, + 881292BA17E947560057E325 /* SnapViewController.m in Sources */, + 881292BD17E95A2B0057E325 /* PushViewController.m in Sources */, + 8812929217E6A7F70057E325 /* GravityViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8812929517E6A7F80057E325 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881292A717E6A7F80057E325 /* Recipe_13_2_Implementing_UIKit_DynamicsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8812929F17E6A7F80057E325 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8812927717E6A7F70057E325 /* Recipe 13-2 Implementing UIKit Dynamics */; + targetProxy = 8812929E17E6A7F80057E325 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8812928417E6A7F70057E325 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8812928517E6A7F70057E325 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8812928D17E6A7F70057E325 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8812928E17E6A7F70057E325 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 881292A317E6A7F80057E325 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881292A417E6A7F80057E325 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 881292A817E6A7F80057E325 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 881292A917E6A7F80057E325 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 881292AB17E6A7F80057E325 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch"; + INFOPLIST_FILE = "Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 881292AC17E6A7F80057E325 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch"; + INFOPLIST_FILE = "Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 881292AE17E6A7F80057E325 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 13-2 Implementing UIKit Dynamics.app/Recipe 13-2 Implementing UIKit Dynamics"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 13-2 Implementing UIKit DynamicsTests/Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 881292AF17E6A7F80057E325 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 13-2 Implementing UIKit Dynamics.app/Recipe 13-2 Implementing UIKit Dynamics"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch"; + INFOPLIST_FILE = "Recipe 13-2 Implementing UIKit DynamicsTests/Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8812927317E6A7F70057E325 /* Build configuration list for PBXProject "Recipe 13-2 Implementing UIKit Dynamics" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881292A817E6A7F80057E325 /* Debug */, + 881292A917E6A7F80057E325 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881292AA17E6A7F80057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-2 Implementing UIKit Dynamics" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881292AB17E6A7F80057E325 /* Debug */, + 881292AC17E6A7F80057E325 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881292AD17E6A7F80057E325 /* Build configuration list for PBXNativeTarget "Recipe 13-2 Implementing UIKit DynamicsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881292AE17E6A7F80057E325 /* Debug */, + 881292AF17E6A7F80057E325 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8812927017E6A7F70057E325 /* Project object */; +} diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..01e9adf --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..b6d2b31 Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..4fcd356 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 13-2 Implementing UIKit Dynamics.xcscheme b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 13-2 Implementing UIKit Dynamics.xcscheme new file mode 100644 index 0000000..d41a8ee --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 13-2 Implementing UIKit Dynamics.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..52b4508 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 13-2 Implementing UIKit Dynamics.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8812927717E6A7F70057E325 + + primary + + + 8812929817E6A7F80057E325 + + primary + + + + + diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Ball.png b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Ball.png new file mode 100644 index 0000000..32ac3a6 Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Ball.png differ diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Base.lproj/Main.storyboard b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Base.lproj/Main.storyboard new file mode 100644 index 0000000..1ff2e17 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Base.lproj/Main.storyboard @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityAppDelegate.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityAppDelegate.h new file mode 100644 index 0000000..2e7abaf --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityAppDelegate.h @@ -0,0 +1,15 @@ +// +// GravityAppDelegate.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface GravityAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityAppDelegate.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityAppDelegate.m new file mode 100644 index 0000000..d44e3b6 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityAppDelegate.m @@ -0,0 +1,46 @@ +// +// GravityAppDelegate.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GravityAppDelegate.h" + +@implementation GravityAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityViewController.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityViewController.h new file mode 100644 index 0000000..437c4ea --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityViewController.h @@ -0,0 +1,17 @@ +// +// GravityViewController.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface GravityViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *blueBall; +@property (nonatomic) UIDynamicAnimator *animator; + + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityViewController.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityViewController.m new file mode 100644 index 0000000..f9373ad --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityViewController.m @@ -0,0 +1,35 @@ +// +// GravityViewController.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GravityViewController.h" + +@interface GravityViewController () + +@end + +@implementation GravityViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + UIGravityBehavior *gravityBehavior = [[UIGravityBehavior alloc] initWithItems:@[self.blueBall]]; + + [self.animator addBehavior:gravityBehavior]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. + + +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityWithCollsionViewController.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityWithCollsionViewController.h new file mode 100644 index 0000000..51fb8c1 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityWithCollsionViewController.h @@ -0,0 +1,16 @@ +// +// GravityWithCollsionViewController.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/16/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface GravityWithCollsionViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *blueBall; +@property (nonatomic) UIDynamicAnimator *animator; + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityWithCollsionViewController.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityWithCollsionViewController.m new file mode 100644 index 0000000..3200e85 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/GravityWithCollsionViewController.m @@ -0,0 +1,60 @@ +// +// GravityWithCollsionViewController.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/16/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GravityWithCollsionViewController.h" + +@interface GravityWithCollsionViewController () + +@end + +@implementation GravityWithCollsionViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + + + self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + UIGravityBehavior *gravityBehavior = [[UIGravityBehavior alloc] initWithItems:@[self.blueBall]]; + UICollisionBehavior *collisionBehavior = [[UICollisionBehavior alloc] initWithItems:@[self.blueBall]]; + + collisionBehavior.translatesReferenceBoundsIntoBoundary = YES; + collisionBehavior.collisionDelegate = self; + + [self.animator addBehavior:gravityBehavior]; + [self.animator addBehavior:collisionBehavior]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(void)collisionBehavior:(UICollisionBehavior *)behavior beganContactForItem:(id)item withBoundaryIdentifier:(id)identifier atPoint:(CGPoint)p +{ + [self.blueBall setAlpha:1.0f]; +} + +-(void)collisionBehavior:(UICollisionBehavior *)behavior endedContactForItem:(id)item withBoundaryIdentifier:(id)identifier +{ + [self.blueBall setAlpha:0.5f]; +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Images.xcassets/AppIcon.appiconset/Contents.json b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/ItemPropertyViewController.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/ItemPropertyViewController.h new file mode 100644 index 0000000..d1f3374 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/ItemPropertyViewController.h @@ -0,0 +1,17 @@ +// +// ItemPropertyViewController.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/17/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ItemPropertyViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *ball1; +@property (weak, nonatomic) IBOutlet UIImageView *ball2; +@property (nonatomic) UIDynamicAnimator *animator; + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/ItemPropertyViewController.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/ItemPropertyViewController.m new file mode 100644 index 0000000..88332d6 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/ItemPropertyViewController.m @@ -0,0 +1,50 @@ +// +// ItemPropertyViewController.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/17/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ItemPropertyViewController.h" + +@interface ItemPropertyViewController () + +@end + +@implementation ItemPropertyViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + UIGravityBehavior *gravityBehavior = [[UIGravityBehavior alloc] initWithItems:@[self.ball1,self.ball2]]; + UICollisionBehavior *collisionBehavior = [[UICollisionBehavior alloc] initWithItems:@[self.ball1,self.ball2]]; + UIDynamicItemBehavior* propertiesBehavior = [[UIDynamicItemBehavior alloc] initWithItems:@[self.ball2]]; + propertiesBehavior.elasticity = 0.75f; + + + collisionBehavior.translatesReferenceBoundsIntoBoundary = YES; + + [self.animator addBehavior:propertiesBehavior]; + [self.animator addBehavior:gravityBehavior]; + [self.animator addBehavior:collisionBehavior]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/PushViewController.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/PushViewController.h new file mode 100644 index 0000000..4051338 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/PushViewController.h @@ -0,0 +1,18 @@ +// +// PushViewController.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/17/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface PushViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *ball1; +@property (weak, nonatomic) IBOutlet UIImageView *ball2; +@property (nonatomic) UIDynamicAnimator *animator; + + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/PushViewController.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/PushViewController.m new file mode 100644 index 0000000..6bb666d --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/PushViewController.m @@ -0,0 +1,53 @@ +// +// PushViewController.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/17/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "PushViewController.h" + +@interface PushViewController () + +@end + +@implementation PushViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + + UIPushBehavior *instantPushBehavior = [[UIPushBehavior alloc] initWithItems:@[self.ball1] mode:UIPushBehaviorModeInstantaneous]; + UIPushBehavior *continuousPushBehavior = [[UIPushBehavior alloc] initWithItems:@[self.ball2] mode:UIPushBehaviorModeContinuous]; + + //90 degrees counter-clockwise + instantPushBehavior.angle = -1.57; + continuousPushBehavior.angle = -1.57; + + instantPushBehavior.magnitude = 0.5; + continuousPushBehavior.magnitude = 0.5; + + [self.animator addBehavior:instantPushBehavior]; + [self.animator addBehavior:continuousPushBehavior]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Info.plist b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Info.plist new file mode 100644 index 0000000..426b098 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SnapViewController.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SnapViewController.h new file mode 100644 index 0000000..c14125d --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SnapViewController.h @@ -0,0 +1,18 @@ +// +// SnapViewController.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/17/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface SnapViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *blueBall; +@property (nonatomic) UIDynamicAnimator *animator; + +- (IBAction)handleGestureRecognizer:(UITapGestureRecognizer *)sender; + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SnapViewController.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SnapViewController.m new file mode 100644 index 0000000..ca9330c --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SnapViewController.m @@ -0,0 +1,58 @@ +// +// SnapViewController.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/17/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "SnapViewController.h" + +@interface SnapViewController () + +@end + +@implementation SnapViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. + + self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)handleGestureRecognizer:(UITapGestureRecognizer *)sender +{ + CGPoint point = [sender locationInView:self.view]; + + if([self.animator behaviors]) + { + [self.animator removeAllBehaviors]; + + UISnapBehavior* snapBehavior = [[UISnapBehavior alloc] initWithItem:self.blueBall snapToPoint:point]; + [self.animator addBehavior:snapBehavior]; + + } + else + { + UISnapBehavior* snapBehavior = [[UISnapBehavior alloc] initWithItem:self.blueBall snapToPoint:point]; + [self.animator addBehavior:snapBehavior]; + } +} +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SpringAttachmentViewController.h b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SpringAttachmentViewController.h new file mode 100644 index 0000000..204364c --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SpringAttachmentViewController.h @@ -0,0 +1,16 @@ +// +// SpringAttachmentViewController.h +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/18/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface SpringAttachmentViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *ball; +@property (weak, nonatomic) IBOutlet UIImageView *star; +@property (nonatomic) UIDynamicAnimator *animator; +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SpringAttachmentViewController.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SpringAttachmentViewController.m new file mode 100644 index 0000000..638ae54 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/SpringAttachmentViewController.m @@ -0,0 +1,76 @@ +// +// SpringAttachmentViewController.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/18/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "SpringAttachmentViewController.h" +#import "BouncingSpringBehavior.h" + +@interface SpringAttachmentViewController () + +@end + +@implementation SpringAttachmentViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + /* + + self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + + UIGravityBehavior *gravityBehavior = [[UIGravityBehavior alloc] initWithItems:@[self.ball,self.star]]; + UICollisionBehavior *collisionBehavior = [[UICollisionBehavior alloc] initWithItems:@[self.ball,self.star]]; + + CGPoint anchorPoint = CGPointMake(self.view.frame.size.width/2, 20); + + UIAttachmentBehavior *ballAttachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:self.ball attachedToAnchor:anchorPoint]; + + UIAttachmentBehavior *starAttachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:self.star offsetFromCenter:UIOffsetMake(-20.0, 0) attachedToItem:self.ball offsetFromCenter:UIOffsetZero]; + + collisionBehavior.translatesReferenceBoundsIntoBoundary = YES; + + [ballAttachmentBehavior setFrequency:1.0]; + [ballAttachmentBehavior setDamping:0.65]; + + [starAttachmentBehavior setFrequency:1.0]; + [starAttachmentBehavior setDamping:0.65]; + + [self.animator addBehavior:ballAttachmentBehavior]; + [self.animator addBehavior:starAttachmentBehavior]; + [self.animator addBehavior:collisionBehavior]; + [self.animator addBehavior:gravityBehavior]; + + */ + + self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + + CGPoint anchorPoint = CGPointMake(self.view.frame.size.width/2, 20); + NSString *anchorPointString = NSStringFromCGPoint(anchorPoint); + + BouncingSpringBehavior *bouncingSpringBehavior = [[BouncingSpringBehavior alloc] initWithItems:@[self.ball,self.star] withAnchorPoint:anchorPointString]; + + [self.animator addBehavior:bouncingSpringBehavior]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Star.png b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Star.png new file mode 100644 index 0000000..e759f99 Binary files /dev/null and b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/Star.png differ diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/en.lproj/InfoPlist.strings b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/main.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/main.m new file mode 100644 index 0000000..7ceb206 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit Dynamics/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 13-2 Implementing UIKit Dynamics +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "GravityAppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([GravityAppDelegate class])); + } +} diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/Recipe 13-2 Implementing UIKit DynamicsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/Recipe_13_2_Implementing_UIKit_DynamicsTests.m b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/Recipe_13_2_Implementing_UIKit_DynamicsTests.m new file mode 100644 index 0000000..0c5cf03 --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/Recipe_13_2_Implementing_UIKit_DynamicsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_13_2_Implementing_UIKit_DynamicsTests.m +// Recipe 13-2 Implementing UIKit DynamicsTests +// +// Created by joseph hoffman on 9/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_13_2_Implementing_UIKit_DynamicsTests : XCTestCase + +@end + +@implementation Recipe_13_2_Implementing_UIKit_DynamicsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/en.lproj/InfoPlist.strings b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH13 - Animation Recipes/Recipe 13-2 Implementing UIKit Dynamics/Recipe 13-2 Implementing UIKit DynamicsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/.DS_Store b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/.DS_Store new file mode 100644 index 0000000..f98df09 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/.DS_Store differ diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/project.pbxproj b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f7b98ed --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/project.pbxproj @@ -0,0 +1,469 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8857E87A17D10E4100B5668C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8857E87917D10E4100B5668C /* Foundation.framework */; }; + 8857E87C17D10E4100B5668C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8857E87B17D10E4100B5668C /* CoreGraphics.framework */; }; + 8857E87E17D10E4100B5668C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8857E87D17D10E4100B5668C /* UIKit.framework */; }; + 8857E88417D10E4100B5668C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8857E88217D10E4100B5668C /* InfoPlist.strings */; }; + 8857E88617D10E4100B5668C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8857E88517D10E4100B5668C /* main.m */; }; + 8857E88A17D10E4100B5668C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8857E88917D10E4100B5668C /* AppDelegate.m */; }; + 8857E88D17D10E4100B5668C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8857E88B17D10E4100B5668C /* Main.storyboard */; }; + 8857E89017D10E4100B5668C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8857E88F17D10E4100B5668C /* ViewController.m */; }; + 8857E89217D10E4100B5668C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8857E89117D10E4100B5668C /* Images.xcassets */; }; + 8857E89917D10E4200B5668C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8857E89817D10E4200B5668C /* XCTest.framework */; }; + 8857E89A17D10E4200B5668C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8857E87917D10E4100B5668C /* Foundation.framework */; }; + 8857E89B17D10E4200B5668C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8857E87D17D10E4100B5668C /* UIKit.framework */; }; + 8857E8A317D10E4200B5668C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8857E8A117D10E4200B5668C /* InfoPlist.strings */; }; + 8857E8A517D10E4200B5668C /* Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8857E8A417D10E4200B5668C /* Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8857E89C17D10E4200B5668C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8857E86E17D10E4100B5668C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8857E87517D10E4100B5668C; + remoteInfo = "Recipe 14-1: Working with NSCalendar and NSDate"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8857E87617D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 14-1 Working with NSCalendar and NSDate.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8857E87917D10E4100B5668C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8857E87B17D10E4100B5668C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8857E87D17D10E4100B5668C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8857E88117D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-1 Working with NSCalendar and NSDate-Info.plist"; sourceTree = ""; }; + 8857E88317D10E4100B5668C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8857E88517D10E4100B5668C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8857E88717D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch"; sourceTree = ""; }; + 8857E88817D10E4100B5668C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8857E88917D10E4100B5668C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8857E88C17D10E4100B5668C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8857E88E17D10E4100B5668C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8857E88F17D10E4100B5668C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8857E89117D10E4100B5668C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8857E89717D10E4200B5668C /* Recipe 14-1 Working with NSCalendar and NSDateTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 14-1 Working with NSCalendar and NSDateTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8857E89817D10E4200B5668C /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8857E8A017D10E4200B5668C /* Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist"; sourceTree = ""; }; + 8857E8A217D10E4200B5668C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8857E8A417D10E4200B5668C /* Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8857E87317D10E4100B5668C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8857E87C17D10E4100B5668C /* CoreGraphics.framework in Frameworks */, + 8857E87E17D10E4100B5668C /* UIKit.framework in Frameworks */, + 8857E87A17D10E4100B5668C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8857E89417D10E4200B5668C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8857E89917D10E4200B5668C /* XCTest.framework in Frameworks */, + 8857E89B17D10E4200B5668C /* UIKit.framework in Frameworks */, + 8857E89A17D10E4200B5668C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8857E86D17D10E4000B5668C = { + isa = PBXGroup; + children = ( + 8857E87F17D10E4100B5668C /* Recipe 14-1: Working with NSCalendar and NSDate */, + 8857E89E17D10E4200B5668C /* Recipe 14-1: Working with NSCalendar and NSDateTests */, + 8857E87817D10E4100B5668C /* Frameworks */, + 8857E87717D10E4100B5668C /* Products */, + ); + sourceTree = ""; + }; + 8857E87717D10E4100B5668C /* Products */ = { + isa = PBXGroup; + children = ( + 8857E87617D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate.app */, + 8857E89717D10E4200B5668C /* Recipe 14-1 Working with NSCalendar and NSDateTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8857E87817D10E4100B5668C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8857E87917D10E4100B5668C /* Foundation.framework */, + 8857E87B17D10E4100B5668C /* CoreGraphics.framework */, + 8857E87D17D10E4100B5668C /* UIKit.framework */, + 8857E89817D10E4200B5668C /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8857E87F17D10E4100B5668C /* Recipe 14-1: Working with NSCalendar and NSDate */ = { + isa = PBXGroup; + children = ( + 8857E88817D10E4100B5668C /* AppDelegate.h */, + 8857E88917D10E4100B5668C /* AppDelegate.m */, + 8857E88B17D10E4100B5668C /* Main.storyboard */, + 8857E88E17D10E4100B5668C /* ViewController.h */, + 8857E88F17D10E4100B5668C /* ViewController.m */, + 8857E89117D10E4100B5668C /* Images.xcassets */, + 8857E88017D10E4100B5668C /* Supporting Files */, + ); + path = "Recipe 14-1: Working with NSCalendar and NSDate"; + sourceTree = ""; + }; + 8857E88017D10E4100B5668C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8857E88117D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate-Info.plist */, + 8857E88217D10E4100B5668C /* InfoPlist.strings */, + 8857E88517D10E4100B5668C /* main.m */, + 8857E88717D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8857E89E17D10E4200B5668C /* Recipe 14-1: Working with NSCalendar and NSDateTests */ = { + isa = PBXGroup; + children = ( + 8857E8A417D10E4200B5668C /* Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m */, + 8857E89F17D10E4200B5668C /* Supporting Files */, + ); + path = "Recipe 14-1: Working with NSCalendar and NSDateTests"; + sourceTree = ""; + }; + 8857E89F17D10E4200B5668C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8857E8A017D10E4200B5668C /* Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist */, + 8857E8A117D10E4200B5668C /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8857E87517D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8857E8A817D10E4200B5668C /* Build configuration list for PBXNativeTarget "Recipe 14-1 Working with NSCalendar and NSDate" */; + buildPhases = ( + 8857E87217D10E4100B5668C /* Sources */, + 8857E87317D10E4100B5668C /* Frameworks */, + 8857E87417D10E4100B5668C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 14-1 Working with NSCalendar and NSDate"; + productName = "Recipe 14-1: Working with NSCalendar and NSDate"; + productReference = 8857E87617D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate.app */; + productType = "com.apple.product-type.application"; + }; + 8857E89617D10E4200B5668C /* Recipe 14-1 Working with NSCalendar and NSDateTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8857E8AB17D10E4200B5668C /* Build configuration list for PBXNativeTarget "Recipe 14-1 Working with NSCalendar and NSDateTests" */; + buildPhases = ( + 8857E89317D10E4200B5668C /* Sources */, + 8857E89417D10E4200B5668C /* Frameworks */, + 8857E89517D10E4200B5668C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8857E89D17D10E4200B5668C /* PBXTargetDependency */, + ); + name = "Recipe 14-1 Working with NSCalendar and NSDateTests"; + productName = "Recipe 14-1: Working with NSCalendar and NSDateTests"; + productReference = 8857E89717D10E4200B5668C /* Recipe 14-1 Working with NSCalendar and NSDateTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8857E86E17D10E4100B5668C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8857E89617D10E4200B5668C = { + TestTargetID = 8857E87517D10E4100B5668C; + }; + }; + }; + buildConfigurationList = 8857E87117D10E4100B5668C /* Build configuration list for PBXProject "Recipe 14-1 Working with NSCalendar and NSDate" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8857E86D17D10E4000B5668C; + productRefGroup = 8857E87717D10E4100B5668C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8857E87517D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate */, + 8857E89617D10E4200B5668C /* Recipe 14-1 Working with NSCalendar and NSDateTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8857E87417D10E4100B5668C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8857E89217D10E4100B5668C /* Images.xcassets in Resources */, + 8857E88417D10E4100B5668C /* InfoPlist.strings in Resources */, + 8857E88D17D10E4100B5668C /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8857E89517D10E4200B5668C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8857E8A317D10E4200B5668C /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8857E87217D10E4100B5668C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8857E89017D10E4100B5668C /* ViewController.m in Sources */, + 8857E88A17D10E4100B5668C /* AppDelegate.m in Sources */, + 8857E88617D10E4100B5668C /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8857E89317D10E4200B5668C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8857E8A517D10E4200B5668C /* Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8857E89D17D10E4200B5668C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8857E87517D10E4100B5668C /* Recipe 14-1 Working with NSCalendar and NSDate */; + targetProxy = 8857E89C17D10E4200B5668C /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8857E88217D10E4100B5668C /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8857E88317D10E4100B5668C /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8857E88B17D10E4100B5668C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8857E88C17D10E4100B5668C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8857E8A117D10E4200B5668C /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8857E8A217D10E4200B5668C /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8857E8A617D10E4200B5668C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8857E8A717D10E4200B5668C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8857E8A917D10E4200B5668C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-1: Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-1: Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Info.plist"; + PRODUCT_NAME = "Recipe 14-1 Working with NSCalendar and NSDate"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8857E8AA17D10E4200B5668C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-1: Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-1: Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Info.plist"; + PRODUCT_NAME = "Recipe 14-1 Working with NSCalendar and NSDate"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8857E8AC17D10E4200B5668C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-1: Working with NSCalendar and NSDate.app/Recipe 14-1: Working with NSCalendar and NSDate"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-1: Working with NSCalendar and NSDate/Recipe 14-1: Working with NSCalendar and NSDate-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 14-1: Working with NSCalendar and NSDateTests/Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist"; + PRODUCT_NAME = "Recipe 14-1 Working with NSCalendar and NSDateTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8857E8AD17D10E4200B5668C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-1: Working with NSCalendar and NSDate.app/Recipe 14-1: Working with NSCalendar and NSDate"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-1: Working with NSCalendar and NSDate/Recipe 14-1: Working with NSCalendar and NSDate-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-1: Working with NSCalendar and NSDateTests/Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist"; + PRODUCT_NAME = "Recipe 14-1 Working with NSCalendar and NSDateTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8857E87117D10E4100B5668C /* Build configuration list for PBXProject "Recipe 14-1 Working with NSCalendar and NSDate" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8857E8A617D10E4200B5668C /* Debug */, + 8857E8A717D10E4200B5668C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8857E8A817D10E4200B5668C /* Build configuration list for PBXNativeTarget "Recipe 14-1 Working with NSCalendar and NSDate" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8857E8A917D10E4200B5668C /* Debug */, + 8857E8AA17D10E4200B5668C /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8857E8AB17D10E4200B5668C /* Build configuration list for PBXNativeTarget "Recipe 14-1 Working with NSCalendar and NSDateTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8857E8AC17D10E4200B5668C /* Debug */, + 8857E8AD17D10E4200B5668C /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8857E86E17D10E4100B5668C /* Project object */; +} diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9e3cf32 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..26dd519 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 14-1: Working with NSCalendar and NSDate.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8857E87517D10E4100B5668C + + primary + + + 8857E89617D10E4200B5668C + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/AppDelegate.h b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/AppDelegate.h new file mode 100644 index 0000000..e600de8 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 14-1: Working with NSCalendar and NSDate +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/AppDelegate.m b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/AppDelegate.m new file mode 100644 index 0000000..7b64563 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 14-1: Working with NSCalendar and NSDate +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Base.lproj/Main.storyboard b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Base.lproj/Main.storyboard new file mode 100644 index 0000000..d2ea4ca --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Base.lproj/Main.storyboard @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Images.xcassets/AppIcon.appiconset/Contents.json b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Info.plist b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1 Working with NSCalendar and NSDate-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/ViewController.h b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/ViewController.h new file mode 100644 index 0000000..f8831d6 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/ViewController.h @@ -0,0 +1,26 @@ +// +// ViewController.h +// Recipe 14-1: Working with NSCalendar and NSDate +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextField *gMonthTextField; +@property (weak, nonatomic) IBOutlet UITextField *gDayTextField; +@property (weak, nonatomic) IBOutlet UITextField *gYearTextField; +@property (weak, nonatomic) IBOutlet UITextField *hMonthTextField; +@property (weak, nonatomic) IBOutlet UITextField *hDayTextField; +@property (weak, nonatomic) IBOutlet UITextField *hYearTextField; + +@property (nonatomic, strong) NSCalendar *gregorianCalendar; +@property (nonatomic, strong) NSCalendar *hebrewCalendar; + +- (IBAction)convertToHebrew:(id)sender; +- (IBAction)convertToGregorian:(id)sender; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/ViewController.m b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/ViewController.m new file mode 100644 index 0000000..4be18e1 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/ViewController.m @@ -0,0 +1,113 @@ +// +// ViewController.m +// Recipe 14-1: Working with NSCalendar and NSDate +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.gMonthTextField.delegate = self; + self.gDayTextField.delegate = self; + self.gYearTextField.delegate = self; + self.hMonthTextField.delegate = self; + self.hDayTextField.delegate = self; + self.hYearTextField.delegate = self; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - lazy initialization methods + +-(NSCalendar *)gregorianCalendar +{ + if (!_gregorianCalendar) + { + _gregorianCalendar = + [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; + } + return _gregorianCalendar; +} + +-(NSCalendar *)hebrewCalendar +{ + if (!_hebrewCalendar) + { + _hebrewCalendar = + [[NSCalendar alloc] initWithCalendarIdentifier:NSHebrewCalendar]; + } + return _hebrewCalendar; +} + +#pragma mark - actions + +- (IBAction)convertToHebrew:(id)sender +{ + NSDateComponents *gComponents = [[NSDateComponents alloc] init]; + [gComponents setDay:[self.gDayTextField.text integerValue]]; + [gComponents setMonth:[self.gMonthTextField.text integerValue]]; + [gComponents setYear:[self.gYearTextField.text integerValue]]; + + NSDate *gregorianDate = [self.gregorianCalendar dateFromComponents:gComponents]; + + NSUInteger unitFlags = + NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit; + + NSDateComponents *hebrewDateComponents = + [self.hebrewCalendar components:unitFlags fromDate:gregorianDate]; + + self.hDayTextField.text = + [[NSNumber numberWithInteger:hebrewDateComponents.day] stringValue]; + self.hMonthTextField.text = + [[NSNumber numberWithInteger:hebrewDateComponents.month] stringValue]; + self.hYearTextField.text = + [[NSNumber numberWithInteger:hebrewDateComponents.year] stringValue]; + +} + +- (IBAction)convertToGregorian:(id)sender +{ + NSDateComponents *hComponents = [[NSDateComponents alloc] init]; + [hComponents setDay:[self.hDayTextField.text integerValue]]; + [hComponents setMonth:[self.hMonthTextField.text integerValue]]; + [hComponents setYear:[self.hYearTextField.text integerValue]]; + + NSDate *hebrewDate = [self.hebrewCalendar dateFromComponents:hComponents]; + + NSUInteger unitFlags = + NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit; + + NSDateComponents *hebrewDateComponents = + [self.gregorianCalendar components:unitFlags fromDate:hebrewDate]; + + self.gDayTextField.text = + [[NSNumber numberWithInteger:hebrewDateComponents.day] stringValue]; + self.gMonthTextField.text = + [[NSNumber numberWithInteger:hebrewDateComponents.month] stringValue]; + self.gYearTextField.text = + [[NSNumber numberWithInteger:hebrewDateComponents.year] stringValue]; +} + +#pragma mark - Delegate Methods + +-(BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} +@end diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/main.m b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/main.m new file mode 100644 index 0000000..f3a9591 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDate/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 14-1: Working with NSCalendar and NSDate +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/Recipe 14-1 Working with NSCalendar and NSDateTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m new file mode 100644 index 0000000..20d3dcd --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m @@ -0,0 +1,34 @@ +// +// Recipe_14_1__Working_with_NSCalendar_and_NSDateTests.m +// Recipe 14-1: Working with NSCalendar and NSDateTests +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_14_1__Working_with_NSCalendar_and_NSDateTests : XCTestCase + +@end + +@implementation Recipe_14_1__Working_with_NSCalendar_and_NSDateTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-1_ Working with NSCalendar and NSDate/Recipe 14-1_ Working with NSCalendar and NSDateTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/.DS_Store b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/.DS_Store new file mode 100644 index 0000000..1bae84e Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/.DS_Store differ diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.pbxproj b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3af0abf --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8811316517D117E500021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316417D117E500021032 /* Foundation.framework */; }; + 8811316717D117E500021032 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316617D117E500021032 /* CoreGraphics.framework */; }; + 8811316917D117E500021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316817D117E500021032 /* UIKit.framework */; }; + 8811316F17D117E500021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8811316D17D117E500021032 /* InfoPlist.strings */; }; + 8811317117D117E500021032 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317017D117E500021032 /* main.m */; }; + 8811317517D117E500021032 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317417D117E500021032 /* AppDelegate.m */; }; + 8811317817D117E500021032 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8811317617D117E500021032 /* Main.storyboard */; }; + 8811317B17D117E500021032 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317A17D117E500021032 /* ViewController.m */; }; + 8811317D17D117E500021032 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8811317C17D117E500021032 /* Images.xcassets */; }; + 8811318417D117E500021032 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811318317D117E500021032 /* XCTest.framework */; }; + 8811318517D117E500021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316417D117E500021032 /* Foundation.framework */; }; + 8811318617D117E500021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316817D117E500021032 /* UIKit.framework */; }; + 8811318E17D117E500021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8811318C17D117E500021032 /* InfoPlist.strings */; }; + 8811319017D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */; }; + 8811319A17D1185B00021032 /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811319917D1185B00021032 /* EventKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8811318717D117E500021032 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8811315917D117E500021032 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8811316017D117E500021032; + remoteInfo = "14-2 Fetching Calendar Events"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8811316117D117E500021032 /* 14-2 Fetching Calendar Events.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "14-2 Fetching Calendar Events.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8811316417D117E500021032 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8811316617D117E500021032 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8811316817D117E500021032 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8811316C17D117E500021032 /* 14-2 Fetching Calendar Events-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "14-2 Fetching Calendar Events-Info.plist"; sourceTree = ""; }; + 8811316E17D117E500021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8811317017D117E500021032 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8811317217D117E500021032 /* 14-2 Fetching Calendar Events-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "14-2 Fetching Calendar Events-Prefix.pch"; sourceTree = ""; }; + 8811317317D117E500021032 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8811317417D117E500021032 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8811317717D117E500021032 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8811317917D117E500021032 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8811317A17D117E500021032 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8811317C17D117E500021032 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8811318217D117E500021032 /* 14-2 Fetching Calendar EventsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "14-2 Fetching Calendar EventsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8811318317D117E500021032 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8811318B17D117E500021032 /* 14-2 Fetching Calendar EventsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "14-2 Fetching Calendar EventsTests-Info.plist"; sourceTree = ""; }; + 8811318D17D117E500021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _4_2_Fetching_Calendar_EventsTests.m; sourceTree = ""; }; + 8811319917D1185B00021032 /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8811315E17D117E500021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811319A17D1185B00021032 /* EventKit.framework in Frameworks */, + 8811316717D117E500021032 /* CoreGraphics.framework in Frameworks */, + 8811316917D117E500021032 /* UIKit.framework in Frameworks */, + 8811316517D117E500021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811317F17D117E500021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811318417D117E500021032 /* XCTest.framework in Frameworks */, + 8811318617D117E500021032 /* UIKit.framework in Frameworks */, + 8811318517D117E500021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8811315817D117E500021032 = { + isa = PBXGroup; + children = ( + 8811316A17D117E500021032 /* 14-2 Fetching Calendar Events */, + 8811318917D117E500021032 /* 14-2 Fetching Calendar EventsTests */, + 8811316317D117E500021032 /* Frameworks */, + 8811316217D117E500021032 /* Products */, + ); + sourceTree = ""; + }; + 8811316217D117E500021032 /* Products */ = { + isa = PBXGroup; + children = ( + 8811316117D117E500021032 /* 14-2 Fetching Calendar Events.app */, + 8811318217D117E500021032 /* 14-2 Fetching Calendar EventsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8811316317D117E500021032 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8811319917D1185B00021032 /* EventKit.framework */, + 8811316417D117E500021032 /* Foundation.framework */, + 8811316617D117E500021032 /* CoreGraphics.framework */, + 8811316817D117E500021032 /* UIKit.framework */, + 8811318317D117E500021032 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8811316A17D117E500021032 /* 14-2 Fetching Calendar Events */ = { + isa = PBXGroup; + children = ( + 8811317317D117E500021032 /* AppDelegate.h */, + 8811317417D117E500021032 /* AppDelegate.m */, + 8811317617D117E500021032 /* Main.storyboard */, + 8811317917D117E500021032 /* ViewController.h */, + 8811317A17D117E500021032 /* ViewController.m */, + 8811317C17D117E500021032 /* Images.xcassets */, + 8811316B17D117E500021032 /* Supporting Files */, + ); + path = "14-2 Fetching Calendar Events"; + sourceTree = ""; + }; + 8811316B17D117E500021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8811316C17D117E500021032 /* 14-2 Fetching Calendar Events-Info.plist */, + 8811316D17D117E500021032 /* InfoPlist.strings */, + 8811317017D117E500021032 /* main.m */, + 8811317217D117E500021032 /* 14-2 Fetching Calendar Events-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8811318917D117E500021032 /* 14-2 Fetching Calendar EventsTests */ = { + isa = PBXGroup; + children = ( + 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */, + 8811318A17D117E500021032 /* Supporting Files */, + ); + path = "14-2 Fetching Calendar EventsTests"; + sourceTree = ""; + }; + 8811318A17D117E500021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8811318B17D117E500021032 /* 14-2 Fetching Calendar EventsTests-Info.plist */, + 8811318C17D117E500021032 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8811316017D117E500021032 /* 14-2 Fetching Calendar Events */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8811319317D117E500021032 /* Build configuration list for PBXNativeTarget "14-2 Fetching Calendar Events" */; + buildPhases = ( + 8811315D17D117E500021032 /* Sources */, + 8811315E17D117E500021032 /* Frameworks */, + 8811315F17D117E500021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "14-2 Fetching Calendar Events"; + productName = "14-2 Fetching Calendar Events"; + productReference = 8811316117D117E500021032 /* 14-2 Fetching Calendar Events.app */; + productType = "com.apple.product-type.application"; + }; + 8811318117D117E500021032 /* 14-2 Fetching Calendar EventsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8811319617D117E500021032 /* Build configuration list for PBXNativeTarget "14-2 Fetching Calendar EventsTests" */; + buildPhases = ( + 8811317E17D117E500021032 /* Sources */, + 8811317F17D117E500021032 /* Frameworks */, + 8811318017D117E500021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8811318817D117E500021032 /* PBXTargetDependency */, + ); + name = "14-2 Fetching Calendar EventsTests"; + productName = "14-2 Fetching Calendar EventsTests"; + productReference = 8811318217D117E500021032 /* 14-2 Fetching Calendar EventsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8811315917D117E500021032 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8811318117D117E500021032 = { + TestTargetID = 8811316017D117E500021032; + }; + }; + }; + buildConfigurationList = 8811315C17D117E500021032 /* Build configuration list for PBXProject "14-2 Fetching Calendar Events" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8811315817D117E500021032; + productRefGroup = 8811316217D117E500021032 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8811316017D117E500021032 /* 14-2 Fetching Calendar Events */, + 8811318117D117E500021032 /* 14-2 Fetching Calendar EventsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8811315F17D117E500021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811317D17D117E500021032 /* Images.xcassets in Resources */, + 8811316F17D117E500021032 /* InfoPlist.strings in Resources */, + 8811317817D117E500021032 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811318017D117E500021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811318E17D117E500021032 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8811315D17D117E500021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811317B17D117E500021032 /* ViewController.m in Sources */, + 8811317517D117E500021032 /* AppDelegate.m in Sources */, + 8811317117D117E500021032 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811317E17D117E500021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811319017D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8811318817D117E500021032 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8811316017D117E500021032 /* 14-2 Fetching Calendar Events */; + targetProxy = 8811318717D117E500021032 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8811316D17D117E500021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8811316E17D117E500021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8811317617D117E500021032 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8811317717D117E500021032 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8811318C17D117E500021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8811318D17D117E500021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8811319117D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8811319217D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8811319417D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8811319517D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8811319717D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/14-2 Fetching Calendar Events.app/14-2 Fetching Calendar Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "14-2 Fetching Calendar EventsTests/14-2 Fetching Calendar EventsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8811319817D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/14-2 Fetching Calendar Events.app/14-2 Fetching Calendar Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar EventsTests/14-2 Fetching Calendar EventsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8811315C17D117E500021032 /* Build configuration list for PBXProject "14-2 Fetching Calendar Events" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319117D117E500021032 /* Debug */, + 8811319217D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8811319317D117E500021032 /* Build configuration list for PBXNativeTarget "14-2 Fetching Calendar Events" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319417D117E500021032 /* Debug */, + 8811319517D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8811319617D117E500021032 /* Build configuration list for PBXNativeTarget "14-2 Fetching Calendar EventsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319717D117E500021032 /* Debug */, + 8811319817D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8811315917D117E500021032 /* Project object */; +} diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..8b299c6 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..fbcbc90 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/14-2 Fetching Calendar Events.xcscheme b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/14-2 Fetching Calendar Events.xcscheme new file mode 100644 index 0000000..f30712e --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/14-2 Fetching Calendar Events.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..54c32b4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + 14-2 Fetching Calendar Events.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8811316017D117E500021032 + + primary + + + 8811318117D117E500021032 + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Info.plist b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Info.plist new file mode 100644 index 0000000..bae3d83 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Info.plist @@ -0,0 +1,42 @@ + + + + + NSCalendarsUsageDescription + Testing Calendar Events + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/AppDelegate.h b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/AppDelegate.h new file mode 100644 index 0000000..9d6fb10 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// 14-2 Fetching Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/AppDelegate.m b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/AppDelegate.m new file mode 100644 index 0000000..550758c --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// 14-2 Fetching Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b99208b --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/ViewController.h b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/ViewController.h new file mode 100644 index 0000000..f6b9ff0 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/ViewController.h @@ -0,0 +1,16 @@ +// +// ViewController.h +// 14-2 Fetching Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) EKEventStore *eventStore; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/ViewController.m b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/ViewController.m new file mode 100644 index 0000000..a06f36a --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/ViewController.m @@ -0,0 +1,61 @@ +// +// ViewController.m +// 14-2 Fetching Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.eventStore = [[EKEventStore alloc] init]; + + [self.eventStore requestAccessToEntityType:EKEntityTypeEvent + completion:^(BOOL granted, NSError *error) + { + if (granted) + { + NSDate *now = [NSDate date]; + + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSDateComponents *fortyEightHoursFromNowComponents = + [[NSDateComponents alloc] init]; + fortyEightHoursFromNowComponents.day = 2; // 48 hours forward + NSDate *fortyEightHoursFromNow = + [calendar dateByAddingComponents:fortyEightHoursFromNowComponents + toDate:now options:0]; + + NSPredicate *allEventsWithin48HoursPredicate = + [self.eventStore predicateForEventsWithStartDate:now + endDate:fortyEightHoursFromNow calendars:nil]; + NSArray *events = [self.eventStore + eventsMatchingPredicate:allEventsWithin48HoursPredicate]; + for (EKEvent *event in events) + { + NSLog(@"%@", event.title); + } + } + else + { + NSLog(@"Access not granted: %@", error); + } + }]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/main.m b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/main.m new file mode 100644 index 0000000..ecda9ed --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar Events/main.m @@ -0,0 +1,18 @@ +// +// main.m +// 14-2 Fetching Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/14-2 Fetching Calendar EventsTests-Info.plist b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/14-2 Fetching Calendar EventsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/14-2 Fetching Calendar EventsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m new file mode 100644 index 0000000..4b2faba --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m @@ -0,0 +1,34 @@ +// +// _4_2_Fetching_Calendar_EventsTests.m +// 14-2 Fetching Calendar EventsTests +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface _4_2_Fetching_Calendar_EventsTests : XCTestCase + +@end + +@implementation _4_2_Fetching_Calendar_EventsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-2 Fetching Calendar Events/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/.DS_Store b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/.DS_Store new file mode 100644 index 0000000..d8fd3a8 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/.DS_Store differ diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Info.plist b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Info.plist new file mode 100644 index 0000000..bae3d83 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Info.plist @@ -0,0 +1,42 @@ + + + + + NSCalendarsUsageDescription + Testing Calendar Events + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Prefix.pch b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/AppDelegate.h b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/AppDelegate.h new file mode 100644 index 0000000..7c2f47b --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// 14-3 Displaying Events in a Table View +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/AppDelegate.m b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/AppDelegate.m new file mode 100644 index 0000000..a9a0411 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// 14-3 Displaying Events in a Table View +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard new file mode 100644 index 0000000..4ddae78 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/ViewController.h b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/ViewController.h new file mode 100644 index 0000000..ddfd6e8 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/ViewController.h @@ -0,0 +1,20 @@ +// +// ViewController.h +// 14-3 Displaying Events in a Table View +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) EKEventStore *eventStore; +@property (weak, nonatomic) IBOutlet UITableView *eventsTableView; +@property (nonatomic, strong) NSMutableDictionary *events; +@property (nonatomic, strong) NSArray *calendars; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/ViewController.m b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/ViewController.m new file mode 100644 index 0000000..359f4f8 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/ViewController.m @@ -0,0 +1,181 @@ +// +// ViewController.m +// 14-3 Displaying Events in a Table View +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.title = @"Events"; + + UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self + action:@selector(refresh:)]; + self.navigationItem.leftBarButtonItem = refreshButton; + + self.eventsTableView.delegate = self; + self.eventsTableView.dataSource = self; + + self.eventStore = [[EKEventStore alloc] init]; + + [self.eventStore requestAccessToEntityType:EKEntityTypeEvent + completion:^(BOOL granted, NSError *error) + { + if (granted) + { + self.calendars = + [self.eventStore calendarsForEntityType:EKEntityTypeEvent]; + [self fetchEvents]; + } + else + { + NSLog(@"Access not granted: %@", error); + } + }]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (void)viewWillAppear:(BOOL)animated +{ + [self refresh:self]; + [super viewWillAppear:animated]; +} + +- (void)refresh:(id)sender +{ + [self fetchEvents]; + [self.eventsTableView reloadData]; +} + +- (void)fetchEvents +{ + self.events = [[NSMutableDictionary alloc] initWithCapacity:[self.calendars count]]; + + NSDate *now = [NSDate date]; + + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSDateComponents *fortyEightHoursFromNowComponents = + [[NSDateComponents alloc] init]; + fortyEightHoursFromNowComponents.day = 2; // 48 hours forward + NSDate *fortyEightHoursFromNow = + [calendar dateByAddingComponents:fortyEightHoursFromNowComponents toDate:now + options:0]; + + for (EKCalendar *calendar in self.calendars) + { + NSPredicate *allEventsWithin48HoursPredicate = + [self.eventStore predicateForEventsWithStartDate:now + endDate:fortyEightHoursFromNow calendars:@[calendar]]; + NSArray *eventsInThisCalendar = + [self.eventStore eventsMatchingPredicate:allEventsWithin48HoursPredicate]; + if (eventsInThisCalendar != nil) + { + [self.events setObject:eventsInThisCalendar forKey:calendar.title]; + } + } + dispatch_async(dispatch_get_main_queue(),^{ + [self.eventsTableView reloadData]; + }); +} + +- (EKCalendar *)calendarAtSection:(NSInteger)section +{ + return [self.calendars objectAtIndex:section]; +} + +- (EKEvent *)eventAtIndexPath:(NSIndexPath *)indexPath +{ + EKCalendar *calendar = [self calendarAtSection:indexPath.section]; + NSArray *calendarEvents = [self eventsForCalendar:calendar]; + return [calendarEvents objectAtIndex:indexPath.row]; +} + +- (NSArray *)eventsForCalendar:(EKCalendar *)calendar +{ + return [self.events objectForKey:calendar.title]; +} + +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return [self.calendars count]; +} + +-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return [self calendarAtSection:section].title; +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + EKCalendar *calendar = [self calendarAtSection:section]; + return [self eventsForCalendar:calendar].count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = + [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 + reuseIdentifier:CellIdentifier]; + } + + cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; + cell.textLabel.backgroundColor = [UIColor clearColor]; + cell.textLabel.font = [UIFont systemFontOfSize:19.0]; + + cell.textLabel.text = [self eventAtIndexPath:indexPath].title; + + return cell; +} + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + EKEventViewController *eventVC = [[EKEventViewController alloc] init]; + eventVC.event = [self eventAtIndexPath:indexPath]; + eventVC.allowsEditing = YES; + [self.navigationController pushViewController:eventVC animated:YES]; + [tableView deselectRowAtIndexPath:indexPath animated:YES]; +} + +-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath +{ + EKEventEditViewController *eventEditVC = [[EKEventEditViewController alloc] init]; + eventEditVC.event = [self eventAtIndexPath:indexPath]; + eventEditVC.eventStore = self.eventStore; + eventEditVC.editViewDelegate = self; + [self presentViewController:eventEditVC animated:YES completion:nil]; +} +-(void)eventEditViewController:(EKEventEditViewController *)controller didCompleteWithAction:(EKEventEditViewAction)action +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} +-(EKCalendar *)eventEditViewControllerDefaultCalendarForNewEvents: +(EKEventEditViewController *)controller +{ + return [self.eventStore defaultCalendarForNewEvents]; +} + + + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/main.m b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/main.m new file mode 100644 index 0000000..ecda9ed --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar Events/main.m @@ -0,0 +1,18 @@ +// +// main.m +// 14-2 Fetching Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/14-3 Displaying Events in a Table ViewTests-Info.plist b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/14-3 Displaying Events in a Table ViewTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/14-3 Displaying Events in a Table ViewTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m new file mode 100644 index 0000000..4b2faba --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m @@ -0,0 +1,34 @@ +// +// _4_2_Fetching_Calendar_EventsTests.m +// 14-2 Fetching Calendar EventsTests +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface _4_2_Fetching_Calendar_EventsTests : XCTestCase + +@end + +@implementation _4_2_Fetching_Calendar_EventsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.pbxproj b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ab4f9e1 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8811316517D117E500021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316417D117E500021032 /* Foundation.framework */; }; + 8811316717D117E500021032 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316617D117E500021032 /* CoreGraphics.framework */; }; + 8811316917D117E500021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316817D117E500021032 /* UIKit.framework */; }; + 8811316F17D117E500021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8811316D17D117E500021032 /* InfoPlist.strings */; }; + 8811317117D117E500021032 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317017D117E500021032 /* main.m */; }; + 8811317517D117E500021032 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317417D117E500021032 /* AppDelegate.m */; }; + 8811317817D117E500021032 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8811317617D117E500021032 /* Main.storyboard */; }; + 8811317B17D117E500021032 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317A17D117E500021032 /* ViewController.m */; }; + 8811317D17D117E500021032 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8811317C17D117E500021032 /* Images.xcassets */; }; + 8811318417D117E500021032 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811318317D117E500021032 /* XCTest.framework */; }; + 8811318517D117E500021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316417D117E500021032 /* Foundation.framework */; }; + 8811318617D117E500021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316817D117E500021032 /* UIKit.framework */; }; + 8811318E17D117E500021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8811318C17D117E500021032 /* InfoPlist.strings */; }; + 8811319017D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */; }; + 8811319A17D1185B00021032 /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811319917D1185B00021032 /* EventKit.framework */; }; + 8811319C17D1476700021032 /* EventKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811319B17D1476700021032 /* EventKitUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8811318717D117E500021032 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8811315917D117E500021032 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8811316017D117E500021032; + remoteInfo = "14-2 Fetching Calendar Events"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8811316117D117E500021032 /* 14-3 Displaying Events in a Table View.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "14-3 Displaying Events in a Table View.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8811316417D117E500021032 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8811316617D117E500021032 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8811316817D117E500021032 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8811316C17D117E500021032 /* 14-3 Displaying Events in a Table View-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "14-3 Displaying Events in a Table View-Info.plist"; sourceTree = ""; }; + 8811316E17D117E500021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8811317017D117E500021032 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8811317217D117E500021032 /* 14-3 Displaying Events in a Table View-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "14-3 Displaying Events in a Table View-Prefix.pch"; sourceTree = ""; }; + 8811317317D117E500021032 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8811317417D117E500021032 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8811317717D117E500021032 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8811317917D117E500021032 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8811317A17D117E500021032 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8811317C17D117E500021032 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8811318217D117E500021032 /* 14-3 Displaying Events in a Table ViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "14-3 Displaying Events in a Table ViewTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8811318317D117E500021032 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8811318B17D117E500021032 /* 14-3 Displaying Events in a Table ViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "14-3 Displaying Events in a Table ViewTests-Info.plist"; sourceTree = ""; }; + 8811318D17D117E500021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _4_2_Fetching_Calendar_EventsTests.m; sourceTree = ""; }; + 8811319917D1185B00021032 /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; }; + 8811319B17D1476700021032 /* EventKitUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKitUI.framework; path = System/Library/Frameworks/EventKitUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8811315E17D117E500021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811319C17D1476700021032 /* EventKitUI.framework in Frameworks */, + 8811319A17D1185B00021032 /* EventKit.framework in Frameworks */, + 8811316717D117E500021032 /* CoreGraphics.framework in Frameworks */, + 8811316917D117E500021032 /* UIKit.framework in Frameworks */, + 8811316517D117E500021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811317F17D117E500021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811318417D117E500021032 /* XCTest.framework in Frameworks */, + 8811318617D117E500021032 /* UIKit.framework in Frameworks */, + 8811318517D117E500021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8811315817D117E500021032 = { + isa = PBXGroup; + children = ( + 8811316A17D117E500021032 /* 14-3 Displaying Events in a Table View */, + 8811318917D117E500021032 /* 14-3 Displaying Events in a Table View Tests */, + 8811316317D117E500021032 /* Frameworks */, + 8811316217D117E500021032 /* Products */, + ); + sourceTree = ""; + }; + 8811316217D117E500021032 /* Products */ = { + isa = PBXGroup; + children = ( + 8811316117D117E500021032 /* 14-3 Displaying Events in a Table View.app */, + 8811318217D117E500021032 /* 14-3 Displaying Events in a Table ViewTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8811316317D117E500021032 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8811319B17D1476700021032 /* EventKitUI.framework */, + 8811319917D1185B00021032 /* EventKit.framework */, + 8811316417D117E500021032 /* Foundation.framework */, + 8811316617D117E500021032 /* CoreGraphics.framework */, + 8811316817D117E500021032 /* UIKit.framework */, + 8811318317D117E500021032 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8811316A17D117E500021032 /* 14-3 Displaying Events in a Table View */ = { + isa = PBXGroup; + children = ( + 8811317317D117E500021032 /* AppDelegate.h */, + 8811317417D117E500021032 /* AppDelegate.m */, + 8811317617D117E500021032 /* Main.storyboard */, + 8811317917D117E500021032 /* ViewController.h */, + 8811317A17D117E500021032 /* ViewController.m */, + 8811317C17D117E500021032 /* Images.xcassets */, + 8811316B17D117E500021032 /* Supporting Files */, + ); + name = "14-3 Displaying Events in a Table View"; + path = "14-2 Fetching Calendar Events"; + sourceTree = ""; + }; + 8811316B17D117E500021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8811316C17D117E500021032 /* 14-3 Displaying Events in a Table View-Info.plist */, + 8811316D17D117E500021032 /* InfoPlist.strings */, + 8811317017D117E500021032 /* main.m */, + 8811317217D117E500021032 /* 14-3 Displaying Events in a Table View-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8811318917D117E500021032 /* 14-3 Displaying Events in a Table View Tests */ = { + isa = PBXGroup; + children = ( + 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */, + 8811318A17D117E500021032 /* Supporting Files */, + ); + name = "14-3 Displaying Events in a Table View Tests"; + path = "14-2 Fetching Calendar EventsTests"; + sourceTree = ""; + }; + 8811318A17D117E500021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8811318B17D117E500021032 /* 14-3 Displaying Events in a Table ViewTests-Info.plist */, + 8811318C17D117E500021032 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8811316017D117E500021032 /* 14-3 Displaying Events in a Table View */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8811319317D117E500021032 /* Build configuration list for PBXNativeTarget "14-3 Displaying Events in a Table View" */; + buildPhases = ( + 8811315D17D117E500021032 /* Sources */, + 8811315E17D117E500021032 /* Frameworks */, + 8811315F17D117E500021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "14-3 Displaying Events in a Table View"; + productName = "14-2 Fetching Calendar Events"; + productReference = 8811316117D117E500021032 /* 14-3 Displaying Events in a Table View.app */; + productType = "com.apple.product-type.application"; + }; + 8811318117D117E500021032 /* 14-3 Displaying Events in a Table ViewTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8811319617D117E500021032 /* Build configuration list for PBXNativeTarget "14-3 Displaying Events in a Table ViewTests" */; + buildPhases = ( + 8811317E17D117E500021032 /* Sources */, + 8811317F17D117E500021032 /* Frameworks */, + 8811318017D117E500021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8811318817D117E500021032 /* PBXTargetDependency */, + ); + name = "14-3 Displaying Events in a Table ViewTests"; + productName = "14-2 Fetching Calendar EventsTests"; + productReference = 8811318217D117E500021032 /* 14-3 Displaying Events in a Table ViewTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8811315917D117E500021032 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8811318117D117E500021032 = { + TestTargetID = 8811316017D117E500021032; + }; + }; + }; + buildConfigurationList = 8811315C17D117E500021032 /* Build configuration list for PBXProject "14-3 Displaying Events in a Table View" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8811315817D117E500021032; + productRefGroup = 8811316217D117E500021032 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8811316017D117E500021032 /* 14-3 Displaying Events in a Table View */, + 8811318117D117E500021032 /* 14-3 Displaying Events in a Table ViewTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8811315F17D117E500021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811317D17D117E500021032 /* Images.xcassets in Resources */, + 8811316F17D117E500021032 /* InfoPlist.strings in Resources */, + 8811317817D117E500021032 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811318017D117E500021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811318E17D117E500021032 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8811315D17D117E500021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811317B17D117E500021032 /* ViewController.m in Sources */, + 8811317517D117E500021032 /* AppDelegate.m in Sources */, + 8811317117D117E500021032 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811317E17D117E500021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811319017D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8811318817D117E500021032 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8811316017D117E500021032 /* 14-3 Displaying Events in a Table View */; + targetProxy = 8811318717D117E500021032 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8811316D17D117E500021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8811316E17D117E500021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8811317617D117E500021032 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8811317717D117E500021032 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8811318C17D117E500021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8811318D17D117E500021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8811319117D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8811319217D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8811319417D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Info.plist"; + PRODUCT_NAME = "14-3 Displaying Events in a Table View"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8811319517D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar Events/14-3 Displaying Events in a Table View-Info.plist"; + PRODUCT_NAME = "14-3 Displaying Events in a Table View"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8811319717D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/14-2 Fetching Calendar Events.app/14-2 Fetching Calendar Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "14-2 Fetching Calendar EventsTests/14-3 Displaying Events in a Table ViewTests-Info.plist"; + PRODUCT_NAME = "14-3 Displaying Events in a Table ViewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8811319817D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/14-2 Fetching Calendar Events.app/14-2 Fetching Calendar Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar EventsTests/14-3 Displaying Events in a Table ViewTests-Info.plist"; + PRODUCT_NAME = "14-3 Displaying Events in a Table ViewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8811315C17D117E500021032 /* Build configuration list for PBXProject "14-3 Displaying Events in a Table View" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319117D117E500021032 /* Debug */, + 8811319217D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8811319317D117E500021032 /* Build configuration list for PBXNativeTarget "14-3 Displaying Events in a Table View" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319417D117E500021032 /* Debug */, + 8811319517D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8811319617D117E500021032 /* Build configuration list for PBXNativeTarget "14-3 Displaying Events in a Table ViewTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319717D117E500021032 /* Debug */, + 8811319817D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8811315917D117E500021032 /* Project object */; +} diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ccaff29 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0ee5efa Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6f7509a --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-3 Displaying Evenets in a Table View/14-3 Displaying Events in a Table View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + 14-3 Displaying Events in a Table View.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8811316017D117E500021032 + + primary + + + 8811318117D117E500021032 + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/.DS_Store b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/.DS_Store new file mode 100644 index 0000000..2270812 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/.DS_Store differ diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/AppDelegate.h b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/AppDelegate.h new file mode 100644 index 0000000..4776846 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 14-4 Creating Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/AppDelegate.m b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/AppDelegate.m new file mode 100644 index 0000000..5dce3b6 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 14-4 Creating Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard new file mode 100644 index 0000000..4ddae78 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Base.lproj/Main.storyboard @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Info.plist b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Info.plist new file mode 100644 index 0000000..bae3d83 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Info.plist @@ -0,0 +1,42 @@ + + + + + NSCalendarsUsageDescription + Testing Calendar Events + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Prefix.pch b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/ViewController.h b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/ViewController.h new file mode 100644 index 0000000..176660b --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/ViewController.h @@ -0,0 +1,20 @@ +// +// ViewController.h +// Recipe 14-4 Creating Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) EKEventStore *eventStore; +@property (weak, nonatomic) IBOutlet UITableView *eventsTableView; +@property (nonatomic, strong) NSMutableDictionary *events; +@property (nonatomic, strong) NSArray *calendars; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/ViewController.m b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/ViewController.m new file mode 100644 index 0000000..f73a84e --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/ViewController.m @@ -0,0 +1,237 @@ +// +// ViewController.m +// Recipe 14-4 Creating Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.title = @"Events"; + + UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self + action:@selector(refresh:)]; + self.navigationItem.leftBarButtonItem = refreshButton; + + UIBarButtonItem *addButton = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self + action:@selector(addEvent:)]; + self.navigationItem.rightBarButtonItem = addButton; + + self.eventsTableView.delegate = self; + self.eventsTableView.dataSource = self; + + self.eventStore = [[EKEventStore alloc] init]; + + [self.eventStore requestAccessToEntityType:EKEntityTypeEvent + completion:^(BOOL granted, NSError *error) + { + if (granted) + { + self.calendars = + [self.eventStore calendarsForEntityType:EKEntityTypeEvent]; + [self fetchEvents]; + } + else + { + NSLog(@"Access not granted: %@", error); + } + }]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (void)viewWillAppear:(BOOL)animated +{ + [self refresh:self]; + [super viewWillAppear:animated]; +} + +- (void)refresh:(id)sender +{ + [self fetchEvents]; + [self.eventsTableView reloadData]; +} + +- (void)fetchEvents +{ + self.events = [[NSMutableDictionary alloc] initWithCapacity:[self.calendars count]]; + + NSDate *now = [NSDate date]; + + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSDateComponents *fortyEightHoursFromNowComponents = + [[NSDateComponents alloc] init]; + fortyEightHoursFromNowComponents.day = 2; // 48 hours forward + NSDate *fortyEightHoursFromNow = + [calendar dateByAddingComponents:fortyEightHoursFromNowComponents toDate:now + options:0]; + + for (EKCalendar *calendar in self.calendars) + { + NSPredicate *allEventsWithin48HoursPredicate = + [self.eventStore predicateForEventsWithStartDate:now + endDate:fortyEightHoursFromNow calendars:@[calendar]]; + NSArray *eventsInThisCalendar = + [self.eventStore eventsMatchingPredicate:allEventsWithin48HoursPredicate]; + if (eventsInThisCalendar != nil) + { + [self.events setObject:eventsInThisCalendar forKey:calendar.title]; + } + } + dispatch_async(dispatch_get_main_queue(),^{ + [self.eventsTableView reloadData]; + }); +} + +- (EKCalendar *)calendarAtSection:(NSInteger)section +{ + return [self.calendars objectAtIndex:section]; +} + +- (EKEvent *)eventAtIndexPath:(NSIndexPath *)indexPath +{ + EKCalendar *calendar = [self calendarAtSection:indexPath.section]; + NSArray *calendarEvents = [self eventsForCalendar:calendar]; + return [calendarEvents objectAtIndex:indexPath.row]; +} + +- (NSArray *)eventsForCalendar:(EKCalendar *)calendar +{ + return [self.events objectForKey:calendar.title]; +} + +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return [self.calendars count]; +} + +-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return [self calendarAtSection:section].title; +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + EKCalendar *calendar = [self calendarAtSection:section]; + return [self eventsForCalendar:calendar].count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = + [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 + reuseIdentifier:CellIdentifier]; + } + + cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; + cell.textLabel.backgroundColor = [UIColor clearColor]; + cell.textLabel.font = [UIFont systemFontOfSize:19.0]; + + cell.textLabel.text = [self eventAtIndexPath:indexPath].title; + + return cell; +} + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + EKEventViewController *eventVC = [[EKEventViewController alloc] init]; + eventVC.event = [self eventAtIndexPath:indexPath]; + eventVC.allowsEditing = YES; + [self.navigationController pushViewController:eventVC animated:YES]; + [tableView deselectRowAtIndexPath:indexPath animated:YES]; +} + +-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath +{ + EKEventEditViewController *eventEditVC = [[EKEventEditViewController alloc] init]; + eventEditVC.event = [self eventAtIndexPath:indexPath]; + eventEditVC.eventStore = self.eventStore; + eventEditVC.editViewDelegate = self; + [self presentViewController:eventEditVC animated:YES completion:nil]; +} +-(void)eventEditViewController:(EKEventEditViewController *)controller didCompleteWithAction:(EKEventEditViewAction)action +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} +-(EKCalendar *)eventEditViewControllerDefaultCalendarForNewEvents: +(EKEventEditViewController *)controller +{ + return [self.eventStore defaultCalendarForNewEvents]; +} + +- (void)addEvent:(id)sender +{ + UIAlertView * inputAlert = [[UIAlertView alloc] initWithTitle:@"New Event" + message:@"Enter a title for the event" delegate:self cancelButtonTitle:@"Cancel" + otherButtonTitles:@"OK", nil]; + inputAlert.alertViewStyle = UIAlertViewStylePlainTextInput; + [inputAlert show]; +} + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex == 1) + { + // OK button tapped + + // Calculate the date exactly one day from now + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSDateComponents *aDayFromNowComponents = [[NSDateComponents alloc] init]; + aDayFromNowComponents.day = 1; + NSDate *now = [NSDate date]; + NSDate *aDayFromNow = [calendar dateByAddingComponents:aDayFromNowComponents + toDate:now options:0]; + + // Create the event + EKEvent *event = [EKEvent eventWithEventStore:self.eventStore]; + event.title = [alertView textFieldAtIndex:0].text; + event.calendar = [self.eventStore defaultCalendarForNewEvents]; + event.startDate = aDayFromNow; + event.endDate = [NSDate dateWithTimeInterval:60*60.0 sinceDate:event.startDate]; + + // Make it recur + EKRecurrenceRule *repeatEverySecondWednesdayRecurrenceRule = + [[EKRecurrenceRule alloc] initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily + interval:2 + daysOfTheWeek:@[[EKRecurrenceDayOfWeek dayOfWeek:4]] + daysOfTheMonth:nil + monthsOfTheYear:nil + weeksOfTheYear:nil + daysOfTheYear:nil + setPositions:nil + end:[EKRecurrenceEnd recurrenceEndWithOccurrenceCount:20]]; + + event.recurrenceRules = @[repeatEverySecondWednesdayRecurrenceRule]; + + + // Save the event and update the table view + [self.eventStore saveEvent:event span:EKSpanThisEvent error:nil]; + [self refresh:self]; + } +} + + + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/main.m b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/main.m new file mode 100644 index 0000000..ecda9ed --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar Events/main.m @@ -0,0 +1,18 @@ +// +// main.m +// 14-2 Fetching Calendar Events +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/Recipe 14-4 Creating Calendar EventsTests-Info.plist b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/Recipe 14-4 Creating Calendar EventsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/Recipe 14-4 Creating Calendar EventsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m new file mode 100644 index 0000000..4b2faba --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/_4_2_Fetching_Calendar_EventsTests.m @@ -0,0 +1,34 @@ +// +// _4_2_Fetching_Calendar_EventsTests.m +// 14-2 Fetching Calendar EventsTests +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface _4_2_Fetching_Calendar_EventsTests : XCTestCase + +@end + +@implementation _4_2_Fetching_Calendar_EventsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/14-2 Fetching Calendar EventsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.pbxproj b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3b1fd17 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8811316517D117E500021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316417D117E500021032 /* Foundation.framework */; }; + 8811316717D117E500021032 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316617D117E500021032 /* CoreGraphics.framework */; }; + 8811316917D117E500021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316817D117E500021032 /* UIKit.framework */; }; + 8811316F17D117E500021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8811316D17D117E500021032 /* InfoPlist.strings */; }; + 8811317117D117E500021032 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317017D117E500021032 /* main.m */; }; + 8811317517D117E500021032 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317417D117E500021032 /* AppDelegate.m */; }; + 8811317817D117E500021032 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8811317617D117E500021032 /* Main.storyboard */; }; + 8811317B17D117E500021032 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811317A17D117E500021032 /* ViewController.m */; }; + 8811317D17D117E500021032 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8811317C17D117E500021032 /* Images.xcassets */; }; + 8811318417D117E500021032 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811318317D117E500021032 /* XCTest.framework */; }; + 8811318517D117E500021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316417D117E500021032 /* Foundation.framework */; }; + 8811318617D117E500021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811316817D117E500021032 /* UIKit.framework */; }; + 8811318E17D117E500021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8811318C17D117E500021032 /* InfoPlist.strings */; }; + 8811319017D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */; }; + 8811319A17D1185B00021032 /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811319917D1185B00021032 /* EventKit.framework */; }; + 8811319C17D1476700021032 /* EventKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8811319B17D1476700021032 /* EventKitUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8811318717D117E500021032 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8811315917D117E500021032 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8811316017D117E500021032; + remoteInfo = "14-2 Fetching Calendar Events"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8811316117D117E500021032 /* Recipe 14-4 Creating Calendar Events.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 14-4 Creating Calendar Events.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8811316417D117E500021032 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8811316617D117E500021032 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8811316817D117E500021032 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8811316C17D117E500021032 /* Recipe 14-4 Creating Calendar Events-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-4 Creating Calendar Events-Info.plist"; sourceTree = ""; }; + 8811316E17D117E500021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8811317017D117E500021032 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8811317217D117E500021032 /* Recipe 14-4 Creating Calendar Events-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 14-4 Creating Calendar Events-Prefix.pch"; sourceTree = ""; }; + 8811317317D117E500021032 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8811317417D117E500021032 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8811317717D117E500021032 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8811317917D117E500021032 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8811317A17D117E500021032 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8811317C17D117E500021032 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8811318217D117E500021032 /* Recipe 14-4 Creating Calendar EventsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 14-4 Creating Calendar EventsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8811318317D117E500021032 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8811318B17D117E500021032 /* Recipe 14-4 Creating Calendar EventsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-4 Creating Calendar EventsTests-Info.plist"; sourceTree = ""; }; + 8811318D17D117E500021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _4_2_Fetching_Calendar_EventsTests.m; sourceTree = ""; }; + 8811319917D1185B00021032 /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; }; + 8811319B17D1476700021032 /* EventKitUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKitUI.framework; path = System/Library/Frameworks/EventKitUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8811315E17D117E500021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811319C17D1476700021032 /* EventKitUI.framework in Frameworks */, + 8811319A17D1185B00021032 /* EventKit.framework in Frameworks */, + 8811316717D117E500021032 /* CoreGraphics.framework in Frameworks */, + 8811316917D117E500021032 /* UIKit.framework in Frameworks */, + 8811316517D117E500021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811317F17D117E500021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811318417D117E500021032 /* XCTest.framework in Frameworks */, + 8811318617D117E500021032 /* UIKit.framework in Frameworks */, + 8811318517D117E500021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8811315817D117E500021032 = { + isa = PBXGroup; + children = ( + 8811316A17D117E500021032 /* Recipe 14-4 Creating Calendar Events */, + 8811318917D117E500021032 /* Recipe 14-4 Creating Calendar Events Tests */, + 8811316317D117E500021032 /* Frameworks */, + 8811316217D117E500021032 /* Products */, + ); + sourceTree = ""; + }; + 8811316217D117E500021032 /* Products */ = { + isa = PBXGroup; + children = ( + 8811316117D117E500021032 /* Recipe 14-4 Creating Calendar Events.app */, + 8811318217D117E500021032 /* Recipe 14-4 Creating Calendar EventsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8811316317D117E500021032 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8811319B17D1476700021032 /* EventKitUI.framework */, + 8811319917D1185B00021032 /* EventKit.framework */, + 8811316417D117E500021032 /* Foundation.framework */, + 8811316617D117E500021032 /* CoreGraphics.framework */, + 8811316817D117E500021032 /* UIKit.framework */, + 8811318317D117E500021032 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8811316A17D117E500021032 /* Recipe 14-4 Creating Calendar Events */ = { + isa = PBXGroup; + children = ( + 8811317317D117E500021032 /* AppDelegate.h */, + 8811317417D117E500021032 /* AppDelegate.m */, + 8811317617D117E500021032 /* Main.storyboard */, + 8811317917D117E500021032 /* ViewController.h */, + 8811317A17D117E500021032 /* ViewController.m */, + 8811317C17D117E500021032 /* Images.xcassets */, + 8811316B17D117E500021032 /* Supporting Files */, + ); + name = "Recipe 14-4 Creating Calendar Events"; + path = "14-2 Fetching Calendar Events"; + sourceTree = ""; + }; + 8811316B17D117E500021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8811316C17D117E500021032 /* Recipe 14-4 Creating Calendar Events-Info.plist */, + 8811316D17D117E500021032 /* InfoPlist.strings */, + 8811317017D117E500021032 /* main.m */, + 8811317217D117E500021032 /* Recipe 14-4 Creating Calendar Events-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8811318917D117E500021032 /* Recipe 14-4 Creating Calendar Events Tests */ = { + isa = PBXGroup; + children = ( + 8811318F17D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m */, + 8811318A17D117E500021032 /* Supporting Files */, + ); + name = "Recipe 14-4 Creating Calendar Events Tests"; + path = "14-2 Fetching Calendar EventsTests"; + sourceTree = ""; + }; + 8811318A17D117E500021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8811318B17D117E500021032 /* Recipe 14-4 Creating Calendar EventsTests-Info.plist */, + 8811318C17D117E500021032 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8811316017D117E500021032 /* Recipe 14-4 Creating Calendar Events */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8811319317D117E500021032 /* Build configuration list for PBXNativeTarget "Recipe 14-4 Creating Calendar Events" */; + buildPhases = ( + 8811315D17D117E500021032 /* Sources */, + 8811315E17D117E500021032 /* Frameworks */, + 8811315F17D117E500021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 14-4 Creating Calendar Events"; + productName = "14-2 Fetching Calendar Events"; + productReference = 8811316117D117E500021032 /* Recipe 14-4 Creating Calendar Events.app */; + productType = "com.apple.product-type.application"; + }; + 8811318117D117E500021032 /* Recipe 14-4 Creating Calendar EventsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8811319617D117E500021032 /* Build configuration list for PBXNativeTarget "Recipe 14-4 Creating Calendar EventsTests" */; + buildPhases = ( + 8811317E17D117E500021032 /* Sources */, + 8811317F17D117E500021032 /* Frameworks */, + 8811318017D117E500021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8811318817D117E500021032 /* PBXTargetDependency */, + ); + name = "Recipe 14-4 Creating Calendar EventsTests"; + productName = "14-2 Fetching Calendar EventsTests"; + productReference = 8811318217D117E500021032 /* Recipe 14-4 Creating Calendar EventsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8811315917D117E500021032 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8811318117D117E500021032 = { + TestTargetID = 8811316017D117E500021032; + }; + }; + }; + buildConfigurationList = 8811315C17D117E500021032 /* Build configuration list for PBXProject "Recipe 14-4 Creating Calendar Events" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8811315817D117E500021032; + productRefGroup = 8811316217D117E500021032 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8811316017D117E500021032 /* Recipe 14-4 Creating Calendar Events */, + 8811318117D117E500021032 /* Recipe 14-4 Creating Calendar EventsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8811315F17D117E500021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811317D17D117E500021032 /* Images.xcassets in Resources */, + 8811316F17D117E500021032 /* InfoPlist.strings in Resources */, + 8811317817D117E500021032 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811318017D117E500021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811318E17D117E500021032 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8811315D17D117E500021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811317B17D117E500021032 /* ViewController.m in Sources */, + 8811317517D117E500021032 /* AppDelegate.m in Sources */, + 8811317117D117E500021032 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8811317E17D117E500021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8811319017D117E500021032 /* _4_2_Fetching_Calendar_EventsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8811318817D117E500021032 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8811316017D117E500021032 /* Recipe 14-4 Creating Calendar Events */; + targetProxy = 8811318717D117E500021032 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8811316D17D117E500021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8811316E17D117E500021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8811317617D117E500021032 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8811317717D117E500021032 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8811318C17D117E500021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8811318D17D117E500021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8811319117D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8811319217D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8811319417D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Info.plist"; + PRODUCT_NAME = "Recipe 14-4 Creating Calendar Events"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8811319517D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar Events/Recipe 14-4 Creating Calendar Events-Info.plist"; + PRODUCT_NAME = "Recipe 14-4 Creating Calendar Events"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8811319717D117E500021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/14-2 Fetching Calendar Events.app/14-2 Fetching Calendar Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "14-2 Fetching Calendar EventsTests/Recipe 14-4 Creating Calendar EventsTests-Info.plist"; + PRODUCT_NAME = "Recipe 14-4 Creating Calendar EventsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8811319817D117E500021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/14-2 Fetching Calendar Events.app/14-2 Fetching Calendar Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "14-2 Fetching Calendar Events/14-2 Fetching Calendar Events-Prefix.pch"; + INFOPLIST_FILE = "14-2 Fetching Calendar EventsTests/Recipe 14-4 Creating Calendar EventsTests-Info.plist"; + PRODUCT_NAME = "Recipe 14-4 Creating Calendar EventsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8811315C17D117E500021032 /* Build configuration list for PBXProject "Recipe 14-4 Creating Calendar Events" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319117D117E500021032 /* Debug */, + 8811319217D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8811319317D117E500021032 /* Build configuration list for PBXNativeTarget "Recipe 14-4 Creating Calendar Events" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319417D117E500021032 /* Debug */, + 8811319517D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8811319617D117E500021032 /* Build configuration list for PBXNativeTarget "Recipe 14-4 Creating Calendar EventsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8811319717D117E500021032 /* Debug */, + 8811319817D117E500021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8811315917D117E500021032 /* Project object */; +} diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ce14c29 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2a95a38 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-4 Creating Calendar Events.xcscheme b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-4 Creating Calendar Events.xcscheme new file mode 100644 index 0000000..e736103 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-4 Creating Calendar Events.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..b640a2d --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-4 Creating Calendar Events/Recipe 14-4 Creating Calendar Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 14-4 Creating Calendar Events.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8811316017D117E500021032 + + primary + + + 8811318117D117E500021032 + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/.DS_Store b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/.DS_Store new file mode 100644 index 0000000..dfdf1a0 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/.DS_Store differ diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.pbxproj b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7d498a6 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 881131AA17D1505E00021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131A917D1505E00021032 /* Foundation.framework */; }; + 881131AC17D1505E00021032 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131AB17D1505E00021032 /* CoreGraphics.framework */; }; + 881131AE17D1505E00021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131AD17D1505E00021032 /* UIKit.framework */; }; + 881131B417D1505E00021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881131B217D1505E00021032 /* InfoPlist.strings */; }; + 881131B617D1505E00021032 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 881131B517D1505E00021032 /* main.m */; }; + 881131BA17D1505E00021032 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 881131B917D1505E00021032 /* AppDelegate.m */; }; + 881131BD17D1505E00021032 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881131BB17D1505E00021032 /* Main.storyboard */; }; + 881131C017D1505E00021032 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881131BF17D1505E00021032 /* ViewController.m */; }; + 881131C217D1505E00021032 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 881131C117D1505E00021032 /* Images.xcassets */; }; + 881131C917D1505E00021032 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131C817D1505E00021032 /* XCTest.framework */; }; + 881131CA17D1505E00021032 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131A917D1505E00021032 /* Foundation.framework */; }; + 881131CB17D1505E00021032 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131AD17D1505E00021032 /* UIKit.framework */; }; + 881131D317D1505E00021032 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881131D117D1505E00021032 /* InfoPlist.strings */; }; + 881131D517D1505E00021032 /* Recipe_14_6_Creating_RemindersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 881131D417D1505E00021032 /* Recipe_14_6_Creating_RemindersTests.m */; }; + 881131DF17D1507500021032 /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131DE17D1507500021032 /* EventKit.framework */; }; + 881131E117D1509A00021032 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881131E017D1509A00021032 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 881131CC17D1505E00021032 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8811319E17D1505E00021032 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 881131A517D1505E00021032; + remoteInfo = "Recipe 14-6 Creating Reminders"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 881131A617D1505E00021032 /* Recipe 14-6 Creating Reminders.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 14-6 Creating Reminders.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881131A917D1505E00021032 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 881131AB17D1505E00021032 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 881131AD17D1505E00021032 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 881131B117D1505E00021032 /* Recipe 14-6 Creating Reminders-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-6 Creating Reminders-Info.plist"; sourceTree = ""; }; + 881131B317D1505E00021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881131B517D1505E00021032 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 881131B717D1505E00021032 /* Recipe 14-6 Creating Reminders-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 14-6 Creating Reminders-Prefix.pch"; sourceTree = ""; }; + 881131B817D1505E00021032 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 881131B917D1505E00021032 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 881131BC17D1505E00021032 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 881131BE17D1505E00021032 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 881131BF17D1505E00021032 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 881131C117D1505E00021032 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 881131C717D1505E00021032 /* Recipe 14-6 Creating RemindersTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 14-6 Creating RemindersTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881131C817D1505E00021032 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 881131D017D1505E00021032 /* Recipe 14-6 Creating RemindersTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-6 Creating RemindersTests-Info.plist"; sourceTree = ""; }; + 881131D217D1505E00021032 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881131D417D1505E00021032 /* Recipe_14_6_Creating_RemindersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_14_6_Creating_RemindersTests.m; sourceTree = ""; }; + 881131DE17D1507500021032 /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; }; + 881131E017D1509A00021032 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 881131A317D1505E00021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881131E117D1509A00021032 /* CoreLocation.framework in Frameworks */, + 881131DF17D1507500021032 /* EventKit.framework in Frameworks */, + 881131AC17D1505E00021032 /* CoreGraphics.framework in Frameworks */, + 881131AE17D1505E00021032 /* UIKit.framework in Frameworks */, + 881131AA17D1505E00021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881131C417D1505E00021032 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881131C917D1505E00021032 /* XCTest.framework in Frameworks */, + 881131CB17D1505E00021032 /* UIKit.framework in Frameworks */, + 881131CA17D1505E00021032 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8811319D17D1505E00021032 = { + isa = PBXGroup; + children = ( + 881131AF17D1505E00021032 /* Recipe 14-6 Creating Reminders */, + 881131CE17D1505E00021032 /* Recipe 14-6 Creating RemindersTests */, + 881131A817D1505E00021032 /* Frameworks */, + 881131A717D1505E00021032 /* Products */, + ); + sourceTree = ""; + }; + 881131A717D1505E00021032 /* Products */ = { + isa = PBXGroup; + children = ( + 881131A617D1505E00021032 /* Recipe 14-6 Creating Reminders.app */, + 881131C717D1505E00021032 /* Recipe 14-6 Creating RemindersTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 881131A817D1505E00021032 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 881131E017D1509A00021032 /* CoreLocation.framework */, + 881131DE17D1507500021032 /* EventKit.framework */, + 881131A917D1505E00021032 /* Foundation.framework */, + 881131AB17D1505E00021032 /* CoreGraphics.framework */, + 881131AD17D1505E00021032 /* UIKit.framework */, + 881131C817D1505E00021032 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 881131AF17D1505E00021032 /* Recipe 14-6 Creating Reminders */ = { + isa = PBXGroup; + children = ( + 881131B817D1505E00021032 /* AppDelegate.h */, + 881131B917D1505E00021032 /* AppDelegate.m */, + 881131BB17D1505E00021032 /* Main.storyboard */, + 881131BE17D1505E00021032 /* ViewController.h */, + 881131BF17D1505E00021032 /* ViewController.m */, + 881131C117D1505E00021032 /* Images.xcassets */, + 881131B017D1505E00021032 /* Supporting Files */, + ); + path = "Recipe 14-6 Creating Reminders"; + sourceTree = ""; + }; + 881131B017D1505E00021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881131B117D1505E00021032 /* Recipe 14-6 Creating Reminders-Info.plist */, + 881131B217D1505E00021032 /* InfoPlist.strings */, + 881131B517D1505E00021032 /* main.m */, + 881131B717D1505E00021032 /* Recipe 14-6 Creating Reminders-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 881131CE17D1505E00021032 /* Recipe 14-6 Creating RemindersTests */ = { + isa = PBXGroup; + children = ( + 881131D417D1505E00021032 /* Recipe_14_6_Creating_RemindersTests.m */, + 881131CF17D1505E00021032 /* Supporting Files */, + ); + path = "Recipe 14-6 Creating RemindersTests"; + sourceTree = ""; + }; + 881131CF17D1505E00021032 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881131D017D1505E00021032 /* Recipe 14-6 Creating RemindersTests-Info.plist */, + 881131D117D1505E00021032 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 881131A517D1505E00021032 /* Recipe 14-6 Creating Reminders */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881131D817D1505E00021032 /* Build configuration list for PBXNativeTarget "Recipe 14-6 Creating Reminders" */; + buildPhases = ( + 881131A217D1505E00021032 /* Sources */, + 881131A317D1505E00021032 /* Frameworks */, + 881131A417D1505E00021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 14-6 Creating Reminders"; + productName = "Recipe 14-6 Creating Reminders"; + productReference = 881131A617D1505E00021032 /* Recipe 14-6 Creating Reminders.app */; + productType = "com.apple.product-type.application"; + }; + 881131C617D1505E00021032 /* Recipe 14-6 Creating RemindersTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881131DB17D1505E00021032 /* Build configuration list for PBXNativeTarget "Recipe 14-6 Creating RemindersTests" */; + buildPhases = ( + 881131C317D1505E00021032 /* Sources */, + 881131C417D1505E00021032 /* Frameworks */, + 881131C517D1505E00021032 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 881131CD17D1505E00021032 /* PBXTargetDependency */, + ); + name = "Recipe 14-6 Creating RemindersTests"; + productName = "Recipe 14-6 Creating RemindersTests"; + productReference = 881131C717D1505E00021032 /* Recipe 14-6 Creating RemindersTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8811319E17D1505E00021032 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 881131C617D1505E00021032 = { + TestTargetID = 881131A517D1505E00021032; + }; + }; + }; + buildConfigurationList = 881131A117D1505E00021032 /* Build configuration list for PBXProject "Recipe 14-6 Creating Reminders" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8811319D17D1505E00021032; + productRefGroup = 881131A717D1505E00021032 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 881131A517D1505E00021032 /* Recipe 14-6 Creating Reminders */, + 881131C617D1505E00021032 /* Recipe 14-6 Creating RemindersTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 881131A417D1505E00021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881131C217D1505E00021032 /* Images.xcassets in Resources */, + 881131B417D1505E00021032 /* InfoPlist.strings in Resources */, + 881131BD17D1505E00021032 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881131C517D1505E00021032 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881131D317D1505E00021032 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 881131A217D1505E00021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881131C017D1505E00021032 /* ViewController.m in Sources */, + 881131BA17D1505E00021032 /* AppDelegate.m in Sources */, + 881131B617D1505E00021032 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881131C317D1505E00021032 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881131D517D1505E00021032 /* Recipe_14_6_Creating_RemindersTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 881131CD17D1505E00021032 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 881131A517D1505E00021032 /* Recipe 14-6 Creating Reminders */; + targetProxy = 881131CC17D1505E00021032 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 881131B217D1505E00021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881131B317D1505E00021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 881131BB17D1505E00021032 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 881131BC17D1505E00021032 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 881131D117D1505E00021032 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881131D217D1505E00021032 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 881131D617D1505E00021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 881131D717D1505E00021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 881131D917D1505E00021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 881131DA17D1505E00021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 881131DC17D1505E00021032 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-6 Creating Reminders.app/Recipe 14-6 Creating Reminders"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 14-6 Creating RemindersTests/Recipe 14-6 Creating RemindersTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 881131DD17D1505E00021032 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-6 Creating Reminders.app/Recipe 14-6 Creating Reminders"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-6 Creating RemindersTests/Recipe 14-6 Creating RemindersTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 881131A117D1505E00021032 /* Build configuration list for PBXProject "Recipe 14-6 Creating Reminders" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881131D617D1505E00021032 /* Debug */, + 881131D717D1505E00021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881131D817D1505E00021032 /* Build configuration list for PBXNativeTarget "Recipe 14-6 Creating Reminders" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881131D917D1505E00021032 /* Debug */, + 881131DA17D1505E00021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 881131DB17D1505E00021032 /* Build configuration list for PBXNativeTarget "Recipe 14-6 Creating RemindersTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881131DC17D1505E00021032 /* Debug */, + 881131DD17D1505E00021032 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8811319E17D1505E00021032 /* Project object */; +} diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..7dd1a51 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0c00336 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-6 Creating Reminders.xcscheme b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-6 Creating Reminders.xcscheme new file mode 100644 index 0000000..1038497 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-6 Creating Reminders.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ea02ef2 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 14-6 Creating Reminders.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 881131A517D1505E00021032 + + primary + + + 881131C617D1505E00021032 + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/AppDelegate.h b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/AppDelegate.h new file mode 100644 index 0000000..de96018 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 14-6 Creating Reminders +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/AppDelegate.m b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/AppDelegate.m new file mode 100644 index 0000000..d06cdb8 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 14-6 Creating Reminders +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Base.lproj/Main.storyboard b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b69cb3e --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Base.lproj/Main.storyboard @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Images.xcassets/AppIcon.appiconset/Contents.json b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Info.plist b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Info.plist new file mode 100644 index 0000000..289c36b --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Info.plist @@ -0,0 +1,44 @@ + + + + + NSRemindersUsageDescription + Testing Reminders + NSLocationUsageDescription + Testing Location - Based Reminders + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Prefix.pch b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/ViewController.h b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/ViewController.h new file mode 100644 index 0000000..93b5120 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/ViewController.h @@ -0,0 +1,33 @@ +// +// ViewController.h +// Recipe 14-6 Creating Reminders +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +typedef void(^RestrictedEventStoreActionHandler)(); +typedef void(^RetrieveCurrentLocationHandler)(CLLocation *); + +@interface ViewController : UIViewController +{ +@private + CLLocationManager *_locationManager; + RetrieveCurrentLocationHandler _retrieveCurrentLocationBlock; + int _numberOfTries; +} + +@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; +@property (strong, nonatomic)EKEventStore *eventStore; + +- (IBAction)addTimeBasedReminder:(id)sender; +- (IBAction)addLocationBasedReminder:(id)sender; + +- (void)handleReminderAction:(RestrictedEventStoreActionHandler)block; +- (void)retrieveCurrentLocation:(RetrieveCurrentLocationHandler)block; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/ViewController.m b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/ViewController.m new file mode 100644 index 0000000..e91a044 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/ViewController.m @@ -0,0 +1,244 @@ +// +// ViewController.m +// Recipe 14-6 Creating Reminders +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - lazy initializers + +- (EKEventStore *)eventStore +{ + if (_eventStore == nil) + { + _eventStore = [[EKEventStore alloc] init]; + } + return _eventStore; +} + +- (IBAction)addTimeBasedReminder:(id)sender +{ + [self.activityIndicator startAnimating]; + + [self handleReminderAction:^() + { + // Create Reminder + EKReminder *newReminder = [EKReminder reminderWithEventStore:self.eventStore]; + newReminder.title = @"Simpsons is on"; + newReminder.calendar = [self.eventStore defaultCalendarForNewReminders]; + + // Calculate the date exactly one day from now + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSDateComponents *oneDayComponents = [[NSDateComponents alloc] init]; + oneDayComponents.day = 1; + NSDate *nextDay = [calendar dateByAddingComponents:oneDayComponents + toDate:[NSDate date] options:0]; + + NSUInteger unitFlags = NSEraCalendarUnit | NSYearCalendarUnit | + NSMonthCalendarUnit | NSDayCalendarUnit; + NSDateComponents *tomorrowAt6PMComponents = [calendar components:unitFlags + fromDate:nextDay]; + tomorrowAt6PMComponents.hour = 18; + tomorrowAt6PMComponents.minute = 0; + tomorrowAt6PMComponents.second = 0; + NSDate *nextDayAt6PM = [calendar dateFromComponents:tomorrowAt6PMComponents]; + + // Create an Alarm + EKAlarm *alarm = [EKAlarm alarmWithAbsoluteDate:nextDayAt6PM]; + [newReminder addAlarm:alarm]; + newReminder.dueDateComponents = tomorrowAt6PMComponents; + + // Save Reminder + NSString *alertTitle; + NSString *alertMessage; + NSString *alertButtonTitle; + NSError *error; + [self.eventStore saveReminder:newReminder commit:YES error:&error]; + if (error == nil) + { + alertTitle = @"Information"; + alertMessage = [NSString stringWithFormat:@"\"%@\" was added to Reminders", + newReminder.title]; + alertButtonTitle = @"OK"; + } + else + { + alertTitle = @"Error"; + alertMessage = [NSString stringWithFormat:@"Unable to save reminder: %@", + error]; + alertButtonTitle = @"Dismiss"; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:alertTitle + message:alertMessage delegate:nil cancelButtonTitle:alertButtonTitle + otherButtonTitles:nil]; + [alertView show]; + [self.activityIndicator stopAnimating]; + }); + + }]; + +} + +- (IBAction)addLocationBasedReminder:(id)sender +{ + [self.activityIndicator startAnimating]; + + [self retrieveCurrentLocation: + ^(CLLocation *currentLocation) + { + if (currentLocation != nil) + { + [self handleReminderAction:^() + { + // Create Reminder + EKReminder *newReminder = + [EKReminder reminderWithEventStore:self.eventStore]; + newReminder.title = @"Buy milk!"; + newReminder.calendar = + [self.eventStore defaultCalendarForNewReminders]; + + // Create Location-based Alarm + EKStructuredLocation *currentStructuredLocation = + [EKStructuredLocation locationWithTitle:@"Current Location"]; + currentStructuredLocation.geoLocation = currentLocation; + + EKAlarm *alarm = [[EKAlarm alloc] init]; + alarm.structuredLocation = currentStructuredLocation; + alarm.proximity = EKAlarmProximityLeave; + + [newReminder addAlarm:alarm]; + + // Save Reminder + NSString *alertTitle; + NSString *alertMessage; + NSString *alertButtonTitle; + NSError *error; + [self.eventStore saveReminder:newReminder commit:YES error:&error]; + if (error == nil) + { + alertTitle = @"Information"; + alertMessage = + [NSString stringWithFormat:@"\"%@\" was added to Reminders", + newReminder.title]; + alertButtonTitle = @"OK"; + } + else + { + alertTitle = @"Error"; + alertMessage = + [NSString stringWithFormat:@"Unable to save reminder: %@", + error]; + alertButtonTitle = @"Dismiss"; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + UIAlertView *alertView = + [[UIAlertView alloc]initWithTitle:alertTitle + message:alertMessage delegate:nil + cancelButtonTitle:alertButtonTitle otherButtonTitles:nil]; + [alertView show]; + [self.activityIndicator stopAnimating]; + }); + }]; + } + }]; +} + +#pragma mark - helper methods +- (void)handleReminderAction:(RestrictedEventStoreActionHandler)block +{ + [self.eventStore requestAccessToEntityType:EKEntityTypeReminder + completion:^(BOOL granted, NSError *error) + { + if (granted) + { + block(); + } + else + { + UIAlertView *notGrantedAlert = [[UIAlertView alloc] initWithTitle:@"Access Denied" + message:@"Access to device's reminders has been denied for this app." + delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [notGrantedAlert show]; + }); + } + }]; +} +- (void)retrieveCurrentLocation:(RetrieveCurrentLocationHandler)block +{ + if ([CLLocationManager locationServicesEnabled] == NO) + { + UIAlertView *locationServicesDisabledAlert = [[UIAlertView alloc] + initWithTitle:@"Location Services Disabled" message:@"This feature requires location services. Enable it in the privacy settings on your device" + delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; + [locationServicesDisabledAlert show]; + return; + } + + if (_locationManager == nil) + { + _locationManager = [[CLLocationManager alloc] init]; + _locationManager.desiredAccuracy = kCLLocationAccuracyBest; + _locationManager.distanceFilter = 1; // meter + _locationManager.activityType = CLActivityTypeOther; + _locationManager.delegate = self; + } + _numberOfTries = 0; + _retrieveCurrentLocationBlock = block; + [_locationManager startUpdatingLocation]; +} + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + // Make sure this is a recent location event + CLLocation *lastLocation = [locations lastObject]; + NSTimeInterval eventInterval = [lastLocation.timestamp timeIntervalSinceNow]; + if(abs(eventInterval) < 30.0) + { + // Make sure the event is accurate enough + if (lastLocation.horizontalAccuracy >= 0 && + lastLocation.horizontalAccuracy < 20) + { + [_locationManager stopUpdatingLocation]; + _retrieveCurrentLocationBlock(lastLocation); + return; + } + } + if (_numberOfTries++ == 10) + { + [_locationManager stopUpdatingLocation]; + UIAlertView *unableToGetLocationAlert = + [[UIAlertView alloc]initWithTitle:@"Error" + message:@"Unable to get the current location." delegate:nil + cancelButtonTitle:@"Dismiss" otherButtonTitles: nil]; + [unableToGetLocationAlert show]; + } +} + + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/main.m b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/main.m new file mode 100644 index 0000000..c82435d --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating Reminders/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 14-6 Creating Reminders +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/Recipe 14-6 Creating RemindersTests-Info.plist b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/Recipe 14-6 Creating RemindersTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/Recipe 14-6 Creating RemindersTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/Recipe_14_6_Creating_RemindersTests.m b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/Recipe_14_6_Creating_RemindersTests.m new file mode 100644 index 0000000..58c9ee0 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/Recipe_14_6_Creating_RemindersTests.m @@ -0,0 +1,34 @@ +// +// Recipe_14_6_Creating_RemindersTests.m +// Recipe 14-6 Creating RemindersTests +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_14_6_Creating_RemindersTests : XCTestCase + +@end + +@implementation Recipe_14_6_Creating_RemindersTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-6 Creating Reminders/Recipe 14-6 Creating RemindersTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/.DS_Store b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/.DS_Store new file mode 100644 index 0000000..0204d8b Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/.DS_Store differ diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.pbxproj b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.pbxproj new file mode 100644 index 0000000..98dcbd9 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848DFE117D16D92007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848DFE017D16D92007110E0 /* Foundation.framework */; }; + 8848DFE317D16D92007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848DFE217D16D92007110E0 /* CoreGraphics.framework */; }; + 8848DFE517D16D92007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848DFE417D16D92007110E0 /* UIKit.framework */; }; + 8848DFEB17D16D92007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848DFE917D16D92007110E0 /* InfoPlist.strings */; }; + 8848DFED17D16D92007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848DFEC17D16D92007110E0 /* main.m */; }; + 8848DFF117D16D92007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848DFF017D16D92007110E0 /* AppDelegate.m */; }; + 8848DFF417D16D92007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848DFF217D16D92007110E0 /* Main.storyboard */; }; + 8848DFF717D16D92007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848DFF617D16D92007110E0 /* ViewController.m */; }; + 8848DFF917D16D92007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848DFF817D16D92007110E0 /* Images.xcassets */; }; + 8848E00017D16D92007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848DFFF17D16D92007110E0 /* XCTest.framework */; }; + 8848E00117D16D92007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848DFE017D16D92007110E0 /* Foundation.framework */; }; + 8848E00217D16D92007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848DFE417D16D92007110E0 /* UIKit.framework */; }; + 8848E00A17D16D92007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E00817D16D92007110E0 /* InfoPlist.strings */; }; + 8848E00C17D16D92007110E0 /* Recipe_14_7_Accessing_the_Address_BookTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E00B17D16D92007110E0 /* Recipe_14_7_Accessing_the_Address_BookTests.m */; }; + 8848E01617D16DC9007110E0 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E01517D16DC9007110E0 /* AddressBook.framework */; }; + 8848E01817D16DD2007110E0 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E01717D16DD2007110E0 /* AddressBookUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E00317D16D92007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848DFD517D16D92007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848DFDC17D16D92007110E0; + remoteInfo = "Recipe 14-7 Accessing the Address Book"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848DFDD17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 14-7 Accessing the Address Book.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848DFE017D16D92007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848DFE217D16D92007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848DFE417D16D92007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848DFE817D16D92007110E0 /* Recipe 14-7 Accessing the Address Book-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-7 Accessing the Address Book-Info.plist"; sourceTree = ""; }; + 8848DFEA17D16D92007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848DFEC17D16D92007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848DFEE17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 14-7 Accessing the Address Book-Prefix.pch"; sourceTree = ""; }; + 8848DFEF17D16D92007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848DFF017D16D92007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848DFF317D16D92007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848DFF517D16D92007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848DFF617D16D92007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848DFF817D16D92007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848DFFE17D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 14-7 Accessing the Address BookTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848DFFF17D16D92007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E00717D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-7 Accessing the Address BookTests-Info.plist"; sourceTree = ""; }; + 8848E00917D16D92007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E00B17D16D92007110E0 /* Recipe_14_7_Accessing_the_Address_BookTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_14_7_Accessing_the_Address_BookTests.m; sourceTree = ""; }; + 8848E01517D16DC9007110E0 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; + 8848E01717D16DD2007110E0 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848DFDA17D16D92007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E01817D16DD2007110E0 /* AddressBookUI.framework in Frameworks */, + 8848E01617D16DC9007110E0 /* AddressBook.framework in Frameworks */, + 8848DFE317D16D92007110E0 /* CoreGraphics.framework in Frameworks */, + 8848DFE517D16D92007110E0 /* UIKit.framework in Frameworks */, + 8848DFE117D16D92007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848DFFB17D16D92007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E00017D16D92007110E0 /* XCTest.framework in Frameworks */, + 8848E00217D16D92007110E0 /* UIKit.framework in Frameworks */, + 8848E00117D16D92007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848DFD417D16D92007110E0 = { + isa = PBXGroup; + children = ( + 8848DFE617D16D92007110E0 /* Recipe 14-7 Accessing the Address Book */, + 8848E00517D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests */, + 8848DFDF17D16D92007110E0 /* Frameworks */, + 8848DFDE17D16D92007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848DFDE17D16D92007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848DFDD17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book.app */, + 8848DFFE17D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848DFDF17D16D92007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E01717D16DD2007110E0 /* AddressBookUI.framework */, + 8848E01517D16DC9007110E0 /* AddressBook.framework */, + 8848DFE017D16D92007110E0 /* Foundation.framework */, + 8848DFE217D16D92007110E0 /* CoreGraphics.framework */, + 8848DFE417D16D92007110E0 /* UIKit.framework */, + 8848DFFF17D16D92007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848DFE617D16D92007110E0 /* Recipe 14-7 Accessing the Address Book */ = { + isa = PBXGroup; + children = ( + 8848DFEF17D16D92007110E0 /* AppDelegate.h */, + 8848DFF017D16D92007110E0 /* AppDelegate.m */, + 8848DFF217D16D92007110E0 /* Main.storyboard */, + 8848DFF517D16D92007110E0 /* ViewController.h */, + 8848DFF617D16D92007110E0 /* ViewController.m */, + 8848DFF817D16D92007110E0 /* Images.xcassets */, + 8848DFE717D16D92007110E0 /* Supporting Files */, + ); + path = "Recipe 14-7 Accessing the Address Book"; + sourceTree = ""; + }; + 8848DFE717D16D92007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848DFE817D16D92007110E0 /* Recipe 14-7 Accessing the Address Book-Info.plist */, + 8848DFE917D16D92007110E0 /* InfoPlist.strings */, + 8848DFEC17D16D92007110E0 /* main.m */, + 8848DFEE17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E00517D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests */ = { + isa = PBXGroup; + children = ( + 8848E00B17D16D92007110E0 /* Recipe_14_7_Accessing_the_Address_BookTests.m */, + 8848E00617D16D92007110E0 /* Supporting Files */, + ); + path = "Recipe 14-7 Accessing the Address BookTests"; + sourceTree = ""; + }; + 8848E00617D16D92007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E00717D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests-Info.plist */, + 8848E00817D16D92007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848DFDC17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E00F17D16D92007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-7 Accessing the Address Book" */; + buildPhases = ( + 8848DFD917D16D92007110E0 /* Sources */, + 8848DFDA17D16D92007110E0 /* Frameworks */, + 8848DFDB17D16D92007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 14-7 Accessing the Address Book"; + productName = "Recipe 14-7 Accessing the Address Book"; + productReference = 8848DFDD17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book.app */; + productType = "com.apple.product-type.application"; + }; + 8848DFFD17D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E01217D16D92007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-7 Accessing the Address BookTests" */; + buildPhases = ( + 8848DFFA17D16D92007110E0 /* Sources */, + 8848DFFB17D16D92007110E0 /* Frameworks */, + 8848DFFC17D16D92007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E00417D16D92007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 14-7 Accessing the Address BookTests"; + productName = "Recipe 14-7 Accessing the Address BookTests"; + productReference = 8848DFFE17D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848DFD517D16D92007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848DFFD17D16D92007110E0 = { + TestTargetID = 8848DFDC17D16D92007110E0; + }; + }; + }; + buildConfigurationList = 8848DFD817D16D92007110E0 /* Build configuration list for PBXProject "Recipe 14-7 Accessing the Address Book" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848DFD417D16D92007110E0; + productRefGroup = 8848DFDE17D16D92007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848DFDC17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book */, + 8848DFFD17D16D92007110E0 /* Recipe 14-7 Accessing the Address BookTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848DFDB17D16D92007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848DFF917D16D92007110E0 /* Images.xcassets in Resources */, + 8848DFEB17D16D92007110E0 /* InfoPlist.strings in Resources */, + 8848DFF417D16D92007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848DFFC17D16D92007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E00A17D16D92007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848DFD917D16D92007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848DFF717D16D92007110E0 /* ViewController.m in Sources */, + 8848DFF117D16D92007110E0 /* AppDelegate.m in Sources */, + 8848DFED17D16D92007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848DFFA17D16D92007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E00C17D16D92007110E0 /* Recipe_14_7_Accessing_the_Address_BookTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E00417D16D92007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848DFDC17D16D92007110E0 /* Recipe 14-7 Accessing the Address Book */; + targetProxy = 8848E00317D16D92007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848DFE917D16D92007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848DFEA17D16D92007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848DFF217D16D92007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848DFF317D16D92007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E00817D16D92007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E00917D16D92007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E00D17D16D92007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E00E17D16D92007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E01017D16D92007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E01117D16D92007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E01317D16D92007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-7 Accessing the Address Book.app/Recipe 14-7 Accessing the Address Book"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 14-7 Accessing the Address BookTests/Recipe 14-7 Accessing the Address BookTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E01417D16D92007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-7 Accessing the Address Book.app/Recipe 14-7 Accessing the Address Book"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-7 Accessing the Address BookTests/Recipe 14-7 Accessing the Address BookTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848DFD817D16D92007110E0 /* Build configuration list for PBXProject "Recipe 14-7 Accessing the Address Book" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E00D17D16D92007110E0 /* Debug */, + 8848E00E17D16D92007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E00F17D16D92007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-7 Accessing the Address Book" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E01017D16D92007110E0 /* Debug */, + 8848E01117D16D92007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8848E01217D16D92007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-7 Accessing the Address BookTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E01317D16D92007110E0 /* Debug */, + 8848E01417D16D92007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848DFD517D16D92007110E0 /* Project object */; +} diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..af78601 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..50e308c Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-7 Accessing the Address Book.xcscheme b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-7 Accessing the Address Book.xcscheme new file mode 100644 index 0000000..5c4e8b7 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-7 Accessing the Address Book.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement (1).plist b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement (1).plist new file mode 100644 index 0000000..db8599d --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement (1).plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 14-7 Accessing the Address Book.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848DFDC17D16D92007110E0 + + primary + + + 8848DFFD17D16D92007110E0 + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..db8599d --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 14-7 Accessing the Address Book.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848DFDC17D16D92007110E0 + + primary + + + 8848DFFD17D16D92007110E0 + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/AppDelegate.h b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/AppDelegate.h new file mode 100644 index 0000000..646c7f2 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 14-7 Accessing the Address Book +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/AppDelegate.m b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/AppDelegate.m new file mode 100644 index 0000000..002f92c --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 14-7 Accessing the Address Book +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Base.lproj/Main.storyboard b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Base.lproj/Main.storyboard new file mode 100644 index 0000000..34990b1 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Base.lproj/Main.storyboard @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Images.xcassets/AppIcon.appiconset/Contents.json b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Info.plist b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Info.plist new file mode 100644 index 0000000..cb8e146 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Info.plist @@ -0,0 +1,42 @@ + + + + + NSCameraUsageDescription + Testing Address Book Access + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Prefix.pch b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/ViewController.h b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/ViewController.h new file mode 100644 index 0000000..c11a250 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Recipe 14-7 Accessing the Address Book +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *firstNameLabel; +@property (weak, nonatomic) IBOutlet UILabel *lastNameLabel; +@property (weak, nonatomic) IBOutlet UILabel *phoneNumberLabel; +@property (weak, nonatomic) IBOutlet UILabel *cityNameLabel; + +- (IBAction)pickContact:(id)sender; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/ViewController.m b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/ViewController.m new file mode 100644 index 0000000..7ca043f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/ViewController.m @@ -0,0 +1,85 @@ +// +// ViewController.m +// Recipe 14-7 Accessing the Address Book +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions +- (IBAction)pickContact:(id)sender +{ + ABPeoplePickerNavigationController *picker = + [[ABPeoplePickerNavigationController alloc] init]; + picker.peoplePickerDelegate = self; + [self presentViewController:picker animated:YES completion:nil]; +} + +#pragma mark - delegate methods + +-(BOOL)peoplePickerNavigationController: +(ABPeoplePickerNavigationController *)peoplePicker + shouldContinueAfterSelectingPerson:(ABRecordRef)person +{ + self.firstNameLabel.text = + (__bridge_transfer NSString *)ABRecordCopyValue(person, + kABPersonFirstNameProperty); + + self.lastNameLabel.text = + (__bridge_transfer NSString *)ABRecordCopyValue(person, + kABPersonLastNameProperty); + + ABMultiValueRef phoneRecord = ABRecordCopyValue(person, kABPersonPhoneProperty); + CFStringRef phoneNumber = ABMultiValueCopyValueAtIndex(phoneRecord, 0); + self.phoneNumberLabel.text = (__bridge_transfer NSString *)phoneNumber; + CFRelease(phoneRecord); + + ABMultiValueRef addressRecord = ABRecordCopyValue(person, kABPersonAddressProperty); + if (ABMultiValueGetCount(addressRecord) > 0) + { + CFDictionaryRef addressDictionary = + ABMultiValueCopyValueAtIndex(addressRecord, 0); + self.cityNameLabel.text = + [NSString stringWithString: + (__bridge NSString *)CFDictionaryGetValue(addressDictionary, + kABPersonAddressCityKey)]; + CFRelease(addressDictionary); + } + else + { + self.cityNameLabel.text = @"..."; + } + CFRelease(addressRecord); + + [self dismissViewControllerAnimated:YES completion:nil]; + return NO; +} + +-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier +{ + [self dismissViewControllerAnimated:YES completion:nil]; + return NO; +} + + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/main.m b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/main.m new file mode 100644 index 0000000..f178967 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address Book/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 14-7 Accessing the Address Book +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/Recipe 14-7 Accessing the Address BookTests-Info.plist b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/Recipe 14-7 Accessing the Address BookTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/Recipe 14-7 Accessing the Address BookTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/Recipe_14_7_Accessing_the_Address_BookTests.m b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/Recipe_14_7_Accessing_the_Address_BookTests.m new file mode 100644 index 0000000..665c177 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/Recipe_14_7_Accessing_the_Address_BookTests.m @@ -0,0 +1,34 @@ +// +// Recipe_14_7_Accessing_the_Address_BookTests.m +// Recipe 14-7 Accessing the Address BookTests +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_14_7_Accessing_the_Address_BookTests : XCTestCase + +@end + +@implementation Recipe_14_7_Accessing_the_Address_BookTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-7 Accessing the Address Book/Recipe 14-7 Accessing the Address BookTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/.DS_Store b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/.DS_Store new file mode 100644 index 0000000..6b1ee28 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/.DS_Store differ diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.pbxproj b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9eff5e5 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E02617D1721B007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E02517D1721B007110E0 /* Foundation.framework */; }; + 8848E02817D1721B007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E02717D1721B007110E0 /* CoreGraphics.framework */; }; + 8848E02A17D1721B007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E02917D1721B007110E0 /* UIKit.framework */; }; + 8848E03017D1721B007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E02E17D1721B007110E0 /* InfoPlist.strings */; }; + 8848E03217D1721B007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E03117D1721B007110E0 /* main.m */; }; + 8848E03617D1721B007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E03517D1721B007110E0 /* AppDelegate.m */; }; + 8848E03917D1721B007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E03717D1721B007110E0 /* Main.storyboard */; }; + 8848E03C17D1721B007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E03B17D1721B007110E0 /* ViewController.m */; }; + 8848E03E17D1721B007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E03D17D1721B007110E0 /* Images.xcassets */; }; + 8848E04517D1721B007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E04417D1721B007110E0 /* XCTest.framework */; }; + 8848E04617D1721B007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E02517D1721B007110E0 /* Foundation.framework */; }; + 8848E04717D1721B007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E02917D1721B007110E0 /* UIKit.framework */; }; + 8848E04F17D1721B007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E04D17D1721B007110E0 /* InfoPlist.strings */; }; + 8848E05117D1721B007110E0 /* Recipe_14_8_Setting_Contact_InformationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E05017D1721B007110E0 /* Recipe_14_8_Setting_Contact_InformationTests.m */; }; + 8848E05B17D17237007110E0 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E05A17D17237007110E0 /* AddressBook.framework */; }; + 8848E05D17D1723B007110E0 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E05C17D1723B007110E0 /* AddressBookUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E04817D1721B007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E01A17D1721B007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E02117D1721B007110E0; + remoteInfo = "Recipe 14-8 Setting Contact Information"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E02217D1721B007110E0 /* Recipe 14-8 Setting Contact Information.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 14-8 Setting Contact Information.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E02517D1721B007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E02717D1721B007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E02917D1721B007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E02D17D1721B007110E0 /* Recipe 14-8 Setting Contact Information-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-8 Setting Contact Information-Info.plist"; sourceTree = ""; }; + 8848E02F17D1721B007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E03117D1721B007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E03317D1721B007110E0 /* Recipe 14-8 Setting Contact Information-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 14-8 Setting Contact Information-Prefix.pch"; sourceTree = ""; }; + 8848E03417D1721B007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E03517D1721B007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E03817D1721B007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E03A17D1721B007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E03B17D1721B007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E03D17D1721B007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E04317D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 14-8 Setting Contact InformationTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E04417D1721B007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E04C17D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 14-8 Setting Contact InformationTests-Info.plist"; sourceTree = ""; }; + 8848E04E17D1721B007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E05017D1721B007110E0 /* Recipe_14_8_Setting_Contact_InformationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_14_8_Setting_Contact_InformationTests.m; sourceTree = ""; }; + 8848E05A17D17237007110E0 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; + 8848E05C17D1723B007110E0 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E01F17D1721B007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E05D17D1723B007110E0 /* AddressBookUI.framework in Frameworks */, + 8848E05B17D17237007110E0 /* AddressBook.framework in Frameworks */, + 8848E02817D1721B007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E02A17D1721B007110E0 /* UIKit.framework in Frameworks */, + 8848E02617D1721B007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E04017D1721B007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E04517D1721B007110E0 /* XCTest.framework in Frameworks */, + 8848E04717D1721B007110E0 /* UIKit.framework in Frameworks */, + 8848E04617D1721B007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E01917D1721B007110E0 = { + isa = PBXGroup; + children = ( + 8848E02B17D1721B007110E0 /* Recipe 14-8 Setting Contact Information */, + 8848E04A17D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests */, + 8848E02417D1721B007110E0 /* Frameworks */, + 8848E02317D1721B007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E02317D1721B007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E02217D1721B007110E0 /* Recipe 14-8 Setting Contact Information.app */, + 8848E04317D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E02417D1721B007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E05C17D1723B007110E0 /* AddressBookUI.framework */, + 8848E05A17D17237007110E0 /* AddressBook.framework */, + 8848E02517D1721B007110E0 /* Foundation.framework */, + 8848E02717D1721B007110E0 /* CoreGraphics.framework */, + 8848E02917D1721B007110E0 /* UIKit.framework */, + 8848E04417D1721B007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E02B17D1721B007110E0 /* Recipe 14-8 Setting Contact Information */ = { + isa = PBXGroup; + children = ( + 8848E03417D1721B007110E0 /* AppDelegate.h */, + 8848E03517D1721B007110E0 /* AppDelegate.m */, + 8848E03717D1721B007110E0 /* Main.storyboard */, + 8848E03A17D1721B007110E0 /* ViewController.h */, + 8848E03B17D1721B007110E0 /* ViewController.m */, + 8848E03D17D1721B007110E0 /* Images.xcassets */, + 8848E02C17D1721B007110E0 /* Supporting Files */, + ); + path = "Recipe 14-8 Setting Contact Information"; + sourceTree = ""; + }; + 8848E02C17D1721B007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E02D17D1721B007110E0 /* Recipe 14-8 Setting Contact Information-Info.plist */, + 8848E02E17D1721B007110E0 /* InfoPlist.strings */, + 8848E03117D1721B007110E0 /* main.m */, + 8848E03317D1721B007110E0 /* Recipe 14-8 Setting Contact Information-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E04A17D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests */ = { + isa = PBXGroup; + children = ( + 8848E05017D1721B007110E0 /* Recipe_14_8_Setting_Contact_InformationTests.m */, + 8848E04B17D1721B007110E0 /* Supporting Files */, + ); + path = "Recipe 14-8 Setting Contact InformationTests"; + sourceTree = ""; + }; + 8848E04B17D1721B007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E04C17D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests-Info.plist */, + 8848E04D17D1721B007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E02117D1721B007110E0 /* Recipe 14-8 Setting Contact Information */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E05417D1721B007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-8 Setting Contact Information" */; + buildPhases = ( + 8848E01E17D1721B007110E0 /* Sources */, + 8848E01F17D1721B007110E0 /* Frameworks */, + 8848E02017D1721B007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 14-8 Setting Contact Information"; + productName = "Recipe 14-8 Setting Contact Information"; + productReference = 8848E02217D1721B007110E0 /* Recipe 14-8 Setting Contact Information.app */; + productType = "com.apple.product-type.application"; + }; + 8848E04217D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E05717D1721B007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-8 Setting Contact InformationTests" */; + buildPhases = ( + 8848E03F17D1721B007110E0 /* Sources */, + 8848E04017D1721B007110E0 /* Frameworks */, + 8848E04117D1721B007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E04917D1721B007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 14-8 Setting Contact InformationTests"; + productName = "Recipe 14-8 Setting Contact InformationTests"; + productReference = 8848E04317D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E01A17D1721B007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E04217D1721B007110E0 = { + TestTargetID = 8848E02117D1721B007110E0; + }; + }; + }; + buildConfigurationList = 8848E01D17D1721B007110E0 /* Build configuration list for PBXProject "Recipe 14-8 Setting Contact Information" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E01917D1721B007110E0; + productRefGroup = 8848E02317D1721B007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E02117D1721B007110E0 /* Recipe 14-8 Setting Contact Information */, + 8848E04217D1721B007110E0 /* Recipe 14-8 Setting Contact InformationTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E02017D1721B007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E03E17D1721B007110E0 /* Images.xcassets in Resources */, + 8848E03017D1721B007110E0 /* InfoPlist.strings in Resources */, + 8848E03917D1721B007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E04117D1721B007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E04F17D1721B007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E01E17D1721B007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E03C17D1721B007110E0 /* ViewController.m in Sources */, + 8848E03617D1721B007110E0 /* AppDelegate.m in Sources */, + 8848E03217D1721B007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E03F17D1721B007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E05117D1721B007110E0 /* Recipe_14_8_Setting_Contact_InformationTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E04917D1721B007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E02117D1721B007110E0 /* Recipe 14-8 Setting Contact Information */; + targetProxy = 8848E04817D1721B007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E02E17D1721B007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E02F17D1721B007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E03717D1721B007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E03817D1721B007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E04D17D1721B007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E04E17D1721B007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E05217D1721B007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E05317D1721B007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E05517D1721B007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E05617D1721B007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E05817D1721B007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-8 Setting Contact Information.app/Recipe 14-8 Setting Contact Information"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 14-8 Setting Contact InformationTests/Recipe 14-8 Setting Contact InformationTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E05917D1721B007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 14-8 Setting Contact Information.app/Recipe 14-8 Setting Contact Information"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Prefix.pch"; + INFOPLIST_FILE = "Recipe 14-8 Setting Contact InformationTests/Recipe 14-8 Setting Contact InformationTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E01D17D1721B007110E0 /* Build configuration list for PBXProject "Recipe 14-8 Setting Contact Information" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E05217D1721B007110E0 /* Debug */, + 8848E05317D1721B007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E05417D1721B007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-8 Setting Contact Information" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E05517D1721B007110E0 /* Debug */, + 8848E05617D1721B007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8848E05717D1721B007110E0 /* Build configuration list for PBXNativeTarget "Recipe 14-8 Setting Contact InformationTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E05817D1721B007110E0 /* Debug */, + 8848E05917D1721B007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E01A17D1721B007110E0 /* Project object */; +} diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..bc901b5 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..07cbd26 Binary files /dev/null and b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-8 Setting Contact Information.xcscheme b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-8 Setting Contact Information.xcscheme new file mode 100644 index 0000000..603a8ef --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 14-8 Setting Contact Information.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..fef69b2 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 14-8 Setting Contact Information.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E02117D1721B007110E0 + + primary + + + 8848E04217D1721B007110E0 + + primary + + + + + diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/AppDelegate.h b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/AppDelegate.h new file mode 100644 index 0000000..13bfa5f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 14-8 Setting Contact Information +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/AppDelegate.m b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/AppDelegate.m new file mode 100644 index 0000000..5d8883e --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 14-8 Setting Contact Information +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Base.lproj/Main.storyboard b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e1697c9 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Base.lproj/Main.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Images.xcassets/AppIcon.appiconset/Contents.json b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Info.plist b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Info.plist new file mode 100644 index 0000000..51d4c13 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Info.plist @@ -0,0 +1,42 @@ + + + + + NSContactsUsageDescription + Testing creating contacts + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Prefix.pch b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/ViewController.h b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/ViewController.h new file mode 100644 index 0000000..3626a02 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/ViewController.h @@ -0,0 +1,17 @@ +// +// ViewController.h +// Recipe 14-8 Setting Contact Information +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +- (IBAction)addNewContact:(id)sender; + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/ViewController.m b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/ViewController.m new file mode 100644 index 0000000..8823e78 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/ViewController.m @@ -0,0 +1,97 @@ +// +// ViewController.m +// Recipe 14-8 Setting Contact Information +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)addNewContact:(id)sender +{ + NSString *firstName = @"Joe"; + NSString *lastName = @"Doe"; + NSString *mobileNumber = @"555-5309"; + NSString *street = @"12345 Circle Wave"; + NSString *city = @"Coral Gables"; + NSString *state = @"FL"; + NSString *zip = @"33146"; + NSString *country = @"United States"; + + ABRecordRef contactRecord = ABPersonCreate(); + + // Setup first and last name records + ABRecordSetValue(contactRecord, kABPersonFirstNameProperty, (__bridge_retained CFStringRef)firstName, nil); + ABRecordSetValue(contactRecord, kABPersonLastNameProperty, (__bridge_retained CFStringRef)lastName, nil); + + // Setup phone record + ABMutableMultiValueRef phoneRecord = ABMultiValueCreateMutable(kABMultiStringPropertyType); + ABMultiValueAddValueAndLabel(phoneRecord, (__bridge_retained CFStringRef)mobileNumber, + kABPersonPhoneMobileLabel, NULL); + ABRecordSetValue(contactRecord, kABPersonPhoneProperty, phoneRecord, nil); + CFRelease(phoneRecord); + + // Setup address record + ABMutableMultiValueRef addressRecord = ABMultiValueCreateMutable(kABDictionaryPropertyType); + CFStringRef dictionaryKeys[5]; + CFStringRef dictionaryValues[5]; + dictionaryKeys[0] = kABPersonAddressStreetKey; + dictionaryKeys[1] = kABPersonAddressCityKey; + dictionaryKeys[2] = kABPersonAddressStateKey; + dictionaryKeys[3] = kABPersonAddressZIPKey; + dictionaryKeys[4] = kABPersonAddressCountryKey; + dictionaryValues[0] = (__bridge_retained CFStringRef)street; + dictionaryValues[1] = (__bridge_retained CFStringRef)city; + dictionaryValues[2] = (__bridge_retained CFStringRef)state; + dictionaryValues[3] = (__bridge_retained CFStringRef)zip; + dictionaryValues[4] = (__bridge_retained CFStringRef)country; + + CFDictionaryRef addressDictionary = CFDictionaryCreate(kCFAllocatorDefault, (void *)dictionaryKeys, (void *)dictionaryValues, 5, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + ABMultiValueAddValueAndLabel(addressRecord, addressDictionary, kABHomeLabel, NULL); + CFRelease(addressDictionary); + + ABRecordSetValue(contactRecord, kABPersonAddressProperty, addressRecord, nil); + CFRelease(addressRecord); + + // Display View Controller + ABNewPersonViewController *view = [[ABNewPersonViewController alloc] init]; + view.newPersonViewDelegate = self; + view.displayedPerson = contactRecord; + + CFRelease(contactRecord); + + UINavigationController *newNavigationController = [[UINavigationController alloc] initWithRootViewController:view]; + [self presentViewController:newNavigationController animated:YES completion:nil]; +} + +-(void)newPersonViewController:(ABNewPersonViewController *)newPersonView didCompleteWithNewPerson:(ABRecordRef)person +{ + if (person == NULL) + { + NSLog(@"User Cancelled Creation"); + } + else + NSLog(@"Successfully Created New Person"); + [self dismissViewControllerAnimated:YES completion:nil]; +} + +@end \ No newline at end of file diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/main.m b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/main.m new file mode 100644 index 0000000..2be0d26 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact Information/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 14-8 Setting Contact Information +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/Recipe 14-8 Setting Contact InformationTests-Info.plist b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/Recipe 14-8 Setting Contact InformationTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/Recipe 14-8 Setting Contact InformationTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/Recipe_14_8_Setting_Contact_InformationTests.m b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/Recipe_14_8_Setting_Contact_InformationTests.m new file mode 100644 index 0000000..80a7ad4 --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/Recipe_14_8_Setting_Contact_InformationTests.m @@ -0,0 +1,34 @@ +// +// Recipe_14_8_Setting_Contact_InformationTests.m +// Recipe 14-8 Setting Contact InformationTests +// +// Created by joseph hoffman on 8/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_14_8_Setting_Contact_InformationTests : XCTestCase + +@end + +@implementation Recipe_14_8_Setting_Contact_InformationTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/en.lproj/InfoPlist.strings b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH14 - User Data Recipes/Recipe 14-8 Setting Contact Information/Recipe 14-8 Setting Contact InformationTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/project.pbxproj b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fae3e5e --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/project.pbxproj @@ -0,0 +1,469 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E06B17D6D338007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E06A17D6D338007110E0 /* Foundation.framework */; }; + 8848E06D17D6D338007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E06C17D6D338007110E0 /* CoreGraphics.framework */; }; + 8848E06F17D6D338007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E06E17D6D338007110E0 /* UIKit.framework */; }; + 8848E07517D6D338007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E07317D6D338007110E0 /* InfoPlist.strings */; }; + 8848E07717D6D338007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E07617D6D338007110E0 /* main.m */; }; + 8848E07B17D6D338007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E07A17D6D338007110E0 /* AppDelegate.m */; }; + 8848E07E17D6D338007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E07C17D6D338007110E0 /* Main.storyboard */; }; + 8848E08117D6D338007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E08017D6D338007110E0 /* ViewController.m */; }; + 8848E08317D6D338007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E08217D6D338007110E0 /* Images.xcassets */; }; + 8848E08A17D6D338007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E08917D6D338007110E0 /* XCTest.framework */; }; + 8848E08B17D6D338007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E06A17D6D338007110E0 /* Foundation.framework */; }; + 8848E08C17D6D338007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E06E17D6D338007110E0 /* UIKit.framework */; }; + 8848E09417D6D338007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E09217D6D338007110E0 /* InfoPlist.strings */; }; + 8848E09617D6D338007110E0 /* Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E09517D6D338007110E0 /* Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E08D17D6D338007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E05F17D6D338007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E06617D6D338007110E0; + remoteInfo = "Recipe 15-1 Persisting Data with NSUserDefaults"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E06717D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 15-1 Persisting Data with NSUserDefaults.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E06A17D6D338007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E06C17D6D338007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E06E17D6D338007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E07217D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist"; sourceTree = ""; }; + 8848E07417D6D338007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E07617D6D338007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E07817D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch"; sourceTree = ""; }; + 8848E07917D6D338007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E07A17D6D338007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E07D17D6D338007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E07F17D6D338007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E08017D6D338007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E08217D6D338007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E08817D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 15-1 Persisting Data with NSUserDefaultsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E08917D6D338007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E09117D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist"; sourceTree = ""; }; + 8848E09317D6D338007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E09517D6D338007110E0 /* Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E06417D6D338007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E06D17D6D338007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E06F17D6D338007110E0 /* UIKit.framework in Frameworks */, + 8848E06B17D6D338007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E08517D6D338007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E08A17D6D338007110E0 /* XCTest.framework in Frameworks */, + 8848E08C17D6D338007110E0 /* UIKit.framework in Frameworks */, + 8848E08B17D6D338007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E05E17D6D338007110E0 = { + isa = PBXGroup; + children = ( + 8848E07017D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults */, + 8848E08F17D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests */, + 8848E06917D6D338007110E0 /* Frameworks */, + 8848E06817D6D338007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E06817D6D338007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E06717D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults.app */, + 8848E08817D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E06917D6D338007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E06A17D6D338007110E0 /* Foundation.framework */, + 8848E06C17D6D338007110E0 /* CoreGraphics.framework */, + 8848E06E17D6D338007110E0 /* UIKit.framework */, + 8848E08917D6D338007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E07017D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults */ = { + isa = PBXGroup; + children = ( + 8848E07917D6D338007110E0 /* AppDelegate.h */, + 8848E07A17D6D338007110E0 /* AppDelegate.m */, + 8848E07C17D6D338007110E0 /* Main.storyboard */, + 8848E07F17D6D338007110E0 /* ViewController.h */, + 8848E08017D6D338007110E0 /* ViewController.m */, + 8848E08217D6D338007110E0 /* Images.xcassets */, + 8848E07117D6D338007110E0 /* Supporting Files */, + ); + path = "Recipe 15-1 Persisting Data with NSUserDefaults"; + sourceTree = ""; + }; + 8848E07117D6D338007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E07217D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist */, + 8848E07317D6D338007110E0 /* InfoPlist.strings */, + 8848E07617D6D338007110E0 /* main.m */, + 8848E07817D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E08F17D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests */ = { + isa = PBXGroup; + children = ( + 8848E09517D6D338007110E0 /* Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m */, + 8848E09017D6D338007110E0 /* Supporting Files */, + ); + path = "Recipe 15-1 Persisting Data with NSUserDefaultsTests"; + sourceTree = ""; + }; + 8848E09017D6D338007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E09117D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist */, + 8848E09217D6D338007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E06617D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E09917D6D338007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-1 Persisting Data with NSUserDefaults" */; + buildPhases = ( + 8848E06317D6D338007110E0 /* Sources */, + 8848E06417D6D338007110E0 /* Frameworks */, + 8848E06517D6D338007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 15-1 Persisting Data with NSUserDefaults"; + productName = "Recipe 15-1 Persisting Data with NSUserDefaults"; + productReference = 8848E06717D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults.app */; + productType = "com.apple.product-type.application"; + }; + 8848E08717D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E09C17D6D338007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-1 Persisting Data with NSUserDefaultsTests" */; + buildPhases = ( + 8848E08417D6D338007110E0 /* Sources */, + 8848E08517D6D338007110E0 /* Frameworks */, + 8848E08617D6D338007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E08E17D6D338007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 15-1 Persisting Data with NSUserDefaultsTests"; + productName = "Recipe 15-1 Persisting Data with NSUserDefaultsTests"; + productReference = 8848E08817D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E05F17D6D338007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E08717D6D338007110E0 = { + TestTargetID = 8848E06617D6D338007110E0; + }; + }; + }; + buildConfigurationList = 8848E06217D6D338007110E0 /* Build configuration list for PBXProject "Recipe 15-1 Persisting Data with NSUserDefaults" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E05E17D6D338007110E0; + productRefGroup = 8848E06817D6D338007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E06617D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults */, + 8848E08717D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaultsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E06517D6D338007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E08317D6D338007110E0 /* Images.xcassets in Resources */, + 8848E07517D6D338007110E0 /* InfoPlist.strings in Resources */, + 8848E07E17D6D338007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E08617D6D338007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E09417D6D338007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E06317D6D338007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E08117D6D338007110E0 /* ViewController.m in Sources */, + 8848E07B17D6D338007110E0 /* AppDelegate.m in Sources */, + 8848E07717D6D338007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E08417D6D338007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E09617D6D338007110E0 /* Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E08E17D6D338007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E06617D6D338007110E0 /* Recipe 15-1 Persisting Data with NSUserDefaults */; + targetProxy = 8848E08D17D6D338007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E07317D6D338007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E07417D6D338007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E07C17D6D338007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E07D17D6D338007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E09217D6D338007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E09317D6D338007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E09717D6D338007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E09817D6D338007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E09A17D6D338007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E09B17D6D338007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E09D17D6D338007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-1 Persisting Data with NSUserDefaults.app/Recipe 15-1 Persisting Data with NSUserDefaults"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E09E17D6D338007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-1 Persisting Data with NSUserDefaults.app/Recipe 15-1 Persisting Data with NSUserDefaults"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E06217D6D338007110E0 /* Build configuration list for PBXProject "Recipe 15-1 Persisting Data with NSUserDefaults" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E09717D6D338007110E0 /* Debug */, + 8848E09817D6D338007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E09917D6D338007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-1 Persisting Data with NSUserDefaults" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E09A17D6D338007110E0 /* Debug */, + 8848E09B17D6D338007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8848E09C17D6D338007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-1 Persisting Data with NSUserDefaultsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E09D17D6D338007110E0 /* Debug */, + 8848E09E17D6D338007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E05F17D6D338007110E0 /* Project object */; +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..5d2a218 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..96143a9 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 15-1 Persisting Data with NSUserDefaults.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E06617D6D338007110E0 + + primary + + + 8848E08717D6D338007110E0 + + primary + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/AppDelegate.h b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/AppDelegate.h new file mode 100644 index 0000000..d4e8124 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 15-1 Persisting Data with NSUserDefaults +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/AppDelegate.m b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/AppDelegate.m new file mode 100644 index 0000000..b1495b9 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 15-1 Persisting Data with NSUserDefaults +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Base.lproj/Main.storyboard b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e9e40ac --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Base.lproj/Main.storyboard @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Images.xcassets/AppIcon.appiconset/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/ViewController.h b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/ViewController.h new file mode 100644 index 0000000..984e632 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 15-1 Persisting Data with NSUserDefaults +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextField *firstNameTextField; +@property (weak, nonatomic) IBOutlet UITextField *lastNameTextField; +@property (weak, nonatomic) IBOutlet UISwitch *activitySwitch; +@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; + +- (IBAction)toggleActivity:(id)sender; +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/ViewController.m b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/ViewController.m new file mode 100644 index 0000000..c3e950b --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/ViewController.m @@ -0,0 +1,86 @@ +// +// ViewController.m +// Recipe 15-1 Persisting Data with NSUserDefaults +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.firstNameTextField.delegate = self; + self.lastNameTextField.delegate = self; + + [self loadPersistentData:self]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(savePersistentData:) + name:UIApplicationDidEnterBackgroundNotification object:nil]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)toggleActivity:(id)sender +{ + if (self.activitySwitch.on) + { + [self.activityIndicator startAnimating]; + } + else + { + [self.activityIndicator stopAnimating]; + } +} +#pragma mark - helper methods + +- (void)savePersistentData:(id)sender +{ + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + + //Set Objects/Values to Persist + [userDefaults setObject:self.firstNameTextField.text forKey:@"firstName"]; + [userDefaults setObject:self.lastNameTextField.text forKey:@"lastName"]; + [userDefaults setBool:self.activitySwitch.on forKey:@"activityOn"]; + + //Save Changes + [userDefaults synchronize]; +} + +- (void)loadPersistentData:(id)sender +{ + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + + self.firstNameTextField.text = [userDefaults objectForKey:@"firstName"]; + self.lastNameTextField.text = [userDefaults objectForKey:@"lastName"]; + [self.activitySwitch setOn:[userDefaults boolForKey:@"activityOn"] animated:NO]; + + if (self.activitySwitch.on) + { + [self.activityIndicator startAnimating]; + } +} + + +#pragma mark - delegate methods + +-(BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/main.m b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/main.m new file mode 100644 index 0000000..454fcb9 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaults/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 15-1 Persisting Data with NSUserDefaults +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe 15-1 Persisting Data with NSUserDefaultsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m new file mode 100644 index 0000000..6246dde --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests.m +// Recipe 15-1 Persisting Data with NSUserDefaultsTests +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests : XCTestCase + +@end + +@implementation Recipe_15_1_Persisting_Data_with_NSUserDefaultsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-1 Persisting Data with NSUserDefaults/Recipe 15-1 Persisting Data with NSUserDefaultsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.pbxproj b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3a8da23 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.pbxproj @@ -0,0 +1,469 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E0AC17D6D709007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E0AB17D6D709007110E0 /* Foundation.framework */; }; + 8848E0AE17D6D709007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E0AD17D6D709007110E0 /* CoreGraphics.framework */; }; + 8848E0B017D6D709007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E0AF17D6D709007110E0 /* UIKit.framework */; }; + 8848E0B617D6D709007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E0B417D6D709007110E0 /* InfoPlist.strings */; }; + 8848E0B817D6D709007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E0B717D6D709007110E0 /* main.m */; }; + 8848E0BC17D6D709007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E0BB17D6D709007110E0 /* AppDelegate.m */; }; + 8848E0BF17D6D709007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E0BD17D6D709007110E0 /* Main.storyboard */; }; + 8848E0C217D6D709007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E0C117D6D709007110E0 /* ViewController.m */; }; + 8848E0C417D6D709007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E0C317D6D709007110E0 /* Images.xcassets */; }; + 8848E0CB17D6D709007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E0CA17D6D709007110E0 /* XCTest.framework */; }; + 8848E0CC17D6D709007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E0AB17D6D709007110E0 /* Foundation.framework */; }; + 8848E0CD17D6D709007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E0AF17D6D709007110E0 /* UIKit.framework */; }; + 8848E0D517D6D709007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E0D317D6D709007110E0 /* InfoPlist.strings */; }; + 8848E0D717D6D709007110E0 /* Recipe_15_2_Persisting_Data_Using_FilesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E0D617D6D709007110E0 /* Recipe_15_2_Persisting_Data_Using_FilesTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E0CE17D6D709007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E0A017D6D709007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E0A717D6D709007110E0; + remoteInfo = "Recipe 15-2 Persisting Data Using Files"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E0A817D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 15-2 Persisting Data Using Files.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E0AB17D6D709007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E0AD17D6D709007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E0AF17D6D709007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E0B317D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-2 Persisting Data Using Files-Info.plist"; sourceTree = ""; }; + 8848E0B517D6D709007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E0B717D6D709007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E0B917D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 15-2 Persisting Data Using Files-Prefix.pch"; sourceTree = ""; }; + 8848E0BA17D6D709007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E0BB17D6D709007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E0BE17D6D709007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E0C017D6D709007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E0C117D6D709007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E0C317D6D709007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E0C917D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 15-2 Persisting Data Using FilesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E0CA17D6D709007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E0D217D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-2 Persisting Data Using FilesTests-Info.plist"; sourceTree = ""; }; + 8848E0D417D6D709007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E0D617D6D709007110E0 /* Recipe_15_2_Persisting_Data_Using_FilesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_15_2_Persisting_Data_Using_FilesTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E0A517D6D709007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E0AE17D6D709007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E0B017D6D709007110E0 /* UIKit.framework in Frameworks */, + 8848E0AC17D6D709007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E0C617D6D709007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E0CB17D6D709007110E0 /* XCTest.framework in Frameworks */, + 8848E0CD17D6D709007110E0 /* UIKit.framework in Frameworks */, + 8848E0CC17D6D709007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E09F17D6D709007110E0 = { + isa = PBXGroup; + children = ( + 8848E0B117D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files */, + 8848E0D017D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests */, + 8848E0AA17D6D709007110E0 /* Frameworks */, + 8848E0A917D6D709007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E0A917D6D709007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E0A817D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files.app */, + 8848E0C917D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E0AA17D6D709007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E0AB17D6D709007110E0 /* Foundation.framework */, + 8848E0AD17D6D709007110E0 /* CoreGraphics.framework */, + 8848E0AF17D6D709007110E0 /* UIKit.framework */, + 8848E0CA17D6D709007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E0B117D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files */ = { + isa = PBXGroup; + children = ( + 8848E0BA17D6D709007110E0 /* AppDelegate.h */, + 8848E0BB17D6D709007110E0 /* AppDelegate.m */, + 8848E0BD17D6D709007110E0 /* Main.storyboard */, + 8848E0C017D6D709007110E0 /* ViewController.h */, + 8848E0C117D6D709007110E0 /* ViewController.m */, + 8848E0C317D6D709007110E0 /* Images.xcassets */, + 8848E0B217D6D709007110E0 /* Supporting Files */, + ); + path = "Recipe 15-2 Persisting Data Using Files"; + sourceTree = ""; + }; + 8848E0B217D6D709007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E0B317D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files-Info.plist */, + 8848E0B417D6D709007110E0 /* InfoPlist.strings */, + 8848E0B717D6D709007110E0 /* main.m */, + 8848E0B917D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E0D017D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests */ = { + isa = PBXGroup; + children = ( + 8848E0D617D6D709007110E0 /* Recipe_15_2_Persisting_Data_Using_FilesTests.m */, + 8848E0D117D6D709007110E0 /* Supporting Files */, + ); + path = "Recipe 15-2 Persisting Data Using FilesTests"; + sourceTree = ""; + }; + 8848E0D117D6D709007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E0D217D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests-Info.plist */, + 8848E0D317D6D709007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E0A717D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E0DA17D6D709007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-2 Persisting Data Using Files" */; + buildPhases = ( + 8848E0A417D6D709007110E0 /* Sources */, + 8848E0A517D6D709007110E0 /* Frameworks */, + 8848E0A617D6D709007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 15-2 Persisting Data Using Files"; + productName = "Recipe 15-2 Persisting Data Using Files"; + productReference = 8848E0A817D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files.app */; + productType = "com.apple.product-type.application"; + }; + 8848E0C817D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E0DD17D6D709007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-2 Persisting Data Using FilesTests" */; + buildPhases = ( + 8848E0C517D6D709007110E0 /* Sources */, + 8848E0C617D6D709007110E0 /* Frameworks */, + 8848E0C717D6D709007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E0CF17D6D709007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 15-2 Persisting Data Using FilesTests"; + productName = "Recipe 15-2 Persisting Data Using FilesTests"; + productReference = 8848E0C917D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E0A017D6D709007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E0C817D6D709007110E0 = { + TestTargetID = 8848E0A717D6D709007110E0; + }; + }; + }; + buildConfigurationList = 8848E0A317D6D709007110E0 /* Build configuration list for PBXProject "Recipe 15-2 Persisting Data Using Files" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E09F17D6D709007110E0; + productRefGroup = 8848E0A917D6D709007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E0A717D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files */, + 8848E0C817D6D709007110E0 /* Recipe 15-2 Persisting Data Using FilesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E0A617D6D709007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E0C417D6D709007110E0 /* Images.xcassets in Resources */, + 8848E0B617D6D709007110E0 /* InfoPlist.strings in Resources */, + 8848E0BF17D6D709007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E0C717D6D709007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E0D517D6D709007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E0A417D6D709007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E0C217D6D709007110E0 /* ViewController.m in Sources */, + 8848E0BC17D6D709007110E0 /* AppDelegate.m in Sources */, + 8848E0B817D6D709007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E0C517D6D709007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E0D717D6D709007110E0 /* Recipe_15_2_Persisting_Data_Using_FilesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E0CF17D6D709007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E0A717D6D709007110E0 /* Recipe 15-2 Persisting Data Using Files */; + targetProxy = 8848E0CE17D6D709007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E0B417D6D709007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E0B517D6D709007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E0BD17D6D709007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E0BE17D6D709007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E0D317D6D709007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E0D417D6D709007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E0D817D6D709007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E0D917D6D709007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E0DB17D6D709007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E0DC17D6D709007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E0DE17D6D709007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-2 Persisting Data Using Files.app/Recipe 15-2 Persisting Data Using Files"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 15-2 Persisting Data Using FilesTests/Recipe 15-2 Persisting Data Using FilesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E0DF17D6D709007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-2 Persisting Data Using Files.app/Recipe 15-2 Persisting Data Using Files"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-2 Persisting Data Using FilesTests/Recipe 15-2 Persisting Data Using FilesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E0A317D6D709007110E0 /* Build configuration list for PBXProject "Recipe 15-2 Persisting Data Using Files" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E0D817D6D709007110E0 /* Debug */, + 8848E0D917D6D709007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E0DA17D6D709007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-2 Persisting Data Using Files" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E0DB17D6D709007110E0 /* Debug */, + 8848E0DC17D6D709007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8848E0DD17D6D709007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-2 Persisting Data Using FilesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E0DE17D6D709007110E0 /* Debug */, + 8848E0DF17D6D709007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E0A017D6D709007110E0 /* Project object */; +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..570ddcf --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..9fd2112 Binary files /dev/null and b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..44ba5be --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 15-2 Persisting Data Using Files.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E0A717D6D709007110E0 + + primary + + + 8848E0C817D6D709007110E0 + + primary + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/AppDelegate.h b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/AppDelegate.h new file mode 100644 index 0000000..4a3ffd4 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 15-2 Persisting Data Using Files +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/AppDelegate.m b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/AppDelegate.m new file mode 100644 index 0000000..944686c --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 15-2 Persisting Data Using Files +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Base.lproj/Main.storyboard b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Base.lproj/Main.storyboard new file mode 100644 index 0000000..7e72704 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Base.lproj/Main.storyboard @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Images.xcassets/AppIcon.appiconset/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Prefix.pch b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/ViewController.h b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/ViewController.h new file mode 100644 index 0000000..e415706 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 15-2 Persisting Data Using Files +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController +@property (weak, nonatomic) IBOutlet UITextField *filenameTextField; +@property (weak, nonatomic) IBOutlet UITextView *contentTextView; + +- (IBAction)saveContent:(id)sender; +- (IBAction)loadContent:(id)sender; +- (IBAction)clearContent:(id)sender; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/ViewController.m b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/ViewController.m new file mode 100644 index 0000000..434e347 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/ViewController.m @@ -0,0 +1,100 @@ +// +// ViewController.m +// Recipe 15-2 Persisting Data Using Files +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)saveContent:(id)sender +{ + NSString *filePath = [self currentContentFilePath]; + NSFileManager *fileManager = [NSFileManager defaultManager]; + if ([fileManager fileExistsAtPath:filePath]) + { + UIAlertView *overwriteAlert = [[UIAlertView alloc] initWithTitle:@"File Exists" + message:@"Do you want to replace the file?" delegate:self + cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil]; + [overwriteAlert show]; + } + else + [self saveContentToFile:filePath]; + +} + +- (IBAction)loadContent:(id)sender +{ + NSString *filePath = [self currentContentFilePath]; + NSError *error; + NSString *content = [NSString stringWithContentsOfFile:filePath + encoding:NSUnicodeStringEncoding error:&error]; + if (error) + { + NSLog(@"Unable to load file: %@\nError: %@", filePath, error); + } + self.contentTextView.text = content; +} + +- (IBAction)clearContent:(id)sender +{ + self.contentTextView.text = nil; +} + +#pragma mark - helper methods + +- (NSString *)currentContentFilePath +{ + NSArray *documentDirectories = + NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *documentsDirectory = [documentDirectories objectAtIndex:0]; + + return [documentsDirectory + stringByAppendingPathComponent:self.filenameTextField.text]; +} + +- (void)saveContentToFile:(NSString *)filePath +{ + NSString *content = self.contentTextView.text; + NSError *error; + BOOL success = [content writeToFile:filePath atomically:YES + encoding:NSUnicodeStringEncoding error:&error]; + if (!success) + { + NSLog(@"Unable to save file: %@\nError: %@", filePath, error); + } +} + +#pragma mark - delegate methods + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex == 1) + { + // User tapped Yes button, overwrite the file + NSString *filePath = [self currentContentFilePath]; + [self saveContentToFile:filePath]; + } +} + + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/main.m b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/main.m new file mode 100644 index 0000000..efd7d9c --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using Files/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 15-2 Persisting Data Using Files +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/Recipe 15-2 Persisting Data Using FilesTests-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/Recipe 15-2 Persisting Data Using FilesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/Recipe 15-2 Persisting Data Using FilesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/Recipe_15_2_Persisting_Data_Using_FilesTests.m b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/Recipe_15_2_Persisting_Data_Using_FilesTests.m new file mode 100644 index 0000000..1665a54 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/Recipe_15_2_Persisting_Data_Using_FilesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_15_2_Persisting_Data_Using_FilesTests.m +// Recipe 15-2 Persisting Data Using FilesTests +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_15_2_Persisting_Data_Using_FilesTests : XCTestCase + +@end + +@implementation Recipe_15_2_Persisting_Data_Using_FilesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-2 Persisting Data Using Files/Recipe 15-2 Persisting Data Using FilesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/.DS_Store b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/.DS_Store new file mode 100644 index 0000000..3c5be00 Binary files /dev/null and b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/.DS_Store differ diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.h b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.h new file mode 100644 index 0000000..2f005c1 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.h @@ -0,0 +1,34 @@ +// +// EditWordViewController.h +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "Word.h" + +@class EditWordViewController; + +typedef void (^EditWordViewControllerCompletionHandler)(EditWordViewController *sender, BOOL canceled); + +@interface EditWordViewController : UIViewController +{ +@private + EditWordViewControllerCompletionHandler _completionHandler; + Word *_word; +} + +@property (weak, nonatomic) IBOutlet UITextField *wordTextField; +@property (weak, nonatomic) IBOutlet UITextField *translationTextField; + + +- (id)initWithWord:(Word *)word + completion:(EditWordViewControllerCompletionHandler)completionHandler; + ++ (void)editWord:(Word *)word +inNavigationController:(UINavigationController *)navigationController + completion:(EditWordViewControllerCompletionHandler)completionHandler; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.m new file mode 100644 index 0000000..c64a378 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.m @@ -0,0 +1,71 @@ +// +// EditWordViewController.m +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "EditWordViewController.h" + +@interface EditWordViewController () + +@end + +@implementation EditWordViewController + +- (id)initWithWord:(Word *)word completion:(EditWordViewControllerCompletionHandler)completionHandler +{ + self = [super initWithNibName:nil bundle:nil]; + if (self) + { + _completionHandler = completionHandler; + _word = word; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + self.title = @"Edit Word"; + + self.wordTextField.text = _word.word; + self.translationTextField.text = _word.translation; + + self.navigationItem.rightBarButtonItem = + [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone + target:self action:@selector(done)]; + self.navigationItem.leftBarButtonItem = + [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + target:self action:@selector(cancel)]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + ++ (void)editWord:(Word *)word +inNavigationController:(UINavigationController *)navigationController + completion:(EditWordViewControllerCompletionHandler)completionHandler +{ + EditWordViewController *editViewController = + [[EditWordViewController alloc] initWithWord:word completion:completionHandler]; + [navigationController pushViewController:editViewController animated:YES]; +} +- (void)done +{ + _word.word = self.wordTextField.text; + _word.translation = self.translationTextField.text; + _completionHandler(self, NO); +} +- (void)cancel +{ + _completionHandler(self, YES); +} + + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.xib b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.xib new file mode 100644 index 0000000..a647490 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/EditWordViewController.xib @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.pbxproj b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fba949a --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.pbxproj @@ -0,0 +1,507 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E16F17D6DE3C007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E16E17D6DE3C007110E0 /* Foundation.framework */; }; + 8848E17117D6DE3D007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E17017D6DE3C007110E0 /* CoreGraphics.framework */; }; + 8848E17317D6DE3D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E17217D6DE3D007110E0 /* UIKit.framework */; }; + 8848E17517D6DE3D007110E0 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E17417D6DE3D007110E0 /* CoreData.framework */; }; + 8848E17B17D6DE3D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E17917D6DE3D007110E0 /* InfoPlist.strings */; }; + 8848E17D17D6DE3D007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E17C17D6DE3D007110E0 /* main.m */; }; + 8848E18117D6DE3D007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E18017D6DE3D007110E0 /* AppDelegate.m */; }; + 8848E18417D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8848E18217D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodeld */; }; + 8848E18617D6DE3D007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E18517D6DE3D007110E0 /* Images.xcassets */; }; + 8848E18D17D6DE3D007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E18C17D6DE3D007110E0 /* XCTest.framework */; }; + 8848E18E17D6DE3D007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E16E17D6DE3C007110E0 /* Foundation.framework */; }; + 8848E18F17D6DE3D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E17217D6DE3D007110E0 /* UIKit.framework */; }; + 8848E19017D6DE3D007110E0 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E17417D6DE3D007110E0 /* CoreData.framework */; }; + 8848E19817D6DE3D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E19617D6DE3D007110E0 /* InfoPlist.strings */; }; + 8848E19A17D6DE3D007110E0 /* Recipe_15_3_Using_Core_DataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E19917D6DE3D007110E0 /* Recipe_15_3_Using_Core_DataTests.m */; }; + 8848E1A517D6E36A007110E0 /* Vocabulary.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1A417D6E36A007110E0 /* Vocabulary.m */; }; + 8848E1A817D6E376007110E0 /* Word.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1A717D6E376007110E0 /* Word.m */; }; + 8848E1AB17D6E430007110E0 /* VocabulariesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1AA17D6E430007110E0 /* VocabulariesViewController.m */; }; + 8848E1AE17D6E7CB007110E0 /* WordsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1AD17D6E7CB007110E0 /* WordsViewController.m */; }; + 8848E1B217D6E939007110E0 /* EditWordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1B017D6E939007110E0 /* EditWordViewController.m */; }; + 8848E1B317D6E939007110E0 /* EditWordViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1B117D6E939007110E0 /* EditWordViewController.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E19117D6DE3D007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E16317D6DE3C007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E16A17D6DE3C007110E0; + remoteInfo = "Recipe 15-3 Using Core Data"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E16B17D6DE3C007110E0 /* Recipe 15-3 Using Core Data.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 15-3 Using Core Data.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E16E17D6DE3C007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E17017D6DE3C007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E17217D6DE3D007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E17417D6DE3D007110E0 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 8848E17817D6DE3D007110E0 /* Recipe 15-3 Using Core Data-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-3 Using Core Data-Info.plist"; sourceTree = ""; }; + 8848E17A17D6DE3D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E17C17D6DE3D007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E17E17D6DE3D007110E0 /* Recipe 15-3 Using Core Data-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 15-3 Using Core Data-Prefix.pch"; sourceTree = ""; }; + 8848E17F17D6DE3D007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E18017D6DE3D007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E18317D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Recipe_15_3_Using_Core_Data.xcdatamodel; sourceTree = ""; }; + 8848E18517D6DE3D007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E18B17D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 15-3 Using Core DataTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E18C17D6DE3D007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E19517D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-3 Using Core DataTests-Info.plist"; sourceTree = ""; }; + 8848E19717D6DE3D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E19917D6DE3D007110E0 /* Recipe_15_3_Using_Core_DataTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_15_3_Using_Core_DataTests.m; sourceTree = ""; }; + 8848E1A317D6E36A007110E0 /* Vocabulary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vocabulary.h; sourceTree = ""; }; + 8848E1A417D6E36A007110E0 /* Vocabulary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Vocabulary.m; sourceTree = ""; }; + 8848E1A617D6E376007110E0 /* Word.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Word.h; sourceTree = ""; }; + 8848E1A717D6E376007110E0 /* Word.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Word.m; sourceTree = ""; }; + 8848E1A917D6E430007110E0 /* VocabulariesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VocabulariesViewController.h; sourceTree = ""; }; + 8848E1AA17D6E430007110E0 /* VocabulariesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VocabulariesViewController.m; sourceTree = ""; }; + 8848E1AC17D6E7CB007110E0 /* WordsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordsViewController.h; sourceTree = ""; }; + 8848E1AD17D6E7CB007110E0 /* WordsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WordsViewController.m; sourceTree = ""; }; + 8848E1AF17D6E939007110E0 /* EditWordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditWordViewController.h; sourceTree = ""; }; + 8848E1B017D6E939007110E0 /* EditWordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditWordViewController.m; sourceTree = ""; }; + 8848E1B117D6E939007110E0 /* EditWordViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EditWordViewController.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E16817D6DE3C007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E17117D6DE3D007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E17517D6DE3D007110E0 /* CoreData.framework in Frameworks */, + 8848E17317D6DE3D007110E0 /* UIKit.framework in Frameworks */, + 8848E16F17D6DE3C007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E18817D6DE3D007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E18D17D6DE3D007110E0 /* XCTest.framework in Frameworks */, + 8848E19017D6DE3D007110E0 /* CoreData.framework in Frameworks */, + 8848E18F17D6DE3D007110E0 /* UIKit.framework in Frameworks */, + 8848E18E17D6DE3D007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E16217D6DE3C007110E0 = { + isa = PBXGroup; + children = ( + 8848E1A917D6E430007110E0 /* VocabulariesViewController.h */, + 8848E1AA17D6E430007110E0 /* VocabulariesViewController.m */, + 8848E1AF17D6E939007110E0 /* EditWordViewController.h */, + 8848E1B017D6E939007110E0 /* EditWordViewController.m */, + 8848E1B117D6E939007110E0 /* EditWordViewController.xib */, + 8848E1AC17D6E7CB007110E0 /* WordsViewController.h */, + 8848E1AD17D6E7CB007110E0 /* WordsViewController.m */, + 8848E1A617D6E376007110E0 /* Word.h */, + 8848E1A717D6E376007110E0 /* Word.m */, + 8848E17617D6DE3D007110E0 /* Recipe 15-3 Using Core Data */, + 8848E19317D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests */, + 8848E16D17D6DE3C007110E0 /* Frameworks */, + 8848E16C17D6DE3C007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E16C17D6DE3C007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E16B17D6DE3C007110E0 /* Recipe 15-3 Using Core Data.app */, + 8848E18B17D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E16D17D6DE3C007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E16E17D6DE3C007110E0 /* Foundation.framework */, + 8848E17017D6DE3C007110E0 /* CoreGraphics.framework */, + 8848E17217D6DE3D007110E0 /* UIKit.framework */, + 8848E17417D6DE3D007110E0 /* CoreData.framework */, + 8848E18C17D6DE3D007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E17617D6DE3D007110E0 /* Recipe 15-3 Using Core Data */ = { + isa = PBXGroup; + children = ( + 8848E17F17D6DE3D007110E0 /* AppDelegate.h */, + 8848E18017D6DE3D007110E0 /* AppDelegate.m */, + 8848E18517D6DE3D007110E0 /* Images.xcassets */, + 8848E18217D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodeld */, + 8848E1A317D6E36A007110E0 /* Vocabulary.h */, + 8848E1A417D6E36A007110E0 /* Vocabulary.m */, + 8848E17717D6DE3D007110E0 /* Supporting Files */, + ); + path = "Recipe 15-3 Using Core Data"; + sourceTree = ""; + }; + 8848E17717D6DE3D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E17817D6DE3D007110E0 /* Recipe 15-3 Using Core Data-Info.plist */, + 8848E17917D6DE3D007110E0 /* InfoPlist.strings */, + 8848E17C17D6DE3D007110E0 /* main.m */, + 8848E17E17D6DE3D007110E0 /* Recipe 15-3 Using Core Data-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E19317D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests */ = { + isa = PBXGroup; + children = ( + 8848E19917D6DE3D007110E0 /* Recipe_15_3_Using_Core_DataTests.m */, + 8848E19417D6DE3D007110E0 /* Supporting Files */, + ); + path = "Recipe 15-3 Using Core DataTests"; + sourceTree = ""; + }; + 8848E19417D6DE3D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E19517D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests-Info.plist */, + 8848E19617D6DE3D007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E16A17D6DE3C007110E0 /* Recipe 15-3 Using Core Data */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E19D17D6DE3D007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-3 Using Core Data" */; + buildPhases = ( + 8848E16717D6DE3C007110E0 /* Sources */, + 8848E16817D6DE3C007110E0 /* Frameworks */, + 8848E16917D6DE3C007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 15-3 Using Core Data"; + productName = "Recipe 15-3 Using Core Data"; + productReference = 8848E16B17D6DE3C007110E0 /* Recipe 15-3 Using Core Data.app */; + productType = "com.apple.product-type.application"; + }; + 8848E18A17D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E1A017D6DE3D007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-3 Using Core DataTests" */; + buildPhases = ( + 8848E18717D6DE3D007110E0 /* Sources */, + 8848E18817D6DE3D007110E0 /* Frameworks */, + 8848E18917D6DE3D007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E19217D6DE3D007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 15-3 Using Core DataTests"; + productName = "Recipe 15-3 Using Core DataTests"; + productReference = 8848E18B17D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E16317D6DE3C007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E18A17D6DE3D007110E0 = { + TestTargetID = 8848E16A17D6DE3C007110E0; + }; + }; + }; + buildConfigurationList = 8848E16617D6DE3C007110E0 /* Build configuration list for PBXProject "Recipe 15-3 Using Core Data" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 8848E16217D6DE3C007110E0; + productRefGroup = 8848E16C17D6DE3C007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E16A17D6DE3C007110E0 /* Recipe 15-3 Using Core Data */, + 8848E18A17D6DE3D007110E0 /* Recipe 15-3 Using Core DataTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E16917D6DE3C007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E17B17D6DE3D007110E0 /* InfoPlist.strings in Resources */, + 8848E18617D6DE3D007110E0 /* Images.xcassets in Resources */, + 8848E1B317D6E939007110E0 /* EditWordViewController.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E18917D6DE3D007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E19817D6DE3D007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E16717D6DE3C007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1AB17D6E430007110E0 /* VocabulariesViewController.m in Sources */, + 8848E1AE17D6E7CB007110E0 /* WordsViewController.m in Sources */, + 8848E1A817D6E376007110E0 /* Word.m in Sources */, + 8848E18417D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodeld in Sources */, + 8848E1B217D6E939007110E0 /* EditWordViewController.m in Sources */, + 8848E18117D6DE3D007110E0 /* AppDelegate.m in Sources */, + 8848E17D17D6DE3D007110E0 /* main.m in Sources */, + 8848E1A517D6E36A007110E0 /* Vocabulary.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E18717D6DE3D007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E19A17D6DE3D007110E0 /* Recipe_15_3_Using_Core_DataTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E19217D6DE3D007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E16A17D6DE3C007110E0 /* Recipe 15-3 Using Core Data */; + targetProxy = 8848E19117D6DE3D007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E17917D6DE3D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E17A17D6DE3D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E19617D6DE3D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E19717D6DE3D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E19B17D6DE3D007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E19C17D6DE3D007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E19E17D6DE3D007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E19F17D6DE3D007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E1A117D6DE3D007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-3 Using Core Data.app/Recipe 15-3 Using Core Data"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 15-3 Using Core DataTests/Recipe 15-3 Using Core DataTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E1A217D6DE3D007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-3 Using Core Data.app/Recipe 15-3 Using Core Data"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-3 Using Core DataTests/Recipe 15-3 Using Core DataTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E16617D6DE3C007110E0 /* Build configuration list for PBXProject "Recipe 15-3 Using Core Data" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E19B17D6DE3D007110E0 /* Debug */, + 8848E19C17D6DE3D007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E19D17D6DE3D007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-3 Using Core Data" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E19E17D6DE3D007110E0 /* Debug */, + 8848E19F17D6DE3D007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8848E1A017D6DE3D007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-3 Using Core DataTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E1A117D6DE3D007110E0 /* Debug */, + 8848E1A217D6DE3D007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 8848E18217D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 8848E18317D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodel */, + ); + currentVersion = 8848E18317D6DE3D007110E0 /* Recipe_15_3_Using_Core_Data.xcdatamodel */; + path = Recipe_15_3_Using_Core_Data.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 8848E16317D6DE3C007110E0 /* Project object */; +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..dd491fa --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ce9f4b9 Binary files /dev/null and b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 15-3 Using Core Data.xcscheme b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 15-3 Using Core Data.xcscheme new file mode 100644 index 0000000..3e68a47 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 15-3 Using Core Data.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..5f4ec8a --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 15-3 Using Core Data.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E16A17D6DE3C007110E0 + + primary + + + 8848E18A17D6DE3D007110E0 + + primary + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/AppDelegate.h b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/AppDelegate.h new file mode 100644 index 0000000..cf7fa92 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/AppDelegate.h @@ -0,0 +1,26 @@ +// +// AppDelegate.h +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "VocabulariesViewController.h" + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; +@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; +@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; + +@property (strong, nonatomic) UINavigationController *navigationController; +@property (strong, nonatomic) VocabulariesViewController *vocabulariesViewController; + +- (void)saveContext; +- (NSURL *)applicationDocumentsDirectory; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/AppDelegate.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/AppDelegate.m new file mode 100644 index 0000000..deda727 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/AppDelegate.m @@ -0,0 +1,155 @@ +// +// AppDelegate.m +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +@synthesize managedObjectContext = _managedObjectContext; +@synthesize managedObjectModel = _managedObjectModel; +@synthesize persistentStoreCoordinator = _persistentStoreCoordinator; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + // Override point for customization after application launch. + self.window.backgroundColor = [UIColor whiteColor]; + + self.vocabulariesViewController = [[VocabulariesViewController alloc] + initWithManagedObjectContext:self.managedObjectContext]; + self.navigationController = [[UINavigationController alloc] + initWithRootViewController:self.vocabulariesViewController]; + self.window.rootViewController = self.navigationController; + [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 +{ + // Saves changes in the application's managed object context before the application terminates. + [self saveContext]; +} + +- (void)saveContext +{ + NSError *error = nil; + NSManagedObjectContext *managedObjectContext = self.managedObjectContext; + if (managedObjectContext != nil) { + if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + } +} + +#pragma mark - Core Data stack + +// Returns the managed object context for the application. +// If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application. +- (NSManagedObjectContext *)managedObjectContext +{ + if (_managedObjectContext != nil) { + return _managedObjectContext; + } + + NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; + if (coordinator != nil) { + _managedObjectContext = [[NSManagedObjectContext alloc] init]; + [_managedObjectContext setPersistentStoreCoordinator:coordinator]; + } + return _managedObjectContext; +} + +// Returns the managed object model for the application. +// If the model doesn't already exist, it is created from the application's model. +- (NSManagedObjectModel *)managedObjectModel +{ + if (_managedObjectModel != nil) { + return _managedObjectModel; + } + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Recipe_15_3_Using_Core_Data" withExtension:@"momd"]; + _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; + return _managedObjectModel; +} + +// Returns the persistent store coordinator for the application. +// If the coordinator doesn't already exist, it is created and the application's store added to it. +- (NSPersistentStoreCoordinator *)persistentStoreCoordinator +{ + if (_persistentStoreCoordinator != nil) { + return _persistentStoreCoordinator; + } + + NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Recipe_15_3_Using_Core_Data.sqlite"]; + + NSError *error = nil; + _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; + if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { + /* + Replace this implementation with code to handle the error appropriately. + + abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + Typical reasons for an error here include: + * The persistent store is not accessible; + * The schema for the persistent store is incompatible with current managed object model. + Check the error message to determine what the actual problem was. + + + If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory. + + If you encounter schema incompatibility errors during development, you can reduce their frequency by: + * Simply deleting the existing store: + [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil] + + * Performing automatic lightweight migration by passing the following dictionary as the options parameter: + @{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES} + + Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details. + + */ + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _persistentStoreCoordinator; +} + +#pragma mark - Application's Documents directory + +// Returns the URL to the application's Documents directory. +- (NSURL *)applicationDocumentsDirectory +{ + return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; +} + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Images.xcassets/AppIcon.appiconset/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Info.plist new file mode 100644 index 0000000..aeba39c --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${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/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Prefix.pch b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Prefix.pch new file mode 100644 index 0000000..5e79f44 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data-Prefix.pch @@ -0,0 +1,17 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import + #import +#endif diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe_15_3_Using_Core_Data.xcdatamodeld/.xccurrentversion b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe_15_3_Using_Core_Data.xcdatamodeld/.xccurrentversion new file mode 100644 index 0000000..e164d44 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe_15_3_Using_Core_Data.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + Recipe_15_3_Using_Core_Data.xcdatamodel + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe_15_3_Using_Core_Data.xcdatamodeld/Recipe_15_3_Using_Core_Data.xcdatamodel/contents b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe_15_3_Using_Core_Data.xcdatamodeld/Recipe_15_3_Using_Core_Data.xcdatamodel/contents new file mode 100644 index 0000000..6170aa4 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Recipe_15_3_Using_Core_Data.xcdatamodeld/Recipe_15_3_Using_Core_Data.xcdatamodel/contents @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Vocabulary.h b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Vocabulary.h new file mode 100644 index 0000000..199853e --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Vocabulary.h @@ -0,0 +1,26 @@ +// +// Vocabulary.h +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + + +@interface Vocabulary : NSManagedObject + +@property (nonatomic, retain) NSString * name; +@property (nonatomic, retain) NSSet *words; +@end + +@interface Vocabulary (CoreDataGeneratedAccessors) + +- (void)addWordsObject:(NSManagedObject *)value; +- (void)removeWordsObject:(NSManagedObject *)value; +- (void)addWords:(NSSet *)values; +- (void)removeWords:(NSSet *)values; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Vocabulary.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Vocabulary.m new file mode 100644 index 0000000..277c96a --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/Vocabulary.m @@ -0,0 +1,17 @@ +// +// Vocabulary.m +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "Vocabulary.h" + + +@implementation Vocabulary + +@dynamic name; +@dynamic words; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/main.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/main.m new file mode 100644 index 0000000..4c1b787 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core Data/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/Recipe 15-3 Using Core DataTests-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/Recipe 15-3 Using Core DataTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/Recipe 15-3 Using Core DataTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/Recipe_15_3_Using_Core_DataTests.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/Recipe_15_3_Using_Core_DataTests.m new file mode 100644 index 0000000..c982c87 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/Recipe_15_3_Using_Core_DataTests.m @@ -0,0 +1,34 @@ +// +// Recipe_15_3_Using_Core_DataTests.m +// Recipe 15-3 Using Core DataTests +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_15_3_Using_Core_DataTests : XCTestCase + +@end + +@implementation Recipe_15_3_Using_Core_DataTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Recipe 15-3 Using Core DataTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/VocabulariesViewController.h b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/VocabulariesViewController.h new file mode 100644 index 0000000..883c07c --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/VocabulariesViewController.h @@ -0,0 +1,20 @@ +// +// VocabulariesViewController.h +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "Vocabulary.h" +#import "WordsviewController.h" + +@interface VocabulariesViewController : UITableViewController + +@property (strong,nonatomic) NSManagedObjectContext *managedObjectContext; +@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; + +-(id)initWithManagedObjectContext:(NSManagedObjectContext *)context; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/VocabulariesViewController.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/VocabulariesViewController.m new file mode 100644 index 0000000..f0e1cfc --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/VocabulariesViewController.m @@ -0,0 +1,193 @@ +// +// VocabulariesViewController.m +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "VocabulariesViewController.h" + +@interface VocabulariesViewController () + +@end + +@implementation VocabulariesViewController + +- (id)initWithManagedObjectContext:(NSManagedObjectContext *)context +{ + self = [super initWithStyle:UITableViewStylePlain]; + if (self) + { + self.managedObjectContext = context; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.title = @"Vocabularies"; + + UIBarButtonItem *addButton = + [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd + target:self action:@selector(add)]; + self.navigationItem.rightBarButtonItem = addButton; + + + [self fetchVocabularies]; + + // Preload with a “Spanish” Vocabulary if empty + if (self.fetchedResultsController.fetchedObjects.count == 0) + { + NSEntityDescription *vocabularyEntityDescription = + [NSEntityDescription entityForName:@"Vocabulary" + inManagedObjectContext:self.managedObjectContext]; + Vocabulary *spanishVocabulary = (Vocabulary *)[[NSManagedObject alloc] + initWithEntity:vocabularyEntityDescription + insertIntoManagedObjectContext:self.managedObjectContext]; + spanishVocabulary.name = @"Spanish"; + NSError *error; + if (![self.managedObjectContext save:&error]) + { + NSLog(@"Error saving context: %@", error); + } + [self fetchVocabularies]; + } + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)viewWillAppear:(BOOL)animated +{ + [self fetchVocabularies]; + [self.tableView reloadData]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.fetchedResultsController.fetchedObjects.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"VocabularyCell"; + + UITableViewCell *cell = + [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 + reuseIdentifier:CellIdentifier]; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + + Vocabulary *vocabulary = (Vocabulary *)[self.fetchedResultsController + objectAtIndexPath:indexPath]; + cell.textLabel.text = vocabulary.name; + cell.detailTextLabel.text = + [NSString stringWithFormat:@"(%d)", vocabulary.words.count]; + + return cell; +} + + + +- (void)add +{ + UIAlertView * inputAlert = [[UIAlertView alloc] initWithTitle:@"New Vocabulary" + message:@"Enter a name for the new vocabulary" delegate:self + cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; + inputAlert.alertViewStyle = UIAlertViewStylePlainTextInput; + [inputAlert show]; +} + +#pragma mark - helper methods + +-(void)fetchVocabularies +{ + NSFetchRequest *fetchRequest = + [NSFetchRequest fetchRequestWithEntityName:@"Vocabulary"]; + NSString *cacheName = [@"Vocabulary" stringByAppendingString:@"Cache"]; + + NSSortDescriptor *sortDescriptor = + [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]; + [fetchRequest setSortDescriptors:@[sortDescriptor]]; + + self.fetchedResultsController = [[NSFetchedResultsController alloc] + initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext + sectionNameKeyPath:nil cacheName:cacheName]; + NSError *error; + if (![self.fetchedResultsController performFetch:&error]) + { + NSLog(@"Fetch failed: %@", error); + } +} + +# pragma mark - delegate methods + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex == 1) + { + NSEntityDescription *vocabularyEntityDescription = + [NSEntityDescription entityForName:@"Vocabulary" + inManagedObjectContext:self.managedObjectContext]; + Vocabulary *newVocabulary = (Vocabulary *)[[NSManagedObject alloc] + initWithEntity:vocabularyEntityDescription + insertIntoManagedObjectContext:self.managedObjectContext]; + newVocabulary.name = [alertView textFieldAtIndex:0].text; + NSError *error; + if (![self.managedObjectContext save:&error]) + { + NSLog(@"Error saving context: %@", error); + } + [self fetchVocabularies]; + [self.tableView reloadData]; + } +} + +-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) + { + NSManagedObject *deleted = + [self.fetchedResultsController objectAtIndexPath:indexPath]; + [self.managedObjectContext deleteObject:deleted]; + NSError *error; + BOOL success = [self.managedObjectContext save:&error]; + if (!success) + { + NSLog(@"Error saving context: %@", error); + } + [self fetchVocabularies]; + [self.tableView deleteRowsAtIndexPaths:@[indexPath] + withRowAnimation:UITableViewRowAnimationRight]; + } +} +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + Vocabulary *vocabulary = (Vocabulary *)[self.fetchedResultsController + objectAtIndexPath:indexPath]; + + WordsViewController *detailViewController = + [[WordsViewController alloc] initWithVocabulary:vocabulary]; + [self.navigationController pushViewController:detailViewController animated:YES]; +} + + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Word.h b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Word.h new file mode 100644 index 0000000..275444a --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Word.h @@ -0,0 +1,20 @@ +// +// Word.h +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@class Vocabulary; + +@interface Word : NSManagedObject + +@property (nonatomic, retain) NSString * word; +@property (nonatomic, retain) NSString * translation; +@property (nonatomic, retain) Vocabulary *vocabulary; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Word.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Word.m new file mode 100644 index 0000000..5c9380b --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/Word.m @@ -0,0 +1,19 @@ +// +// Word.m +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "Word.h" +#import "Vocabulary.h" + + +@implementation Word + +@dynamic word; +@dynamic translation; +@dynamic vocabulary; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/WordsViewController.h b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/WordsViewController.h new file mode 100644 index 0000000..b764e85 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/WordsViewController.h @@ -0,0 +1,20 @@ +// +// WordsViewController.h +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "Vocabulary.h" +#import "word.h" +#import "EditWordViewController.h" + +@interface WordsViewController : UITableViewController + +@property (strong, nonatomic) Vocabulary *vocabulary; + +-(id)initWithVocabulary:(Vocabulary *)vocabulary; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/WordsViewController.m b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/WordsViewController.m new file mode 100644 index 0000000..ea1143b --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-3 Using Core Data/WordsViewController.m @@ -0,0 +1,153 @@ +// +// WordsViewController.m +// Recipe 15-3 Using Core Data +// +// Created by joseph hoffman on 9/3/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "WordsViewController.h" + +@interface WordsViewController () + +@end + +@implementation WordsViewController + +- (id)initWithVocabulary:(Vocabulary *)vocabulary +{ + self = [super initWithStyle:UITableViewStylePlain]; + if (self) + { + self.vocabulary = vocabulary; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + UIBarButtonItem *addButton = + [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd + target:self action:@selector(add)]; + self.navigationItem.rightBarButtonItem = addButton; + + self.title = self.vocabulary.name; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.vocabulary.words.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"WordCell"; + + UITableViewCell *cell = + [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle + reuseIdentifier:CellIdentifier]; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + + Word *word = [self.vocabulary.words.allObjects objectAtIndex:indexPath.row]; + cell.textLabel.text = word.word; + cell.detailTextLabel.text = word.translation; + + return cell; +} + +#pragma mark - Table View Delegate Methods + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + Word *word = [self.vocabulary.words.allObjects objectAtIndex:indexPath.row]; + [EditWordViewController editWord:word + inNavigationController:self.navigationController completion: + ^(EditWordViewController *sender, BOOL canceled) + { + NSError *error; + if (![self.vocabulary.managedObjectContext save:&error]) + { + NSLog(@"Error saving context: %@", error); + } + + [self.tableView reloadData]; + [self.navigationController popViewControllerAnimated:YES]; + }]; +} + +-(void)tableView:(UITableView *)tableView +commitEditingStyle:(UITableViewCellEditingStyle)editingStyle +forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) + { + Word *deleted = [self.vocabulary.words.allObjects objectAtIndex:indexPath.row]; + [self.vocabulary.managedObjectContext deleteObject:deleted]; + NSError *error; + BOOL success = [self.vocabulary.managedObjectContext save:&error]; + if (!success) + { + NSLog(@"Error saving context: %@", error); + } + [self.tableView deleteRowsAtIndexPaths:@[indexPath] + withRowAnimation:UITableViewRowAnimationRight]; + } +} + + +- (void)add +{ + NSEntityDescription *wordEntityDescription = + [NSEntityDescription entityForName:@"Word" + inManagedObjectContext:self.vocabulary.managedObjectContext]; + Word *newWord = (Word *)[[NSManagedObject alloc] + initWithEntity:wordEntityDescription + insertIntoManagedObjectContext:self.vocabulary.managedObjectContext]; + + [EditWordViewController editWord:newWord + inNavigationController:self.navigationController completion: + ^(EditWordViewController *sender, BOOL canceled) + { + if (canceled) + { + [self.vocabulary.managedObjectContext deleteObject:newWord]; + } + else + { + [self.vocabulary addWordsObject:newWord]; + + NSError *error; + if (![self.vocabulary.managedObjectContext save:&error]) + { + NSLog(@"Error saving context: %@", error); + } + [self.tableView reloadData]; + } + + [self.navigationController popViewControllerAnimated:YES]; + + }]; +} + + + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/.DS_Store b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/.DS_Store new file mode 100644 index 0000000..cc9b2dc Binary files /dev/null and b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/.DS_Store differ diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/project.pbxproj b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/project.pbxproj new file mode 100644 index 0000000..92dacaf --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/project.pbxproj @@ -0,0 +1,487 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E1C117D7FDEC007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C017D7FDEC007110E0 /* Foundation.framework */; }; + 8848E1C317D7FDEC007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C217D7FDEC007110E0 /* CoreGraphics.framework */; }; + 8848E1C517D7FDEC007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C417D7FDEC007110E0 /* UIKit.framework */; }; + 8848E1CB17D7FDEC007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1C917D7FDEC007110E0 /* InfoPlist.strings */; }; + 8848E1CD17D7FDEC007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1CC17D7FDEC007110E0 /* main.m */; }; + 8848E1D117D7FDEC007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1D017D7FDEC007110E0 /* AppDelegate.m */; }; + 8848E1D417D7FDEC007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1D217D7FDEC007110E0 /* Main.storyboard */; }; + 8848E1D717D7FDEC007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1D617D7FDEC007110E0 /* ViewController.m */; }; + 8848E1D917D7FDEC007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1D817D7FDEC007110E0 /* Images.xcassets */; }; + 8848E1E017D7FDEC007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1DF17D7FDEC007110E0 /* XCTest.framework */; }; + 8848E1E117D7FDEC007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C017D7FDEC007110E0 /* Foundation.framework */; }; + 8848E1E217D7FDEC007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C417D7FDEC007110E0 /* UIKit.framework */; }; + 8848E1EA17D7FDEC007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1E817D7FDEC007110E0 /* InfoPlist.strings */; }; + 8848E1EC17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1EB17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E1E317D7FDEC007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1B517D7FDEC007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E1BC17D7FDEC007110E0; + remoteInfo = "Recipe 15-4 Storing Key-Value Data in iCloud"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E1BD17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 15-4 Storing Key-Value Data in iCloud.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E1C017D7FDEC007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E1C217D7FDEC007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E1C417D7FDEC007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E1C817D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist"; sourceTree = ""; }; + 8848E1CA17D7FDEC007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E1CC17D7FDEC007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E1CE17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch"; sourceTree = ""; }; + 8848E1CF17D7FDEC007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E1D017D7FDEC007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E1D317D7FDEC007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E1D517D7FDEC007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E1D617D7FDEC007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E1D817D7FDEC007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E1DE17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 15-4 Storing Key-Value Data in iCloudTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E1DF17D7FDEC007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E1E717D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist"; sourceTree = ""; }; + 8848E1E917D7FDEC007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E1EB17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m; sourceTree = ""; }; + 8848E1F517D801A4007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Recipe 15-4 Storing Key-Value Data in iCloud.entitlements"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1BA17D7FDEC007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1C317D7FDEC007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E1C517D7FDEC007110E0 /* UIKit.framework in Frameworks */, + 8848E1C117D7FDEC007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E1DB17D7FDEC007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1E017D7FDEC007110E0 /* XCTest.framework in Frameworks */, + 8848E1E217D7FDEC007110E0 /* UIKit.framework in Frameworks */, + 8848E1E117D7FDEC007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1B417D7FDEC007110E0 = { + isa = PBXGroup; + children = ( + 8848E1C617D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud */, + 8848E1E517D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests */, + 8848E1BF17D7FDEC007110E0 /* Frameworks */, + 8848E1BE17D7FDEC007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E1BE17D7FDEC007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E1BD17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud.app */, + 8848E1DE17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E1BF17D7FDEC007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E1C017D7FDEC007110E0 /* Foundation.framework */, + 8848E1C217D7FDEC007110E0 /* CoreGraphics.framework */, + 8848E1C417D7FDEC007110E0 /* UIKit.framework */, + 8848E1DF17D7FDEC007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E1C617D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud */ = { + isa = PBXGroup; + children = ( + 8848E1F517D801A4007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud.entitlements */, + 8848E1CF17D7FDEC007110E0 /* AppDelegate.h */, + 8848E1D017D7FDEC007110E0 /* AppDelegate.m */, + 8848E1D217D7FDEC007110E0 /* Main.storyboard */, + 8848E1D517D7FDEC007110E0 /* ViewController.h */, + 8848E1D617D7FDEC007110E0 /* ViewController.m */, + 8848E1D817D7FDEC007110E0 /* Images.xcassets */, + 8848E1C717D7FDEC007110E0 /* Supporting Files */, + ); + path = "Recipe 15-4 Storing Key-Value Data in iCloud"; + sourceTree = ""; + }; + 8848E1C717D7FDEC007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E1C817D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist */, + 8848E1C917D7FDEC007110E0 /* InfoPlist.strings */, + 8848E1CC17D7FDEC007110E0 /* main.m */, + 8848E1CE17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E1E517D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests */ = { + isa = PBXGroup; + children = ( + 8848E1EB17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m */, + 8848E1E617D7FDEC007110E0 /* Supporting Files */, + ); + path = "Recipe 15-4 Storing Key-Value Data in iCloudTests"; + sourceTree = ""; + }; + 8848E1E617D7FDEC007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E1E717D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist */, + 8848E1E817D7FDEC007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E1BC17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E1EF17D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-4 Storing Key-Value Data in iCloud" */; + buildPhases = ( + 8848E1B917D7FDEC007110E0 /* Sources */, + 8848E1BA17D7FDEC007110E0 /* Frameworks */, + 8848E1BB17D7FDEC007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 15-4 Storing Key-Value Data in iCloud"; + productName = "Recipe 15-4 Storing Key-Value Data in iCloud"; + productReference = 8848E1BD17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud.app */; + productType = "com.apple.product-type.application"; + }; + 8848E1DD17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E1F217D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-4 Storing Key-Value Data in iCloudTests" */; + buildPhases = ( + 8848E1DA17D7FDEC007110E0 /* Sources */, + 8848E1DB17D7FDEC007110E0 /* Frameworks */, + 8848E1DC17D7FDEC007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E1E417D7FDEC007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 15-4 Storing Key-Value Data in iCloudTests"; + productName = "Recipe 15-4 Storing Key-Value Data in iCloudTests"; + productReference = 8848E1DE17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1B517D7FDEC007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E1BC17D7FDEC007110E0 = { + DevelopmentTeam = H7ALWBN8YV; + SystemCapabilities = { + com.apple.iCloud = { + enabled = 1; + }; + }; + }; + 8848E1DD17D7FDEC007110E0 = { + TestTargetID = 8848E1BC17D7FDEC007110E0; + }; + }; + }; + buildConfigurationList = 8848E1B817D7FDEC007110E0 /* Build configuration list for PBXProject "Recipe 15-4 Storing Key-Value Data in iCloud" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1B417D7FDEC007110E0; + productRefGroup = 8848E1BE17D7FDEC007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E1BC17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud */, + 8848E1DD17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloudTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E1BB17D7FDEC007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1D917D7FDEC007110E0 /* Images.xcassets in Resources */, + 8848E1CB17D7FDEC007110E0 /* InfoPlist.strings in Resources */, + 8848E1D417D7FDEC007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E1DC17D7FDEC007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1EA17D7FDEC007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1B917D7FDEC007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1D717D7FDEC007110E0 /* ViewController.m in Sources */, + 8848E1D117D7FDEC007110E0 /* AppDelegate.m in Sources */, + 8848E1CD17D7FDEC007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E1DA17D7FDEC007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1EC17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E1E417D7FDEC007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E1BC17D7FDEC007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud */; + targetProxy = 8848E1E317D7FDEC007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E1C917D7FDEC007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E1CA17D7FDEC007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E1D217D7FDEC007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E1D317D7FDEC007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E1E817D7FDEC007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E1E917D7FDEC007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E1ED17D7FDEC007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E1EE17D7FDEC007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E1F017D7FDEC007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_ENTITLEMENTS = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E1F117D7FDEC007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_ENTITLEMENTS = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E1F317D7FDEC007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-4 Storing Key-Value Data in iCloud.app/Recipe 15-4 Storing Key-Value Data in iCloud"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E1F417D7FDEC007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-4 Storing Key-Value Data in iCloud.app/Recipe 15-4 Storing Key-Value Data in iCloud"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1B817D7FDEC007110E0 /* Build configuration list for PBXProject "Recipe 15-4 Storing Key-Value Data in iCloud" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E1ED17D7FDEC007110E0 /* Debug */, + 8848E1EE17D7FDEC007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E1EF17D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-4 Storing Key-Value Data in iCloud" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E1F017D7FDEC007110E0 /* Debug */, + 8848E1F117D7FDEC007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8848E1F217D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-4 Storing Key-Value Data in iCloudTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E1F317D7FDEC007110E0 /* Debug */, + 8848E1F417D7FDEC007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1B517D7FDEC007110E0 /* Project object */; +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..2408513 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..7b621ad --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..3064ee7 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 15-4 Storing Key-Value Data in iCloud.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E1BC17D7FDEC007110E0 + + primary + + + 8848E1DD17D7FDEC007110E0 + + primary + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.h b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.h new file mode 100644 index 0000000..9c29b4f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 15-4 Storing Key-Value Data in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.m b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.m new file mode 100644 index 0000000..1294af1 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 15-4 Storing Key-Value Data in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Base.lproj/Main.storyboard b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ba26af7 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Base.lproj/Main.storyboard @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/AppIcon.appiconset/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist new file mode 100644 index 0000000..426b098 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements new file mode 100644 index 0000000..5f2872e --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.developer.ubiquity-container-identifiers + + $(TeamIdentifierPrefix)com.NSCookbook.Recipe-15-4-Storing-Key-Value-Data-in-iCloud + + com.apple.developer.ubiquity-kvstore-identifier + $(TeamIdentifierPrefix)$(CFBundleIdentifier) + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.h b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.h new file mode 100644 index 0000000..2a7567d --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.h @@ -0,0 +1,21 @@ +// +// ViewController.h +// Recipe 15-4 Storing Key-Value Data in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UISegmentedControl *fontSizeSegmentedControl; +@property (weak, nonatomic) IBOutlet UITextView *documentTextView; +@property (strong, nonatomic) NSUbiquitousKeyValueStore *iCloudKeyValueStore; +@property (strong, nonatomic) NSUserDefaults *userDefaults; + +- (IBAction)updateTextSize:(id)sender; + +- (IBAction)saveDocument:(id)sender; +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.m b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.m new file mode 100644 index 0000000..d3663e5 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.m @@ -0,0 +1,91 @@ +// +// ViewController.m +// Recipe 15-4 Storing Key-Value Data in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.iCloudKeyValueStore = [NSUbiquitousKeyValueStore defaultStore]; + self.userDefaults = [NSUserDefaults standardUserDefaults]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleStoreChange:) + name:NSUbiquitousKeyValueStoreDidChangeExternallyNotification + object:self.iCloudKeyValueStore]; + + [self.iCloudKeyValueStore synchronize]; + [self updateUserInterfaceWithPreferences]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)updateTextSize:(id)sender +{ + CGFloat newFontSize; + switch (self.fontSizeSegmentedControl.selectedSegmentIndex) + { + case 1: + newFontSize = 19; + break; + case 2: + newFontSize = 24; + break; + + default: + newFontSize = 14; + break; + } + self.documentTextView.font = [UIFont systemFontOfSize:newFontSize]; + // Update Preferences + NSInteger selectedSize = self.fontSizeSegmentedControl.selectedSegmentIndex; + [self.userDefaults setDouble:selectedSize forKey:@"TextSize"]; + [self.userDefaults synchronize]; + + [self.iCloudKeyValueStore setDouble:selectedSize forKey:@"TextSize"]; + +} + +- (void)handleStoreChange:(NSNotification *)notification +{ + [self updateUserInterfaceWithPreferences]; +} + +- (void)updateUserInterfaceWithPreferences +{ + NSInteger selectedSize; + + if ([self.iCloudKeyValueStore objectForKey:@"TextSize"] != nil) + { + // iCloud value exists + selectedSize = [self.iCloudKeyValueStore doubleForKey:@"TextSize"]; + // Make sure local cache is synced + [self.userDefaults setDouble:selectedSize forKey:@"TextSize"]; + [self.userDefaults synchronize]; + } + else + { + // iCloud unavailable, use value from local cache + selectedSize = [self.userDefaults doubleForKey:@"TextSize"]; + } + + self.fontSizeSegmentedControl.selectedSegmentIndex = selectedSize; + [self updateTextSize:self]; +} + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/main.m b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/main.m new file mode 100644 index 0000000..f560a83 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 15-4 Storing Key-Value Data in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-4 Storing Key-Value Data in iCloudTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m new file mode 100644 index 0000000..18bb41a --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m @@ -0,0 +1,34 @@ +// +// Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m +// Recipe 15-4 Storing Key-Value Data in iCloudTests +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests : XCTestCase + +@end + +@implementation Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/.DS_Store b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/.DS_Store new file mode 100644 index 0000000..9870b08 Binary files /dev/null and b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/.DS_Store differ diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.h b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.h new file mode 100644 index 0000000..9341e79 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 15-5 Storing UIDocuments in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.m b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.m new file mode 100644 index 0000000..e753fb3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 15-5 Storing UIDocuments in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Base.lproj/Main.storyboard b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Base.lproj/Main.storyboard new file mode 100644 index 0000000..a72e2d0 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Base.lproj/Main.storyboard @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/AppIcon.appiconset/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/MyDocument.h b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/MyDocument.h new file mode 100644 index 0000000..bfa0650 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/MyDocument.h @@ -0,0 +1,22 @@ +// +// MyDocument.h +// Recipe 15-5 Storing UIDocuments in iCloud +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@class MyDocument; + +@protocol MyDocumentDelegate +- (void)documentDidChange:(MyDocument*)document; +@end + +@interface MyDocument : UIDocument + +@property (strong, nonatomic) NSString *text; +@property (weak, nonatomic) id delegate; + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/MyDocument.m b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/MyDocument.m new file mode 100644 index 0000000..e547418 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/MyDocument.m @@ -0,0 +1,36 @@ +// +// MyDocument.m +// Recipe 15-5 Storing UIDocuments in iCloud +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MyDocument.h" + +@implementation MyDocument + +- (id)contentsForType:(NSString *)typeName error:(NSError *__autoreleasing *)outError +{ + if (!self.text) + self.text = @""; + return [self.text dataUsingEncoding:NSUTF8StringEncoding]; +} +-(BOOL) loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError *__autoreleasing *)outError +{ + if ([contents length] > 0) + { + self.text = [[NSString alloc] initWithBytes:[contents bytes] length:[contents length] encoding:NSUTF8StringEncoding]; + } + else + { + self.text = @""; + } + + [self.delegate documentDidChange:self]; + + return YES; +} + + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements new file mode 100644 index 0000000..5f2872e --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.developer.ubiquity-container-identifiers + + $(TeamIdentifierPrefix)com.NSCookbook.Recipe-15-4-Storing-Key-Value-Data-in-iCloud + + com.apple.developer.ubiquity-kvstore-identifier + $(TeamIdentifierPrefix)$(CFBundleIdentifier) + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Info.plist new file mode 100644 index 0000000..426b098 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.h b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.h new file mode 100644 index 0000000..fccaa0d --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.h @@ -0,0 +1,23 @@ +// +// ViewController.h +// Recipe 15-5 Storing UIDocuments in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "MyDocument.h" + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UISegmentedControl *fontSizeSegmentedControl; +@property (weak, nonatomic) IBOutlet UITextView *documentTextView; +@property (strong, nonatomic) NSUbiquitousKeyValueStore *iCloudKeyValueStore; +@property (strong, nonatomic) NSUserDefaults *userDefaults; +@property (strong, nonatomic) MyDocument *document; +@property (strong, nonatomic) NSURL *documentURL; + +- (IBAction)saveDocument:(id)sender; +- (IBAction)updateTextSize:(id)sender; +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.m b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.m new file mode 100644 index 0000000..7996740 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/ViewController.m @@ -0,0 +1,173 @@ +// +// ViewController.m +// Recipe 15-5 Storing UIDocuments in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.iCloudKeyValueStore = [NSUbiquitousKeyValueStore defaultStore]; + self.userDefaults = [NSUserDefaults standardUserDefaults]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleStoreChange:) + name:NSUbiquitousKeyValueStoreDidChangeExternallyNotification + object:self.iCloudKeyValueStore]; + + [self.iCloudKeyValueStore synchronize]; + [self updateUserInterfaceWithPreferences]; + + [self updateDocument]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (IBAction)saveDocument:(id)sender +{ + if (self.document) + { + self.document.text = self.documentTextView.text; + [self.document saveToURL:self.documentURL + forSaveOperation:UIDocumentSaveForOverwriting completionHandler: + ^(BOOL success) + { + if (success) + { + NSLog(@"Written to iCloud"); + } + else + { + NSLog(@"Error writing to iCloud"); + } + }]; + } +} + +- (IBAction)updateTextSize:(id)sender +{ + CGFloat newFontSize; + switch (self.fontSizeSegmentedControl.selectedSegmentIndex) + { + case 1: + newFontSize = 19; + break; + case 2: + newFontSize = 24; + break; + + default: + newFontSize = 14; + break; + } + self.documentTextView.font = [UIFont systemFontOfSize:newFontSize]; + // Update Preferences + NSInteger selectedSize = self.fontSizeSegmentedControl.selectedSegmentIndex; + [self.userDefaults setDouble:selectedSize forKey:@"TextSize"]; + [self.userDefaults synchronize]; + + [self.iCloudKeyValueStore setDouble:selectedSize forKey:@"TextSize"]; + +} + +- (void)handleStoreChange:(NSNotification *)notification +{ + [self updateUserInterfaceWithPreferences]; +} + +- (void)updateUserInterfaceWithPreferences +{ + NSInteger selectedSize; + + if ([self.iCloudKeyValueStore objectForKey:@"TextSize"] != nil) + { + // iCloud value exists + selectedSize = [self.iCloudKeyValueStore doubleForKey:@"TextSize"]; + // Make sure local cache is synced + [self.userDefaults setDouble:selectedSize forKey:@"TextSize"]; + [self.userDefaults synchronize]; + } + else + { + // iCloud unavailable, use value from local cache + selectedSize = [self.userDefaults doubleForKey:@"TextSize"]; + } + + self.fontSizeSegmentedControl.selectedSegmentIndex = selectedSize; + [self updateTextSize:self]; +} + +- (void)updateDocument +{ + NSFileManager *fileManager = [NSFileManager defaultManager]; + id iCloudToken = [fileManager ubiquityIdentityToken]; + if (iCloudToken) + { + // iCloud available + + // Register to notifications for changes in availability + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleICloudDidChangeIdentity:) + name:NSUbiquityIdentityDidChangeNotification object:nil]; + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), + ^{ + NSURL *documentContainer = [[fileManager URLForUbiquityContainerIdentifier:nil] + URLByAppendingPathComponent:@"Documents"]; + + if (documentContainer != nil) + { + self.documentURL = + [documentContainer URLByAppendingPathComponent:@"mydocument.txt"]; + self.document = + [[MyDocument alloc] initWithFileURL:self.documentURL]; + self.document.delegate = self; + // If the file exists, open it; otherwise, create it. + if ([fileManager fileExistsAtPath:self.documentURL.path]) + [self.document openWithCompletionHandler:nil]; + else + [self.document saveToURL:self.documentURL + forSaveOperation:UIDocumentSaveForCreating + completionHandler:nil]; + } + }); + } + else + { + // No iCloud access + self.documentURL = nil; + self.document = nil; + self.documentTextView.text = @""; + } +} + + +- (void)handleICloudDidChangeIdentity: (NSNotification *)notification +{ + NSLog(@"ID changed"); + [self updateDocument]; +} + +- (void)documentDidChange:(MyDocument *)document +{ + dispatch_async(dispatch_get_main_queue(), + ^{ + self.documentTextView.text = document.text; + }); +} + + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/main.m b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/main.m new file mode 100644 index 0000000..f560a83 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 15-4 Storing Key-Value Data in iCloud +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m new file mode 100644 index 0000000..18bb41a --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m @@ -0,0 +1,34 @@ +// +// Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m +// Recipe 15-4 Storing Key-Value Data in iCloudTests +// +// Created by joseph hoffman on 9/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests : XCTestCase + +@end + +@implementation Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/en.lproj/InfoPlist.strings b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-4 Storing Key-Value Data in iCloudTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.pbxproj b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6c6c010 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.pbxproj @@ -0,0 +1,497 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E1C117D7FDEC007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C017D7FDEC007110E0 /* Foundation.framework */; }; + 8848E1C317D7FDEC007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C217D7FDEC007110E0 /* CoreGraphics.framework */; }; + 8848E1C517D7FDEC007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C417D7FDEC007110E0 /* UIKit.framework */; }; + 8848E1CB17D7FDEC007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1C917D7FDEC007110E0 /* InfoPlist.strings */; }; + 8848E1CD17D7FDEC007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1CC17D7FDEC007110E0 /* main.m */; }; + 8848E1D117D7FDEC007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1D017D7FDEC007110E0 /* AppDelegate.m */; }; + 8848E1D417D7FDEC007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1D217D7FDEC007110E0 /* Main.storyboard */; }; + 8848E1D717D7FDEC007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1D617D7FDEC007110E0 /* ViewController.m */; }; + 8848E1D917D7FDEC007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1D817D7FDEC007110E0 /* Images.xcassets */; }; + 8848E1E017D7FDEC007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1DF17D7FDEC007110E0 /* XCTest.framework */; }; + 8848E1E117D7FDEC007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C017D7FDEC007110E0 /* Foundation.framework */; }; + 8848E1E217D7FDEC007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E1C417D7FDEC007110E0 /* UIKit.framework */; }; + 8848E1EA17D7FDEC007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E1E817D7FDEC007110E0 /* InfoPlist.strings */; }; + 8848E1EC17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1EB17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m */; }; + 8848E1F817D952F9007110E0 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E1F717D952F9007110E0 /* MyDocument.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E1E317D7FDEC007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1B517D7FDEC007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E1BC17D7FDEC007110E0; + remoteInfo = "Recipe 15-4 Storing Key-Value Data in iCloud"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E1BD17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 15-5 Storing UIDocuments in iCloud.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E1C017D7FDEC007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E1C217D7FDEC007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E1C417D7FDEC007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E1C817D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-5 Storing UIDocuments in iCloud-Info.plist"; sourceTree = ""; }; + 8848E1CA17D7FDEC007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E1CC17D7FDEC007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E1CE17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch"; sourceTree = ""; }; + 8848E1CF17D7FDEC007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E1D017D7FDEC007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E1D317D7FDEC007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E1D517D7FDEC007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E1D617D7FDEC007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E1D817D7FDEC007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E1DE17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloudTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 15-5 Storing UIDocuments in iCloudTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E1DF17D7FDEC007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E1E717D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist"; sourceTree = ""; }; + 8848E1E917D7FDEC007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E1EB17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m; sourceTree = ""; }; + 8848E1F517D801A4007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Recipe 15-4 Storing Key-Value Data in iCloud.entitlements"; sourceTree = ""; }; + 8848E1F617D952F9007110E0 /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = ""; }; + 8848E1F717D952F9007110E0 /* MyDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocument.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1BA17D7FDEC007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1C317D7FDEC007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E1C517D7FDEC007110E0 /* UIKit.framework in Frameworks */, + 8848E1C117D7FDEC007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E1DB17D7FDEC007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1E017D7FDEC007110E0 /* XCTest.framework in Frameworks */, + 8848E1E217D7FDEC007110E0 /* UIKit.framework in Frameworks */, + 8848E1E117D7FDEC007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1B417D7FDEC007110E0 = { + isa = PBXGroup; + children = ( + 8848E1C617D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud */, + 8848E1E517D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud */, + 8848E1BF17D7FDEC007110E0 /* Frameworks */, + 8848E1BE17D7FDEC007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E1BE17D7FDEC007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E1BD17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud.app */, + 8848E1DE17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloudTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E1BF17D7FDEC007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E1C017D7FDEC007110E0 /* Foundation.framework */, + 8848E1C217D7FDEC007110E0 /* CoreGraphics.framework */, + 8848E1C417D7FDEC007110E0 /* UIKit.framework */, + 8848E1DF17D7FDEC007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E1C617D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud */ = { + isa = PBXGroup; + children = ( + 8848E1F517D801A4007110E0 /* Recipe 15-4 Storing Key-Value Data in iCloud.entitlements */, + 8848E1CF17D7FDEC007110E0 /* AppDelegate.h */, + 8848E1D017D7FDEC007110E0 /* AppDelegate.m */, + 8848E1D217D7FDEC007110E0 /* Main.storyboard */, + 8848E1D517D7FDEC007110E0 /* ViewController.h */, + 8848E1F617D952F9007110E0 /* MyDocument.h */, + 8848E1F717D952F9007110E0 /* MyDocument.m */, + 8848E1D617D7FDEC007110E0 /* ViewController.m */, + 8848E1D817D7FDEC007110E0 /* Images.xcassets */, + 8848E1C717D7FDEC007110E0 /* Supporting Files */, + ); + name = "Recipe 15-5 Storing UIDocuments in iCloud"; + path = "Recipe 15-4 Storing Key-Value Data in iCloud"; + sourceTree = ""; + }; + 8848E1C717D7FDEC007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E1C817D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud-Info.plist */, + 8848E1C917D7FDEC007110E0 /* InfoPlist.strings */, + 8848E1CC17D7FDEC007110E0 /* main.m */, + 8848E1CE17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E1E517D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud */ = { + isa = PBXGroup; + children = ( + 8848E1EB17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m */, + 8848E1E617D7FDEC007110E0 /* Supporting Files */, + ); + name = "Recipe 15-5 Storing UIDocuments in iCloud"; + path = "Recipe 15-4 Storing Key-Value Data in iCloudTests"; + sourceTree = ""; + }; + 8848E1E617D7FDEC007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E1E717D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist */, + 8848E1E817D7FDEC007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E1BC17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E1EF17D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-5 Storing UIDocuments in iCloud" */; + buildPhases = ( + 8848E1B917D7FDEC007110E0 /* Sources */, + 8848E1BA17D7FDEC007110E0 /* Frameworks */, + 8848E1BB17D7FDEC007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 15-5 Storing UIDocuments in iCloud"; + productName = "Recipe 15-4 Storing Key-Value Data in iCloud"; + productReference = 8848E1BD17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud.app */; + productType = "com.apple.product-type.application"; + }; + 8848E1DD17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloudTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E1F217D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-5 Storing UIDocuments in iCloudTests" */; + buildPhases = ( + 8848E1DA17D7FDEC007110E0 /* Sources */, + 8848E1DB17D7FDEC007110E0 /* Frameworks */, + 8848E1DC17D7FDEC007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E1E417D7FDEC007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 15-5 Storing UIDocuments in iCloudTests"; + productName = "Recipe 15-4 Storing Key-Value Data in iCloudTests"; + productReference = 8848E1DE17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloudTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1B517D7FDEC007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E1BC17D7FDEC007110E0 = { + DevelopmentTeam = H7ALWBN8YV; + SystemCapabilities = { + com.apple.iCloud = { + enabled = 1; + }; + }; + }; + 8848E1DD17D7FDEC007110E0 = { + TestTargetID = 8848E1BC17D7FDEC007110E0; + }; + }; + }; + buildConfigurationList = 8848E1B817D7FDEC007110E0 /* Build configuration list for PBXProject "Recipe 15-5 Storing UIDocuments in iCloud" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1B417D7FDEC007110E0; + productRefGroup = 8848E1BE17D7FDEC007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E1BC17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud */, + 8848E1DD17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloudTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E1BB17D7FDEC007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1D917D7FDEC007110E0 /* Images.xcassets in Resources */, + 8848E1CB17D7FDEC007110E0 /* InfoPlist.strings in Resources */, + 8848E1D417D7FDEC007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E1DC17D7FDEC007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1EA17D7FDEC007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1B917D7FDEC007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1F817D952F9007110E0 /* MyDocument.m in Sources */, + 8848E1D717D7FDEC007110E0 /* ViewController.m in Sources */, + 8848E1D117D7FDEC007110E0 /* AppDelegate.m in Sources */, + 8848E1CD17D7FDEC007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E1DA17D7FDEC007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E1EC17D7FDEC007110E0 /* Recipe_15_4_Storing_Key_Value_Data_in_iCloudTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E1E417D7FDEC007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E1BC17D7FDEC007110E0 /* Recipe 15-5 Storing UIDocuments in iCloud */; + targetProxy = 8848E1E317D7FDEC007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E1C917D7FDEC007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E1CA17D7FDEC007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E1D217D7FDEC007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E1D317D7FDEC007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E1E817D7FDEC007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E1E917D7FDEC007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E1ED17D7FDEC007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E1EE17D7FDEC007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E1F017D7FDEC007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_ENTITLEMENTS = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Info.plist"; + PRODUCT_NAME = "Recipe 15-5 Storing UIDocuments in iCloud"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E1F117D7FDEC007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_ENTITLEMENTS = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-5 Storing UIDocuments in iCloud-Info.plist"; + PRODUCT_NAME = "Recipe 15-5 Storing UIDocuments in iCloud"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E1F317D7FDEC007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-4 Storing Key-Value Data in iCloud.app/Recipe 15-4 Storing Key-Value Data in iCloud"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist"; + PRODUCT_NAME = "Recipe 15-5 Storing UIDocuments in iCloudTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E1F417D7FDEC007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 15-4 Storing Key-Value Data in iCloud.app/Recipe 15-4 Storing Key-Value Data in iCloud"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 15-4 Storing Key-Value Data in iCloud/Recipe 15-4 Storing Key-Value Data in iCloud-Prefix.pch"; + INFOPLIST_FILE = "Recipe 15-4 Storing Key-Value Data in iCloudTests/Recipe 15-5 Storing UIDocuments in iCloudTests-Info.plist"; + PRODUCT_NAME = "Recipe 15-5 Storing UIDocuments in iCloudTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1B817D7FDEC007110E0 /* Build configuration list for PBXProject "Recipe 15-5 Storing UIDocuments in iCloud" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E1ED17D7FDEC007110E0 /* Debug */, + 8848E1EE17D7FDEC007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E1EF17D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-5 Storing UIDocuments in iCloud" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E1F017D7FDEC007110E0 /* Debug */, + 8848E1F117D7FDEC007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E1F217D7FDEC007110E0 /* Build configuration list for PBXNativeTarget "Recipe 15-5 Storing UIDocuments in iCloudTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E1F317D7FDEC007110E0 /* Debug */, + 8848E1F417D7FDEC007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1B517D7FDEC007110E0 /* Project object */; +} diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a9c4f03 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..1c14726 Binary files /dev/null and b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..c5f7f9d --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..3064ee7 --- /dev/null +++ b/CH15 - Data Storage Recipes/Recipe 15-5 Storing UIDocuments in iCloud/Recipe 15-5 Storing UIDocuments in iCloud.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 15-4 Storing Key-Value Data in iCloud.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E1BC17D7FDEC007110E0 + + primary + + + 8848E1DD17D7FDEC007110E0 + + primary + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/.DS_Store b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/.DS_Store new file mode 100644 index 0000000..f599378 Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/.DS_Store differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.pbxproj b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fd99ced --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20717D9749D007110E0 /* CoreGraphics.framework */; }; + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E20E17D9749D007110E0 /* InfoPlist.strings */; }; + 8848E21217D9749D007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21117D9749D007110E0 /* main.m */; }; + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21517D9749D007110E0 /* AppDelegate.m */; }; + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21717D9749D007110E0 /* Main.storyboard */; }; + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21B17D9749D007110E0 /* ViewController.m */; }; + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21D17D9749D007110E0 /* Images.xcassets */; }; + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E22417D9749E007110E0 /* XCTest.framework */; }; + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E22D17D9749E007110E0 /* InfoPlist.strings */; }; + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */; }; + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E23A17D97946007110E0 /* MessageUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E22817D9749E007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1FA17D9749D007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E20117D9749D007110E0; + remoteInfo = "Recipe 16-1: Composing Text Messages"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E20217D9749D007110E0 /* Recipe 16-1 Composing Text Messages.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 16-1 Composing Text Messages.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E20517D9749D007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E20717D9749D007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E20917D9749D007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E20D17D9749D007110E0 /* Recipe 16-1 Composing Text Messages-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-1 Composing Text Messages-Info.plist"; sourceTree = ""; }; + 8848E20F17D9749D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E21117D9749D007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E21317D9749D007110E0 /* Recipe 16-1 Composing Text Messages-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 16-1 Composing Text Messages-Prefix.pch"; sourceTree = ""; }; + 8848E21417D9749D007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E21517D9749D007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E21817D9749D007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E21A17D9749D007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E21B17D9749D007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E21D17D9749D007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E22317D9749E007110E0 /* Recipe 16-1 Composing Text MessagesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 16-1 Composing Text MessagesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E22417D9749E007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E22C17D9749E007110E0 /* Recipe 16-1 Composing Text MessagesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-1 Composing Text MessagesTests-Info.plist"; sourceTree = ""; }; + 8848E22E17D9749E007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_16_1__Composing_Text_MessagesTests.m; sourceTree = ""; }; + 8848E23A17D97946007110E0 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1FF17D9749D007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */, + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */, + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22017D9749E007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */, + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */, + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1F917D9749D007110E0 = { + isa = PBXGroup; + children = ( + 8848E20B17D9749D007110E0 /* Recipe 16-1: Composing Text Messages */, + 8848E22A17D9749E007110E0 /* Recipe 16-1: Composing Text MessagesTests */, + 8848E20417D9749D007110E0 /* Frameworks */, + 8848E20317D9749D007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E20317D9749D007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E20217D9749D007110E0 /* Recipe 16-1 Composing Text Messages.app */, + 8848E22317D9749E007110E0 /* Recipe 16-1 Composing Text MessagesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E20417D9749D007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E23A17D97946007110E0 /* MessageUI.framework */, + 8848E20517D9749D007110E0 /* Foundation.framework */, + 8848E20717D9749D007110E0 /* CoreGraphics.framework */, + 8848E20917D9749D007110E0 /* UIKit.framework */, + 8848E22417D9749E007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E20B17D9749D007110E0 /* Recipe 16-1: Composing Text Messages */ = { + isa = PBXGroup; + children = ( + 8848E21417D9749D007110E0 /* AppDelegate.h */, + 8848E21517D9749D007110E0 /* AppDelegate.m */, + 8848E21717D9749D007110E0 /* Main.storyboard */, + 8848E21A17D9749D007110E0 /* ViewController.h */, + 8848E21B17D9749D007110E0 /* ViewController.m */, + 8848E21D17D9749D007110E0 /* Images.xcassets */, + 8848E20C17D9749D007110E0 /* Supporting Files */, + ); + path = "Recipe 16-1: Composing Text Messages"; + sourceTree = ""; + }; + 8848E20C17D9749D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E20D17D9749D007110E0 /* Recipe 16-1 Composing Text Messages-Info.plist */, + 8848E20E17D9749D007110E0 /* InfoPlist.strings */, + 8848E21117D9749D007110E0 /* main.m */, + 8848E21317D9749D007110E0 /* Recipe 16-1 Composing Text Messages-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E22A17D9749E007110E0 /* Recipe 16-1: Composing Text MessagesTests */ = { + isa = PBXGroup; + children = ( + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */, + 8848E22B17D9749E007110E0 /* Supporting Files */, + ); + path = "Recipe 16-1: Composing Text MessagesTests"; + sourceTree = ""; + }; + 8848E22B17D9749E007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E22C17D9749E007110E0 /* Recipe 16-1 Composing Text MessagesTests-Info.plist */, + 8848E22D17D9749E007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E20117D9749D007110E0 /* Recipe 16-1 Composing Text Messages */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-1 Composing Text Messages" */; + buildPhases = ( + 8848E1FE17D9749D007110E0 /* Sources */, + 8848E1FF17D9749D007110E0 /* Frameworks */, + 8848E20017D9749D007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 16-1 Composing Text Messages"; + productName = "Recipe 16-1: Composing Text Messages"; + productReference = 8848E20217D9749D007110E0 /* Recipe 16-1 Composing Text Messages.app */; + productType = "com.apple.product-type.application"; + }; + 8848E22217D9749E007110E0 /* Recipe 16-1 Composing Text MessagesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-1 Composing Text MessagesTests" */; + buildPhases = ( + 8848E21F17D9749E007110E0 /* Sources */, + 8848E22017D9749E007110E0 /* Frameworks */, + 8848E22117D9749E007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E22917D9749E007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 16-1 Composing Text MessagesTests"; + productName = "Recipe 16-1: Composing Text MessagesTests"; + productReference = 8848E22317D9749E007110E0 /* Recipe 16-1 Composing Text MessagesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1FA17D9749D007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E22217D9749E007110E0 = { + TestTargetID = 8848E20117D9749D007110E0; + }; + }; + }; + buildConfigurationList = 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-1 Composing Text Messages" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1F917D9749D007110E0; + productRefGroup = 8848E20317D9749D007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E20117D9749D007110E0 /* Recipe 16-1 Composing Text Messages */, + 8848E22217D9749E007110E0 /* Recipe 16-1 Composing Text MessagesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E20017D9749D007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */, + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */, + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22117D9749E007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1FE17D9749D007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */, + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */, + 8848E21217D9749D007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E21F17D9749E007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E22917D9749E007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E20117D9749D007110E0 /* Recipe 16-1 Composing Text Messages */; + targetProxy = 8848E22817D9749E007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E20E17D9749D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E20F17D9749D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E21717D9749D007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E21817D9749D007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E22D17D9749E007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E22E17D9749E007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E23217D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E23317D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E23517D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1 Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-1 Composing Text Messages-Info.plist"; + PRODUCT_NAME = "Recipe 16-1 Composing Text Messages"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E23617D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1 Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-1 Composing Text Messages-Info.plist"; + PRODUCT_NAME = "Recipe 16-1 Composing Text Messages"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E23817D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-1 Composing Text MessagesTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-1 Composing Text MessagesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E23917D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-1 Composing Text MessagesTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-1 Composing Text MessagesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-1 Composing Text Messages" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23217D9749E007110E0 /* Debug */, + 8848E23317D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-1 Composing Text Messages" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23517D9749E007110E0 /* Debug */, + 8848E23617D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-1 Composing Text MessagesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23817D9749E007110E0 /* Debug */, + 8848E23917D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1FA17D9749D007110E0 /* Project object */; +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..5af1132 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..6656af8 Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme new file mode 100644 index 0000000..4d53c3d --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f631445 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 16-1: Composing Text Messages.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E20117D9749D007110E0 + + primary + + + 8848E22217D9749E007110E0 + + primary + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/AppDelegate.h b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/AppDelegate.h new file mode 100644 index 0000000..9384786 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/AppDelegate.m b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/AppDelegate.m new file mode 100644 index 0000000..34290e4 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard new file mode 100644 index 0000000..451fa5c --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages-Info.plist new file mode 100644 index 0000000..43c2e3f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages-Prefix.pch b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/Recipe 16-1 Composing Text Messages-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/ViewController.h b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/ViewController.h new file mode 100644 index 0000000..bbc3eca --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextView *inputTextView; +@property (weak, nonatomic) IBOutlet UIButton *textMessageButton; + +- (IBAction)textMessage:(id)sender; +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/ViewController.m b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/ViewController.m new file mode 100644 index 0000000..1cf49fa --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/ViewController.m @@ -0,0 +1,95 @@ +// +// ViewController.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.inputTextView.layer.cornerRadius = 15.0; + self.inputTextView.delegate = self; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(textMessagingAvailabilityChanged:) + name:MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification + object:nil]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)textMessage:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + MFMessageComposeViewController *messageVC = + [[MFMessageComposeViewController alloc] init]; + messageVC.messageComposeDelegate = self; + messageVC.recipients = @[@"3015555309"]; + messageVC.body = self.inputTextView.text; + [self presentViewController:messageVC animated:YES completion:nil]; + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + +#pragma mark - helper methods + +-(void)textMessagingAvailabilityChange:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + NSLog(@"Text Messaging Available"); + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + + +#pragma mark - Delegate methods + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)text +{ + if ([text isEqualToString:@"\n"]) + { + [textView resignFirstResponder]; + return NO; + } + return YES; +} + +-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result +{ + if (result == MessageComposeResultSent) + { + self.inputTextView.text = @"Message sent."; + } + else if (result == MessageComposeResultFailed) + { + NSLog(@"Failed to send message!"); + } + [self dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/main.m b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/main.m new file mode 100644 index 0000000..7808d8e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text Messages/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-1 Composing Text MessagesTests-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-1 Composing Text MessagesTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-1 Composing Text MessagesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m new file mode 100644 index 0000000..4c8c8d8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_16_1__Composing_Text_MessagesTests.m +// Recipe 16-1: Composing Text MessagesTests +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_16_1__Composing_Text_MessagesTests : XCTestCase + +@end + +@implementation Recipe_16_1__Composing_Text_MessagesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-1_ Composing Text Messages/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/.DS_Store b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/.DS_Store new file mode 100644 index 0000000..8943a91 Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/.DS_Store differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/AppDelegate.h b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/AppDelegate.h new file mode 100644 index 0000000..d131fe1 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 16-2 Composing Email +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/AppDelegate.m b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/AppDelegate.m new file mode 100644 index 0000000..39ff2ad --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 16-2 Composing Email +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard new file mode 100644 index 0000000..0ad37fb --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Recipe 16-2 Composing Email-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Recipe 16-2 Composing Email-Info.plist new file mode 100644 index 0000000..43c2e3f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Recipe 16-2 Composing Email-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Recipe 16-2 Composing Email-Prefix.pch b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Recipe 16-2 Composing Email-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/Recipe 16-2 Composing Email-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/ViewController.h b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/ViewController.h new file mode 100644 index 0000000..672007a --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/ViewController.h @@ -0,0 +1,29 @@ +// +// ViewController.h +// Recipe 16-2 Composing Email +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextView *inputTextView; +@property (weak, nonatomic) IBOutlet UIButton *textMessageButton; +@property (weak, nonatomic) IBOutlet UIButton *mailMessageButton; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *getImageButton; +@property (strong, nonatomic) UIImagePickerController *picker; + +- (IBAction)textMessage:(id)sender; +- (IBAction)mailMessage:(id)sender; +- (IBAction)getImage:(id)sender; +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/ViewController.m b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/ViewController.m new file mode 100644 index 0000000..9aa437e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/ViewController.m @@ -0,0 +1,171 @@ +// +// ViewController.m +// Recipe 16-2 Composing Email +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.inputTextView.layer.cornerRadius = 15.0; + self.imageView.layer.cornerRadius = 15.0; + self.inputTextView.delegate = self; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(textMessagingAvailabilityChanged:) + name:MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification + object:nil]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)textMessage:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + MFMessageComposeViewController *messageVC = + [[MFMessageComposeViewController alloc] init]; + messageVC.messageComposeDelegate = self; + messageVC.recipients = @[@"3015555309"]; + messageVC.body = self.inputTextView.text; + [self presentViewController:messageVC animated:YES completion:nil]; + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + +- (IBAction)mailMessage:(id)sender +{ + if ([MFMailComposeViewController canSendMail]) + { + MFMailComposeViewController *mailVC = + [[MFMailComposeViewController alloc] init]; + [mailVC setSubject:@"Send It Out"]; + [mailVC setToRecipients:@[@"test@example.com"]]; + [mailVC setMessageBody:self.inputTextView.text isHTML:NO]; + mailVC.mailComposeDelegate = self; + + if (self.imageView.image != nil) + { + NSData *imageData = UIImageJPEGRepresentation(self.imageView.image, 1.0); + [mailVC addAttachmentData:imageData mimeType:@"image/jpeg" + fileName:@"SelectedImage"]; + } + + [self presentViewController:mailVC animated:YES completion:nil]; + } + else + { + NSLog(@"E-mailing Unavailable"); + } +} + +- (IBAction)getImage:(id)sender +{ + self.picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + self.picker.delegate = self; + + [self presentViewController:self.picker animated:YES completion:nil]; + } +} + +#pragma mark - helper methods + +-(void)textMessagingAvailabilityChanged:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + NSLog(@"Text Messaging Available"); + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + + +#pragma mark - Text Message Delegate methods + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)text +{ + if ([text isEqualToString:@"\n"]) + { + [textView resignFirstResponder]; + return NO; + } + return YES; +} + +-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result +{ + if (result == MessageComposeResultSent) + { + self.inputTextView.text = @"Message sent."; + } + else if (result == MessageComposeResultFailed) + { + NSLog(@"Failed to send message!"); + } + [self dismissViewControllerAnimated:YES completion:nil]; +} + + + +#pragma mark - Mail Message Delegate Methods + +-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error +{ + if (result == MFMailComposeResultSent) + { + self.inputTextView.text = @"Mail sent."; + self.imageView.image = nil; + } + else if (result == MFMailComposeResultCancelled) + NSLog(@"Mail Cancelled"); + else if (result == MFMailComposeResultFailed) + NSLog(@"Error, Mail Send Failed"); + else if (result == MFMailComposeResultSaved) + NSLog(@"Mail Saved"); + [self dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark - Image Picker Delegates + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + self.imageView.image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/main.m b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/main.m new file mode 100644 index 0000000..7808d8e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text Messages/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-2 Composing EmailTests-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-2 Composing EmailTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-2 Composing EmailTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m new file mode 100644 index 0000000..4c8c8d8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_16_1__Composing_Text_MessagesTests.m +// Recipe 16-1: Composing Text MessagesTests +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_16_1__Composing_Text_MessagesTests : XCTestCase + +@end + +@implementation Recipe_16_1__Composing_Text_MessagesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.pbxproj b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e690cb0 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20717D9749D007110E0 /* CoreGraphics.framework */; }; + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E20E17D9749D007110E0 /* InfoPlist.strings */; }; + 8848E21217D9749D007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21117D9749D007110E0 /* main.m */; }; + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21517D9749D007110E0 /* AppDelegate.m */; }; + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21717D9749D007110E0 /* Main.storyboard */; }; + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21B17D9749D007110E0 /* ViewController.m */; }; + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21D17D9749D007110E0 /* Images.xcassets */; }; + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E22417D9749E007110E0 /* XCTest.framework */; }; + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E22D17D9749E007110E0 /* InfoPlist.strings */; }; + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */; }; + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E23A17D97946007110E0 /* MessageUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E22817D9749E007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1FA17D9749D007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E20117D9749D007110E0; + remoteInfo = "Recipe 16-1: Composing Text Messages"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E20217D9749D007110E0 /* Recipe 16-2 Composing Email.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 16-2 Composing Email.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E20517D9749D007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E20717D9749D007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E20917D9749D007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E20D17D9749D007110E0 /* Recipe 16-2 Composing Email-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-2 Composing Email-Info.plist"; sourceTree = ""; }; + 8848E20F17D9749D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E21117D9749D007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E21317D9749D007110E0 /* Recipe 16-2 Composing Email-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 16-2 Composing Email-Prefix.pch"; sourceTree = ""; }; + 8848E21417D9749D007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E21517D9749D007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E21817D9749D007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E21A17D9749D007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E21B17D9749D007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E21D17D9749D007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E22317D9749E007110E0 /* Recipe 16-2 Composing EmailTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 16-2 Composing EmailTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E22417D9749E007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E22C17D9749E007110E0 /* Recipe 16-2 Composing EmailTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-2 Composing EmailTests-Info.plist"; sourceTree = ""; }; + 8848E22E17D9749E007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_16_1__Composing_Text_MessagesTests.m; sourceTree = ""; }; + 8848E23A17D97946007110E0 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1FF17D9749D007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */, + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */, + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22017D9749E007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */, + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */, + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1F917D9749D007110E0 = { + isa = PBXGroup; + children = ( + 8848E20B17D9749D007110E0 /* Recipe 16-2 Composing Email */, + 8848E22A17D9749E007110E0 /* Recipe 16-2 Composing Email Test */, + 8848E20417D9749D007110E0 /* Frameworks */, + 8848E20317D9749D007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E20317D9749D007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E20217D9749D007110E0 /* Recipe 16-2 Composing Email.app */, + 8848E22317D9749E007110E0 /* Recipe 16-2 Composing EmailTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E20417D9749D007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E23A17D97946007110E0 /* MessageUI.framework */, + 8848E20517D9749D007110E0 /* Foundation.framework */, + 8848E20717D9749D007110E0 /* CoreGraphics.framework */, + 8848E20917D9749D007110E0 /* UIKit.framework */, + 8848E22417D9749E007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E20B17D9749D007110E0 /* Recipe 16-2 Composing Email */ = { + isa = PBXGroup; + children = ( + 8848E21417D9749D007110E0 /* AppDelegate.h */, + 8848E21517D9749D007110E0 /* AppDelegate.m */, + 8848E21717D9749D007110E0 /* Main.storyboard */, + 8848E21A17D9749D007110E0 /* ViewController.h */, + 8848E21B17D9749D007110E0 /* ViewController.m */, + 8848E21D17D9749D007110E0 /* Images.xcassets */, + 8848E20C17D9749D007110E0 /* Supporting Files */, + ); + name = "Recipe 16-2 Composing Email"; + path = "Recipe 16-1: Composing Text Messages"; + sourceTree = ""; + }; + 8848E20C17D9749D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E20D17D9749D007110E0 /* Recipe 16-2 Composing Email-Info.plist */, + 8848E20E17D9749D007110E0 /* InfoPlist.strings */, + 8848E21117D9749D007110E0 /* main.m */, + 8848E21317D9749D007110E0 /* Recipe 16-2 Composing Email-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E22A17D9749E007110E0 /* Recipe 16-2 Composing Email Test */ = { + isa = PBXGroup; + children = ( + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */, + 8848E22B17D9749E007110E0 /* Supporting Files */, + ); + name = "Recipe 16-2 Composing Email Test"; + path = "Recipe 16-1: Composing Text MessagesTests"; + sourceTree = ""; + }; + 8848E22B17D9749E007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E22C17D9749E007110E0 /* Recipe 16-2 Composing EmailTests-Info.plist */, + 8848E22D17D9749E007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E20117D9749D007110E0 /* Recipe 16-2 Composing Email */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-2 Composing Email" */; + buildPhases = ( + 8848E1FE17D9749D007110E0 /* Sources */, + 8848E1FF17D9749D007110E0 /* Frameworks */, + 8848E20017D9749D007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 16-2 Composing Email"; + productName = "Recipe 16-1: Composing Text Messages"; + productReference = 8848E20217D9749D007110E0 /* Recipe 16-2 Composing Email.app */; + productType = "com.apple.product-type.application"; + }; + 8848E22217D9749E007110E0 /* Recipe 16-2 Composing EmailTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-2 Composing EmailTests" */; + buildPhases = ( + 8848E21F17D9749E007110E0 /* Sources */, + 8848E22017D9749E007110E0 /* Frameworks */, + 8848E22117D9749E007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E22917D9749E007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 16-2 Composing EmailTests"; + productName = "Recipe 16-1: Composing Text MessagesTests"; + productReference = 8848E22317D9749E007110E0 /* Recipe 16-2 Composing EmailTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1FA17D9749D007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E22217D9749E007110E0 = { + TestTargetID = 8848E20117D9749D007110E0; + }; + }; + }; + buildConfigurationList = 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-2 Composing Email" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1F917D9749D007110E0; + productRefGroup = 8848E20317D9749D007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E20117D9749D007110E0 /* Recipe 16-2 Composing Email */, + 8848E22217D9749E007110E0 /* Recipe 16-2 Composing EmailTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E20017D9749D007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */, + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */, + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22117D9749E007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1FE17D9749D007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */, + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */, + 8848E21217D9749D007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E21F17D9749E007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E22917D9749E007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E20117D9749D007110E0 /* Recipe 16-2 Composing Email */; + targetProxy = 8848E22817D9749E007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E20E17D9749D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E20F17D9749D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E21717D9749D007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E21817D9749D007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E22D17D9749E007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E22E17D9749E007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E23217D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E23317D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E23517D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-2 Composing Email-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-2 Composing Email-Info.plist"; + PRODUCT_NAME = "Recipe 16-2 Composing Email"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E23617D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-2 Composing Email-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-2 Composing Email-Info.plist"; + PRODUCT_NAME = "Recipe 16-2 Composing Email"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E23817D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-2 Composing EmailTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-2 Composing EmailTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E23917D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-2 Composing EmailTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-2 Composing EmailTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-2 Composing Email" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23217D9749E007110E0 /* Debug */, + 8848E23317D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-2 Composing Email" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23517D9749E007110E0 /* Debug */, + 8848E23617D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-2 Composing EmailTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23817D9749E007110E0 /* Debug */, + 8848E23917D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1FA17D9749D007110E0 /* Project object */; +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3cecaaa --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..86ad56f Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-2 Composing Email.xcscheme b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-2 Composing Email.xcscheme new file mode 100644 index 0000000..422726f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-2 Composing Email.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6d431a6 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-2 Composing Email/Recipe 16-2 Composing Email.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 16-2 Composing Email.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E20117D9749D007110E0 + + primary + + + 8848E22217D9749E007110E0 + + primary + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/.DS_Store b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/.DS_Store new file mode 100644 index 0000000..e13e8e0 Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/.DS_Store differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/AppDelegate.h b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/AppDelegate.h new file mode 100644 index 0000000..9d91366 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 16-3 Printing an Image +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/AppDelegate.m b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/AppDelegate.m new file mode 100644 index 0000000..6d6b409 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 16-3 Printing an Image +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8736726 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Recipe 16-3 Printing an Image-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Recipe 16-3 Printing an Image-Info.plist new file mode 100644 index 0000000..43c2e3f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Recipe 16-3 Printing an Image-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Recipe 16-3 Printing an Image-Prefix.pch b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Recipe 16-3 Printing an Image-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/Recipe 16-3 Printing an Image-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/ViewController.h b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/ViewController.h new file mode 100644 index 0000000..ef48bb0 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/ViewController.h @@ -0,0 +1,30 @@ +// +// ViewController.h +// Recipe 16-3 Printing an Imagel +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextView *inputTextView; +@property (weak, nonatomic) IBOutlet UIButton *textMessageButton; +@property (weak, nonatomic) IBOutlet UIButton *mailMessageButton; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *getImageButton; +@property (strong, nonatomic) UIImagePickerController *picker; + +- (IBAction)textMessage:(id)sender; +- (IBAction)mailMessage:(id)sender; +- (IBAction)getImage:(id)sender; +- (IBAction)print:(id)sender; +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/ViewController.m b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/ViewController.m new file mode 100644 index 0000000..3851ef1 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/ViewController.m @@ -0,0 +1,209 @@ +// +// ViewController.m +// Recipe 16-3 Printing an Image +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.inputTextView.layer.cornerRadius = 15.0; + self.imageView.layer.cornerRadius = 15.0; + self.inputTextView.delegate = self; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(textMessagingAvailabilityChanged:) + name:MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification + object:nil]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)textMessage:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + MFMessageComposeViewController *messageVC = + [[MFMessageComposeViewController alloc] init]; + messageVC.messageComposeDelegate = self; + messageVC.recipients = @[@"3015555309"]; + messageVC.body = self.inputTextView.text; + [self presentViewController:messageVC animated:YES completion:nil]; + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + +- (IBAction)mailMessage:(id)sender +{ + if ([MFMailComposeViewController canSendMail]) + { + MFMailComposeViewController *mailVC = + [[MFMailComposeViewController alloc] init]; + [mailVC setSubject:@"Send It Out"]; + [mailVC setToRecipients:@[@"test@example.com"]]; + [mailVC setMessageBody:self.inputTextView.text isHTML:NO]; + mailVC.mailComposeDelegate = self; + + if (self.imageView.image != nil) + { + NSData *imageData = UIImageJPEGRepresentation(self.imageView.image, 1.0); + [mailVC addAttachmentData:imageData mimeType:@"image/jpeg" + fileName:@"SelectedImage"]; + } + + [self presentViewController:mailVC animated:YES completion:nil]; + } + else + { + NSLog(@"E-mailing Unavailable"); + } +} + +- (IBAction)getImage:(id)sender +{ + self.picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + self.picker.delegate = self; + + [self presentViewController:self.picker animated:YES completion:nil]; + } +} + +- (IBAction)print:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable] + && (self.imageView.image != nil)) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputPhoto; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + + UIImage *image = self.imageView.image; + pic.printingItem = image; + + if (!pic.printingItem && image.size.width> image.size.height) + printInfo.orientation = UIPrintInfoOrientationLandscape; + + pic.printInfo = printInfo; + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Cancelled Printing"); + } + }]; + } +} + +#pragma mark - helper methods + +-(void)textMessagingAvailabilityChanged:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + NSLog(@"Text Messaging Available"); + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + + +#pragma mark - Text Message Delegate methods + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)text +{ + if ([text isEqualToString:@"\n"]) + { + [textView resignFirstResponder]; + return NO; + } + return YES; +} + +-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result +{ + if (result == MessageComposeResultSent) + { + self.inputTextView.text = @"Message sent."; + } + else if (result == MessageComposeResultFailed) + { + NSLog(@"Failed to send message!"); + } + [self dismissViewControllerAnimated:YES completion:nil]; +} + + + +#pragma mark - Mail Message Delegate Methods + +-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error +{ + if (result == MFMailComposeResultSent) + { + self.inputTextView.text = @"Mail sent."; + self.imageView.image = nil; + } + else if (result == MFMailComposeResultCancelled) + NSLog(@"Mail Cancelled"); + else if (result == MFMailComposeResultFailed) + NSLog(@"Error, Mail Send Failed"); + else if (result == MFMailComposeResultSaved) + NSLog(@"Mail Saved"); + [self dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark - Image Picker Delegates + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + self.imageView.image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/main.m b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/main.m new file mode 100644 index 0000000..7808d8e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text Messages/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-3 Printing an ImageTests-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-3 Printing an ImageTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-3 Printing an ImageTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m new file mode 100644 index 0000000..4c8c8d8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_16_1__Composing_Text_MessagesTests.m +// Recipe 16-1: Composing Text MessagesTests +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_16_1__Composing_Text_MessagesTests : XCTestCase + +@end + +@implementation Recipe_16_1__Composing_Text_MessagesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.pbxproj b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.pbxproj new file mode 100644 index 0000000..cafed09 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20717D9749D007110E0 /* CoreGraphics.framework */; }; + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E20E17D9749D007110E0 /* InfoPlist.strings */; }; + 8848E21217D9749D007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21117D9749D007110E0 /* main.m */; }; + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21517D9749D007110E0 /* AppDelegate.m */; }; + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21717D9749D007110E0 /* Main.storyboard */; }; + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21B17D9749D007110E0 /* ViewController.m */; }; + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21D17D9749D007110E0 /* Images.xcassets */; }; + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E22417D9749E007110E0 /* XCTest.framework */; }; + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E22D17D9749E007110E0 /* InfoPlist.strings */; }; + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */; }; + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E23A17D97946007110E0 /* MessageUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E22817D9749E007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1FA17D9749D007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E20117D9749D007110E0; + remoteInfo = "Recipe 16-1: Composing Text Messages"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E20217D9749D007110E0 /* Recipe 16-3 Printing an Image.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 16-3 Printing an Image.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E20517D9749D007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E20717D9749D007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E20917D9749D007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E20D17D9749D007110E0 /* Recipe 16-3 Printing an Image-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-3 Printing an Image-Info.plist"; sourceTree = ""; }; + 8848E20F17D9749D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E21117D9749D007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E21317D9749D007110E0 /* Recipe 16-3 Printing an Image-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 16-3 Printing an Image-Prefix.pch"; sourceTree = ""; }; + 8848E21417D9749D007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E21517D9749D007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E21817D9749D007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E21A17D9749D007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E21B17D9749D007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E21D17D9749D007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E22317D9749E007110E0 /* Recipe 16-3 Printing an ImageTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 16-3 Printing an ImageTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E22417D9749E007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E22C17D9749E007110E0 /* Recipe 16-3 Printing an ImageTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-3 Printing an ImageTests-Info.plist"; sourceTree = ""; }; + 8848E22E17D9749E007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_16_1__Composing_Text_MessagesTests.m; sourceTree = ""; }; + 8848E23A17D97946007110E0 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1FF17D9749D007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */, + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */, + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22017D9749E007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */, + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */, + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1F917D9749D007110E0 = { + isa = PBXGroup; + children = ( + 8848E20B17D9749D007110E0 /* Recipe 16-3 Printing an Image */, + 8848E22A17D9749E007110E0 /* Recipe 16-3 Printing an Image Test */, + 8848E20417D9749D007110E0 /* Frameworks */, + 8848E20317D9749D007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E20317D9749D007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E20217D9749D007110E0 /* Recipe 16-3 Printing an Image.app */, + 8848E22317D9749E007110E0 /* Recipe 16-3 Printing an ImageTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E20417D9749D007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E23A17D97946007110E0 /* MessageUI.framework */, + 8848E20517D9749D007110E0 /* Foundation.framework */, + 8848E20717D9749D007110E0 /* CoreGraphics.framework */, + 8848E20917D9749D007110E0 /* UIKit.framework */, + 8848E22417D9749E007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E20B17D9749D007110E0 /* Recipe 16-3 Printing an Image */ = { + isa = PBXGroup; + children = ( + 8848E21417D9749D007110E0 /* AppDelegate.h */, + 8848E21517D9749D007110E0 /* AppDelegate.m */, + 8848E21717D9749D007110E0 /* Main.storyboard */, + 8848E21A17D9749D007110E0 /* ViewController.h */, + 8848E21B17D9749D007110E0 /* ViewController.m */, + 8848E21D17D9749D007110E0 /* Images.xcassets */, + 8848E20C17D9749D007110E0 /* Supporting Files */, + ); + name = "Recipe 16-3 Printing an Image"; + path = "Recipe 16-1: Composing Text Messages"; + sourceTree = ""; + }; + 8848E20C17D9749D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E20D17D9749D007110E0 /* Recipe 16-3 Printing an Image-Info.plist */, + 8848E20E17D9749D007110E0 /* InfoPlist.strings */, + 8848E21117D9749D007110E0 /* main.m */, + 8848E21317D9749D007110E0 /* Recipe 16-3 Printing an Image-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E22A17D9749E007110E0 /* Recipe 16-3 Printing an Image Test */ = { + isa = PBXGroup; + children = ( + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */, + 8848E22B17D9749E007110E0 /* Supporting Files */, + ); + name = "Recipe 16-3 Printing an Image Test"; + path = "Recipe 16-1: Composing Text MessagesTests"; + sourceTree = ""; + }; + 8848E22B17D9749E007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E22C17D9749E007110E0 /* Recipe 16-3 Printing an ImageTests-Info.plist */, + 8848E22D17D9749E007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E20117D9749D007110E0 /* Recipe 16-3 Printing an Image */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-3 Printing an Image" */; + buildPhases = ( + 8848E1FE17D9749D007110E0 /* Sources */, + 8848E1FF17D9749D007110E0 /* Frameworks */, + 8848E20017D9749D007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 16-3 Printing an Image"; + productName = "Recipe 16-1: Composing Text Messages"; + productReference = 8848E20217D9749D007110E0 /* Recipe 16-3 Printing an Image.app */; + productType = "com.apple.product-type.application"; + }; + 8848E22217D9749E007110E0 /* Recipe 16-3 Printing an ImageTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-3 Printing an ImageTests" */; + buildPhases = ( + 8848E21F17D9749E007110E0 /* Sources */, + 8848E22017D9749E007110E0 /* Frameworks */, + 8848E22117D9749E007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E22917D9749E007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 16-3 Printing an ImageTests"; + productName = "Recipe 16-1: Composing Text MessagesTests"; + productReference = 8848E22317D9749E007110E0 /* Recipe 16-3 Printing an ImageTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1FA17D9749D007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E22217D9749E007110E0 = { + TestTargetID = 8848E20117D9749D007110E0; + }; + }; + }; + buildConfigurationList = 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-3 Printing an Image" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1F917D9749D007110E0; + productRefGroup = 8848E20317D9749D007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E20117D9749D007110E0 /* Recipe 16-3 Printing an Image */, + 8848E22217D9749E007110E0 /* Recipe 16-3 Printing an ImageTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E20017D9749D007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */, + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */, + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22117D9749E007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1FE17D9749D007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */, + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */, + 8848E21217D9749D007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E21F17D9749E007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E22917D9749E007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E20117D9749D007110E0 /* Recipe 16-3 Printing an Image */; + targetProxy = 8848E22817D9749E007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E20E17D9749D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E20F17D9749D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E21717D9749D007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E21817D9749D007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E22D17D9749E007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E22E17D9749E007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E23217D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E23317D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E23517D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-3 Printing an Image-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-3 Printing an Image-Info.plist"; + PRODUCT_NAME = "Recipe 16-3 Printing an Image"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E23617D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-3 Printing an Image-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-3 Printing an Image-Info.plist"; + PRODUCT_NAME = "Recipe 16-3 Printing an Image"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E23817D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-3 Printing an ImageTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-3 Printing an ImageTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E23917D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-3 Printing an ImageTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-3 Printing an ImageTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-3 Printing an Image" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23217D9749E007110E0 /* Debug */, + 8848E23317D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-3 Printing an Image" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23517D9749E007110E0 /* Debug */, + 8848E23617D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-3 Printing an ImageTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23817D9749E007110E0 /* Debug */, + 8848E23917D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1FA17D9749D007110E0 /* Project object */; +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1000828 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..397c67f Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-3 Printing an Image.xcscheme b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-3 Printing an Image.xcscheme new file mode 100644 index 0000000..6dc8220 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-3 Printing an Image.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..32e7c16 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-3 Printing an Image/Recipe 16-3 Printing an Image.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 16-3 Printing an Image.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E20117D9749D007110E0 + + primary + + + 8848E22217D9749E007110E0 + + primary + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/.DS_Store b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/.DS_Store new file mode 100644 index 0000000..1ac2fdb Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/.DS_Store differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/AppDelegate.h b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/AppDelegate.h new file mode 100644 index 0000000..c303bca --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 16-4 Printing Plain Text +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/AppDelegate.m b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/AppDelegate.m new file mode 100644 index 0000000..bbd5b24 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 16-4 Printing Plain Text +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard new file mode 100644 index 0000000..58906d1 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Recipe 16-4 Printing Plain Text-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Recipe 16-4 Printing Plain Text-Info.plist new file mode 100644 index 0000000..43c2e3f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Recipe 16-4 Printing Plain Text-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Recipe 16-4 Printing Plain Text-Prefix.pch b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Recipe 16-4 Printing Plain Text-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/Recipe 16-4 Printing Plain Text-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/ViewController.h b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/ViewController.h new file mode 100644 index 0000000..6df9d2e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/ViewController.h @@ -0,0 +1,31 @@ +// +// ViewController.h +// Recipe 16-4 Printing Plain Text +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextView *inputTextView; +@property (weak, nonatomic) IBOutlet UIButton *textMessageButton; +@property (weak, nonatomic) IBOutlet UIButton *mailMessageButton; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *getImageButton; +@property (strong, nonatomic) UIImagePickerController *picker; + +- (IBAction)textMessage:(id)sender; +- (IBAction)mailMessage:(id)sender; +- (IBAction)getImage:(id)sender; +- (IBAction)print:(id)sender; +- (IBAction)printText:(id)sender; +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/ViewController.m b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/ViewController.m new file mode 100644 index 0000000..e5dcee6 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/ViewController.m @@ -0,0 +1,249 @@ +// +// ViewController.m +// Recipe 16-4 Printing Plain Text +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.inputTextView.layer.cornerRadius = 15.0; + self.imageView.layer.cornerRadius = 15.0; + self.inputTextView.delegate = self; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(textMessagingAvailabilityChanged:) + name:MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification + object:nil]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)textMessage:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + MFMessageComposeViewController *messageVC = + [[MFMessageComposeViewController alloc] init]; + messageVC.messageComposeDelegate = self; + messageVC.recipients = @[@"3015555309"]; + messageVC.body = self.inputTextView.text; + [self presentViewController:messageVC animated:YES completion:nil]; + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + +- (IBAction)mailMessage:(id)sender +{ + if ([MFMailComposeViewController canSendMail]) + { + MFMailComposeViewController *mailVC = + [[MFMailComposeViewController alloc] init]; + [mailVC setSubject:@"Send It Out"]; + [mailVC setToRecipients:@[@"test@example.com"]]; + [mailVC setMessageBody:self.inputTextView.text isHTML:NO]; + mailVC.mailComposeDelegate = self; + + if (self.imageView.image != nil) + { + NSData *imageData = UIImageJPEGRepresentation(self.imageView.image, 1.0); + [mailVC addAttachmentData:imageData mimeType:@"image/jpeg" + fileName:@"SelectedImage"]; + } + + [self presentViewController:mailVC animated:YES completion:nil]; + } + else + { + NSLog(@"E-mailing Unavailable"); + } +} + +- (IBAction)getImage:(id)sender +{ + self.picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + self.picker.delegate = self; + + [self presentViewController:self.picker animated:YES completion:nil]; + } +} + +- (IBAction)print:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable] + && (self.imageView.image != nil)) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputPhoto; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + + UIImage *image = self.imageView.image; + pic.printingItem = image; + + if (!pic.printingItem && image.size.width> image.size.height) + printInfo.orientation = UIPrintInfoOrientationLandscape; + + pic.printInfo = printInfo; + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Cancelled Printing"); + } + }]; + } +} + + +- (IBAction)printText:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable]) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + pic.printInfo = printInfo; + + UISimpleTextPrintFormatter *simpleTextPF = + [[UISimpleTextPrintFormatter alloc] initWithText:self.inputTextView.text]; + simpleTextPF.startPage = 0; + simpleTextPF.contentInsets = UIEdgeInsetsMake(72.0, 72.0, 72.0, 72.0); + simpleTextPF.maximumContentWidth = 6*72.0; + + pic.printFormatter = simpleTextPF; + + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Printing Cancelled"); + } + }]; + } +} + +#pragma mark - helper methods + +-(void)textMessagingAvailabilityChanged:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + NSLog(@"Text Messaging Available"); + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + + +#pragma mark - Text Message Delegate methods + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)text +{ + if ([text isEqualToString:@"\n"]) + { + [textView resignFirstResponder]; + return NO; + } + return YES; +} + +-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result +{ + if (result == MessageComposeResultSent) + { + self.inputTextView.text = @"Message sent."; + } + else if (result == MessageComposeResultFailed) + { + NSLog(@"Failed to send message!"); + } + [self dismissViewControllerAnimated:YES completion:nil]; +} + + + +#pragma mark - Mail Message Delegate Methods + +-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error +{ + if (result == MFMailComposeResultSent) + { + self.inputTextView.text = @"Mail sent."; + self.imageView.image = nil; + } + else if (result == MFMailComposeResultCancelled) + NSLog(@"Mail Cancelled"); + else if (result == MFMailComposeResultFailed) + NSLog(@"Error, Mail Send Failed"); + else if (result == MFMailComposeResultSaved) + NSLog(@"Mail Saved"); + [self dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark - Image Picker Delegates + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + self.imageView.image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/main.m b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/main.m new file mode 100644 index 0000000..7808d8e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text Messages/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-4 Printing Plain TextTests-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-4 Printing Plain TextTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-4 Printing Plain TextTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m new file mode 100644 index 0000000..4c8c8d8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_16_1__Composing_Text_MessagesTests.m +// Recipe 16-1: Composing Text MessagesTests +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_16_1__Composing_Text_MessagesTests : XCTestCase + +@end + +@implementation Recipe_16_1__Composing_Text_MessagesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.pbxproj b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d8fa59e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20717D9749D007110E0 /* CoreGraphics.framework */; }; + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E20E17D9749D007110E0 /* InfoPlist.strings */; }; + 8848E21217D9749D007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21117D9749D007110E0 /* main.m */; }; + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21517D9749D007110E0 /* AppDelegate.m */; }; + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21717D9749D007110E0 /* Main.storyboard */; }; + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21B17D9749D007110E0 /* ViewController.m */; }; + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21D17D9749D007110E0 /* Images.xcassets */; }; + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E22417D9749E007110E0 /* XCTest.framework */; }; + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E22D17D9749E007110E0 /* InfoPlist.strings */; }; + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */; }; + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E23A17D97946007110E0 /* MessageUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E22817D9749E007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1FA17D9749D007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E20117D9749D007110E0; + remoteInfo = "Recipe 16-1: Composing Text Messages"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E20217D9749D007110E0 /* Recipe 16-4 Printing Plain Text.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 16-4 Printing Plain Text.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E20517D9749D007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E20717D9749D007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E20917D9749D007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E20D17D9749D007110E0 /* Recipe 16-4 Printing Plain Text-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-4 Printing Plain Text-Info.plist"; sourceTree = ""; }; + 8848E20F17D9749D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E21117D9749D007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E21317D9749D007110E0 /* Recipe 16-4 Printing Plain Text-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 16-4 Printing Plain Text-Prefix.pch"; sourceTree = ""; }; + 8848E21417D9749D007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E21517D9749D007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E21817D9749D007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E21A17D9749D007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E21B17D9749D007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E21D17D9749D007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E22317D9749E007110E0 /* Recipe 16-4 Printing Plain TextTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 16-4 Printing Plain TextTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E22417D9749E007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E22C17D9749E007110E0 /* Recipe 16-4 Printing Plain TextTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-4 Printing Plain TextTests-Info.plist"; sourceTree = ""; }; + 8848E22E17D9749E007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_16_1__Composing_Text_MessagesTests.m; sourceTree = ""; }; + 8848E23A17D97946007110E0 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1FF17D9749D007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */, + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */, + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22017D9749E007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */, + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */, + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1F917D9749D007110E0 = { + isa = PBXGroup; + children = ( + 8848E20B17D9749D007110E0 /* Recipe 16-4 Printing Plain Text */, + 8848E22A17D9749E007110E0 /* Recipe 16-4 Printing Plain Text Test */, + 8848E20417D9749D007110E0 /* Frameworks */, + 8848E20317D9749D007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E20317D9749D007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E20217D9749D007110E0 /* Recipe 16-4 Printing Plain Text.app */, + 8848E22317D9749E007110E0 /* Recipe 16-4 Printing Plain TextTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E20417D9749D007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E23A17D97946007110E0 /* MessageUI.framework */, + 8848E20517D9749D007110E0 /* Foundation.framework */, + 8848E20717D9749D007110E0 /* CoreGraphics.framework */, + 8848E20917D9749D007110E0 /* UIKit.framework */, + 8848E22417D9749E007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E20B17D9749D007110E0 /* Recipe 16-4 Printing Plain Text */ = { + isa = PBXGroup; + children = ( + 8848E21417D9749D007110E0 /* AppDelegate.h */, + 8848E21517D9749D007110E0 /* AppDelegate.m */, + 8848E21717D9749D007110E0 /* Main.storyboard */, + 8848E21A17D9749D007110E0 /* ViewController.h */, + 8848E21B17D9749D007110E0 /* ViewController.m */, + 8848E21D17D9749D007110E0 /* Images.xcassets */, + 8848E20C17D9749D007110E0 /* Supporting Files */, + ); + name = "Recipe 16-4 Printing Plain Text"; + path = "Recipe 16-1: Composing Text Messages"; + sourceTree = ""; + }; + 8848E20C17D9749D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E20D17D9749D007110E0 /* Recipe 16-4 Printing Plain Text-Info.plist */, + 8848E20E17D9749D007110E0 /* InfoPlist.strings */, + 8848E21117D9749D007110E0 /* main.m */, + 8848E21317D9749D007110E0 /* Recipe 16-4 Printing Plain Text-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E22A17D9749E007110E0 /* Recipe 16-4 Printing Plain Text Test */ = { + isa = PBXGroup; + children = ( + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */, + 8848E22B17D9749E007110E0 /* Supporting Files */, + ); + name = "Recipe 16-4 Printing Plain Text Test"; + path = "Recipe 16-1: Composing Text MessagesTests"; + sourceTree = ""; + }; + 8848E22B17D9749E007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E22C17D9749E007110E0 /* Recipe 16-4 Printing Plain TextTests-Info.plist */, + 8848E22D17D9749E007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E20117D9749D007110E0 /* Recipe 16-4 Printing Plain Text */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-4 Printing Plain Text" */; + buildPhases = ( + 8848E1FE17D9749D007110E0 /* Sources */, + 8848E1FF17D9749D007110E0 /* Frameworks */, + 8848E20017D9749D007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 16-4 Printing Plain Text"; + productName = "Recipe 16-1: Composing Text Messages"; + productReference = 8848E20217D9749D007110E0 /* Recipe 16-4 Printing Plain Text.app */; + productType = "com.apple.product-type.application"; + }; + 8848E22217D9749E007110E0 /* Recipe 16-4 Printing Plain TextTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-4 Printing Plain TextTests" */; + buildPhases = ( + 8848E21F17D9749E007110E0 /* Sources */, + 8848E22017D9749E007110E0 /* Frameworks */, + 8848E22117D9749E007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E22917D9749E007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 16-4 Printing Plain TextTests"; + productName = "Recipe 16-1: Composing Text MessagesTests"; + productReference = 8848E22317D9749E007110E0 /* Recipe 16-4 Printing Plain TextTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1FA17D9749D007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E22217D9749E007110E0 = { + TestTargetID = 8848E20117D9749D007110E0; + }; + }; + }; + buildConfigurationList = 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-4 Printing Plain Text" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1F917D9749D007110E0; + productRefGroup = 8848E20317D9749D007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E20117D9749D007110E0 /* Recipe 16-4 Printing Plain Text */, + 8848E22217D9749E007110E0 /* Recipe 16-4 Printing Plain TextTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E20017D9749D007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */, + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */, + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22117D9749E007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1FE17D9749D007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */, + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */, + 8848E21217D9749D007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E21F17D9749E007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E22917D9749E007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E20117D9749D007110E0 /* Recipe 16-4 Printing Plain Text */; + targetProxy = 8848E22817D9749E007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E20E17D9749D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E20F17D9749D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E21717D9749D007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E21817D9749D007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E22D17D9749E007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E22E17D9749E007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E23217D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E23317D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E23517D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-4 Printing Plain Text-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-4 Printing Plain Text-Info.plist"; + PRODUCT_NAME = "Recipe 16-4 Printing Plain Text"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E23617D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-4 Printing Plain Text-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-4 Printing Plain Text-Info.plist"; + PRODUCT_NAME = "Recipe 16-4 Printing Plain Text"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E23817D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-4 Printing Plain TextTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-4 Printing Plain TextTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E23917D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-4 Printing Plain TextTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-4 Printing Plain TextTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-4 Printing Plain Text" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23217D9749E007110E0 /* Debug */, + 8848E23317D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-4 Printing Plain Text" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23517D9749E007110E0 /* Debug */, + 8848E23617D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-4 Printing Plain TextTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23817D9749E007110E0 /* Debug */, + 8848E23917D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1FA17D9749D007110E0 /* Project object */; +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ca346fe --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..adffa57 Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme new file mode 100644 index 0000000..ad0d3e8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f631445 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-4 Printing Plain Text/Recipe 16-4 Printing Plain Text.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 16-1: Composing Text Messages.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E20117D9749D007110E0 + + primary + + + 8848E22217D9749E007110E0 + + primary + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/.DS_Store b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/.DS_Store new file mode 100644 index 0000000..ec6cb8d Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/.DS_Store differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/AppDelegate.h b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/AppDelegate.h new file mode 100644 index 0000000..517acbb --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 16-5 Printing a View +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/AppDelegate.m b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/AppDelegate.m new file mode 100644 index 0000000..1db6ab8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 16-5 Printing a View +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ab5b69b --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Recipe 16-5 Printing a View-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Recipe 16-5 Printing a View-Info.plist new file mode 100644 index 0000000..43c2e3f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Recipe 16-5 Printing a View-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Recipe 16-5 Printing a View-Prefix.pch b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Recipe 16-5 Printing a View-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/Recipe 16-5 Printing a View-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/ViewController.h b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/ViewController.h new file mode 100644 index 0000000..b4313ce --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/ViewController.h @@ -0,0 +1,32 @@ +// +// ViewController.h +// Recipe 16-5 Printing a View +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextView *inputTextView; +@property (weak, nonatomic) IBOutlet UIButton *textMessageButton; +@property (weak, nonatomic) IBOutlet UIButton *mailMessageButton; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *getImageButton; +@property (strong, nonatomic) UIImagePickerController *picker; + +- (IBAction)textMessage:(id)sender; +- (IBAction)mailMessage:(id)sender; +- (IBAction)getImage:(id)sender; +- (IBAction)print:(id)sender; +- (IBAction)printViewPressed:(id)sender; +- (IBAction)printText:(id)sender; +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/ViewController.m b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/ViewController.m new file mode 100644 index 0000000..50e7962 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/ViewController.m @@ -0,0 +1,283 @@ +// +// ViewController.m +// Recipe 16-5 Printing a View +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.inputTextView.layer.cornerRadius = 15.0; + self.imageView.layer.cornerRadius = 15.0; + self.inputTextView.delegate = self; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(textMessagingAvailabilityChanged:) + name:MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification + object:nil]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)textMessage:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + MFMessageComposeViewController *messageVC = + [[MFMessageComposeViewController alloc] init]; + messageVC.messageComposeDelegate = self; + messageVC.recipients = @[@"3015555309"]; + messageVC.body = self.inputTextView.text; + [self presentViewController:messageVC animated:YES completion:nil]; + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + +- (IBAction)mailMessage:(id)sender +{ + if ([MFMailComposeViewController canSendMail]) + { + MFMailComposeViewController *mailVC = + [[MFMailComposeViewController alloc] init]; + [mailVC setSubject:@"Send It Out"]; + [mailVC setToRecipients:@[@"test@example.com"]]; + [mailVC setMessageBody:self.inputTextView.text isHTML:NO]; + mailVC.mailComposeDelegate = self; + + if (self.imageView.image != nil) + { + NSData *imageData = UIImageJPEGRepresentation(self.imageView.image, 1.0); + [mailVC addAttachmentData:imageData mimeType:@"image/jpeg" + fileName:@"SelectedImage"]; + } + + [self presentViewController:mailVC animated:YES completion:nil]; + } + else + { + NSLog(@"E-mailing Unavailable"); + } +} + +- (IBAction)getImage:(id)sender +{ + self.picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + self.picker.delegate = self; + + [self presentViewController:self.picker animated:YES completion:nil]; + } +} + +- (IBAction)print:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable] + && (self.imageView.image != nil)) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputPhoto; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + + UIImage *image = self.imageView.image; + pic.printingItem = image; + + if (!pic.printingItem && image.size.width> image.size.height) + printInfo.orientation = UIPrintInfoOrientationLandscape; + + pic.printInfo = printInfo; + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Cancelled Printing"); + } + }]; + } +} + +- (IBAction)printViewPressed:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable]) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + printInfo.orientation = UIPrintInfoOrientationLandscape; + pic.printInfo = printInfo; + + UIViewPrintFormatter *viewPF = [self.inputTextView viewPrintFormatter]; + + pic.printFormatter = viewPF; + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing View: %@", error); + } + else + { + NSLog(@"Printing Cancelled"); + } + }]; + } +} + +- (IBAction)printText:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable]) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + pic.printInfo = printInfo; + + UISimpleTextPrintFormatter *simpleTextPF = + [[UISimpleTextPrintFormatter alloc] initWithText:self.inputTextView.text]; + simpleTextPF.startPage = 0; + simpleTextPF.contentInsets = UIEdgeInsetsMake(72.0, 72.0, 72.0, 72.0); + simpleTextPF.maximumContentWidth = 6*72.0; + + pic.printFormatter = simpleTextPF; + + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Printing Cancelled"); + } + }]; + } +} + +#pragma mark - helper methods + +-(void)textMessagingAvailabilityChanged:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + NSLog(@"Text Messaging Available"); + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + + +#pragma mark - Text Message Delegate methods + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)text +{ + if ([text isEqualToString:@"\n"]) + { + [textView resignFirstResponder]; + return NO; + } + return YES; +} + +-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result +{ + if (result == MessageComposeResultSent) + { + self.inputTextView.text = @"Message sent."; + } + else if (result == MessageComposeResultFailed) + { + NSLog(@"Failed to send message!"); + } + [self dismissViewControllerAnimated:YES completion:nil]; +} + + + +#pragma mark - Mail Message Delegate Methods + +-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error +{ + if (result == MFMailComposeResultSent) + { + self.inputTextView.text = @"Mail sent."; + self.imageView.image = nil; + } + else if (result == MFMailComposeResultCancelled) + NSLog(@"Mail Cancelled"); + else if (result == MFMailComposeResultFailed) + NSLog(@"Error, Mail Send Failed"); + else if (result == MFMailComposeResultSaved) + NSLog(@"Mail Saved"); + [self dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark - Image Picker Delegates + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + self.imageView.image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/main.m b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/main.m new file mode 100644 index 0000000..7808d8e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text Messages/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-5 Printing a ViewTests-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-5 Printing a ViewTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-5 Printing a ViewTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m new file mode 100644 index 0000000..4c8c8d8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_16_1__Composing_Text_MessagesTests.m +// Recipe 16-1: Composing Text MessagesTests +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_16_1__Composing_Text_MessagesTests : XCTestCase + +@end + +@implementation Recipe_16_1__Composing_Text_MessagesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.pbxproj b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8334280 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20717D9749D007110E0 /* CoreGraphics.framework */; }; + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E20E17D9749D007110E0 /* InfoPlist.strings */; }; + 8848E21217D9749D007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21117D9749D007110E0 /* main.m */; }; + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21517D9749D007110E0 /* AppDelegate.m */; }; + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21717D9749D007110E0 /* Main.storyboard */; }; + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21B17D9749D007110E0 /* ViewController.m */; }; + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21D17D9749D007110E0 /* Images.xcassets */; }; + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E22417D9749E007110E0 /* XCTest.framework */; }; + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E22D17D9749E007110E0 /* InfoPlist.strings */; }; + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */; }; + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E23A17D97946007110E0 /* MessageUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E22817D9749E007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1FA17D9749D007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E20117D9749D007110E0; + remoteInfo = "Recipe 16-1: Composing Text Messages"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E20217D9749D007110E0 /* Recipe 16-5 Printing a View.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 16-5 Printing a View.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E20517D9749D007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E20717D9749D007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E20917D9749D007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E20D17D9749D007110E0 /* Recipe 16-5 Printing a View-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-5 Printing a View-Info.plist"; sourceTree = ""; }; + 8848E20F17D9749D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E21117D9749D007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E21317D9749D007110E0 /* Recipe 16-5 Printing a View-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 16-5 Printing a View-Prefix.pch"; sourceTree = ""; }; + 8848E21417D9749D007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E21517D9749D007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E21817D9749D007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E21A17D9749D007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E21B17D9749D007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E21D17D9749D007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E22317D9749E007110E0 /* Recipe 16-5 Printing a ViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 16-5 Printing a ViewTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E22417D9749E007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E22C17D9749E007110E0 /* Recipe 16-5 Printing a ViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-5 Printing a ViewTests-Info.plist"; sourceTree = ""; }; + 8848E22E17D9749E007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_16_1__Composing_Text_MessagesTests.m; sourceTree = ""; }; + 8848E23A17D97946007110E0 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1FF17D9749D007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */, + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */, + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22017D9749E007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */, + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */, + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1F917D9749D007110E0 = { + isa = PBXGroup; + children = ( + 8848E20B17D9749D007110E0 /* Recipe 16-5 Printing a View */, + 8848E22A17D9749E007110E0 /* Recipe 16-5 Printing a View Test */, + 8848E20417D9749D007110E0 /* Frameworks */, + 8848E20317D9749D007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E20317D9749D007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E20217D9749D007110E0 /* Recipe 16-5 Printing a View.app */, + 8848E22317D9749E007110E0 /* Recipe 16-5 Printing a ViewTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E20417D9749D007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E23A17D97946007110E0 /* MessageUI.framework */, + 8848E20517D9749D007110E0 /* Foundation.framework */, + 8848E20717D9749D007110E0 /* CoreGraphics.framework */, + 8848E20917D9749D007110E0 /* UIKit.framework */, + 8848E22417D9749E007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E20B17D9749D007110E0 /* Recipe 16-5 Printing a View */ = { + isa = PBXGroup; + children = ( + 8848E21417D9749D007110E0 /* AppDelegate.h */, + 8848E21517D9749D007110E0 /* AppDelegate.m */, + 8848E21717D9749D007110E0 /* Main.storyboard */, + 8848E21A17D9749D007110E0 /* ViewController.h */, + 8848E21B17D9749D007110E0 /* ViewController.m */, + 8848E21D17D9749D007110E0 /* Images.xcassets */, + 8848E20C17D9749D007110E0 /* Supporting Files */, + ); + name = "Recipe 16-5 Printing a View"; + path = "Recipe 16-1: Composing Text Messages"; + sourceTree = ""; + }; + 8848E20C17D9749D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E20D17D9749D007110E0 /* Recipe 16-5 Printing a View-Info.plist */, + 8848E20E17D9749D007110E0 /* InfoPlist.strings */, + 8848E21117D9749D007110E0 /* main.m */, + 8848E21317D9749D007110E0 /* Recipe 16-5 Printing a View-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E22A17D9749E007110E0 /* Recipe 16-5 Printing a View Test */ = { + isa = PBXGroup; + children = ( + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */, + 8848E22B17D9749E007110E0 /* Supporting Files */, + ); + name = "Recipe 16-5 Printing a View Test"; + path = "Recipe 16-1: Composing Text MessagesTests"; + sourceTree = ""; + }; + 8848E22B17D9749E007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E22C17D9749E007110E0 /* Recipe 16-5 Printing a ViewTests-Info.plist */, + 8848E22D17D9749E007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E20117D9749D007110E0 /* Recipe 16-5 Printing a View */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-5 Printing a View" */; + buildPhases = ( + 8848E1FE17D9749D007110E0 /* Sources */, + 8848E1FF17D9749D007110E0 /* Frameworks */, + 8848E20017D9749D007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 16-5 Printing a View"; + productName = "Recipe 16-1: Composing Text Messages"; + productReference = 8848E20217D9749D007110E0 /* Recipe 16-5 Printing a View.app */; + productType = "com.apple.product-type.application"; + }; + 8848E22217D9749E007110E0 /* Recipe 16-5 Printing a ViewTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-5 Printing a ViewTests" */; + buildPhases = ( + 8848E21F17D9749E007110E0 /* Sources */, + 8848E22017D9749E007110E0 /* Frameworks */, + 8848E22117D9749E007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E22917D9749E007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 16-5 Printing a ViewTests"; + productName = "Recipe 16-1: Composing Text MessagesTests"; + productReference = 8848E22317D9749E007110E0 /* Recipe 16-5 Printing a ViewTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1FA17D9749D007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E22217D9749E007110E0 = { + TestTargetID = 8848E20117D9749D007110E0; + }; + }; + }; + buildConfigurationList = 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-5 Printing a View" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1F917D9749D007110E0; + productRefGroup = 8848E20317D9749D007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E20117D9749D007110E0 /* Recipe 16-5 Printing a View */, + 8848E22217D9749E007110E0 /* Recipe 16-5 Printing a ViewTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E20017D9749D007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */, + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */, + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22117D9749E007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1FE17D9749D007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */, + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */, + 8848E21217D9749D007110E0 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E21F17D9749E007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E22917D9749E007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E20117D9749D007110E0 /* Recipe 16-5 Printing a View */; + targetProxy = 8848E22817D9749E007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E20E17D9749D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E20F17D9749D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E21717D9749D007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E21817D9749D007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E22D17D9749E007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E22E17D9749E007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E23217D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E23317D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E23517D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-5 Printing a View-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-5 Printing a View-Info.plist"; + PRODUCT_NAME = "Recipe 16-5 Printing a View"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E23617D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-5 Printing a View-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-5 Printing a View-Info.plist"; + PRODUCT_NAME = "Recipe 16-5 Printing a View"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E23817D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-5 Printing a ViewTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-5 Printing a ViewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E23917D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-5 Printing a ViewTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-5 Printing a ViewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-5 Printing a View" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23217D9749E007110E0 /* Debug */, + 8848E23317D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-5 Printing a View" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23517D9749E007110E0 /* Debug */, + 8848E23617D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-5 Printing a ViewTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23817D9749E007110E0 /* Debug */, + 8848E23917D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1FA17D9749D007110E0 /* Project object */; +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b9a2024 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..d7bb705 Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme new file mode 100644 index 0000000..2ed9c9d --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 16-1_ Composing Text Messages.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f631445 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-5 Printing a View/Recipe 16-5 Printing a View.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 16-1: Composing Text Messages.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8848E20117D9749D007110E0 + + primary + + + 8848E22217D9749E007110E0 + + primary + + + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/.DS_Store b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/.DS_Store new file mode 100644 index 0000000..f5889cc Binary files /dev/null and b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/.DS_Store differ diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/AppDelegate.h b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/AppDelegate.h new file mode 100644 index 0000000..548fca0 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 16-6 Formatted Printing with Page Renderers +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/AppDelegate.m b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/AppDelegate.m new file mode 100644 index 0000000..e5af14c --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 16-6 Formatted Printing with Page Renderers +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b14095e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Base.lproj/Main.storyboard @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Info.plist new file mode 100644 index 0000000..43c2e3f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/ViewController.h b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/ViewController.h new file mode 100644 index 0000000..4e73bfb --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/ViewController.h @@ -0,0 +1,34 @@ +// +// ViewController.h +// Recipe 16-6 Formatted Printing with Page Renderers +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import +#import "DTPageRenderer.h" + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextView *inputTextView; +@property (weak, nonatomic) IBOutlet UIButton *textMessageButton; +@property (weak, nonatomic) IBOutlet UIButton *mailMessageButton; +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *getImageButton; +@property (strong, nonatomic) UIImagePickerController *picker; + +- (IBAction)textMessage:(id)sender; +- (IBAction)mailMessage:(id)sender; +- (IBAction)getImage:(id)sender; +- (IBAction)print:(id)sender; +- (IBAction)printCustom:(id)sender; +- (IBAction)printViewPressed:(id)sender; +- (IBAction)printText:(id)sender; +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/ViewController.m b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/ViewController.m new file mode 100644 index 0000000..55a5a97 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/ViewController.m @@ -0,0 +1,338 @@ +// +// ViewController.m +// Recipe 16-6 Formatted Printing with Page Renderers +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.inputTextView.layer.cornerRadius = 15.0; + self.imageView.layer.cornerRadius = 15.0; + self.inputTextView.delegate = self; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(textMessagingAvailabilityChanged:) + name:MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification + object:nil]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)textMessage:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + MFMessageComposeViewController *messageVC = + [[MFMessageComposeViewController alloc] init]; + messageVC.messageComposeDelegate = self; + messageVC.recipients = @[@"3015555309"]; + messageVC.body = self.inputTextView.text; + [self presentViewController:messageVC animated:YES completion:nil]; + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + +- (IBAction)mailMessage:(id)sender +{ + if ([MFMailComposeViewController canSendMail]) + { + MFMailComposeViewController *mailVC = + [[MFMailComposeViewController alloc] init]; + [mailVC setSubject:@"Send It Out"]; + [mailVC setToRecipients:@[@"test@example.com"]]; + [mailVC setMessageBody:self.inputTextView.text isHTML:NO]; + mailVC.mailComposeDelegate = self; + + if (self.imageView.image != nil) + { + NSData *imageData = UIImageJPEGRepresentation(self.imageView.image, 1.0); + [mailVC addAttachmentData:imageData mimeType:@"image/jpeg" + fileName:@"SelectedImage"]; + } + + [self presentViewController:mailVC animated:YES completion:nil]; + } + else + { + NSLog(@"E-mailing Unavailable"); + } +} + +- (IBAction)getImage:(id)sender +{ + self.picker = [[UIImagePickerController alloc] init]; + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) + { + self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + self.picker.delegate = self; + + [self presentViewController:self.picker animated:YES completion:nil]; + } +} + +- (IBAction)print:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable] + && (self.imageView.image != nil)) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputPhoto; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + + UIImage *image = self.imageView.image; + pic.printingItem = image; + + if (!pic.printingItem && image.size.width> image.size.height) + printInfo.orientation = UIPrintInfoOrientationLandscape; + + pic.printInfo = printInfo; + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Cancelled Printing"); + } + }]; + } +} + +- (IBAction)printCustom:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable]) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + printInfo.orientation = UIPrintInfoOrientationPortrait; + pic.printInfo = printInfo; + + UISimpleTextPrintFormatter *simplePF = + [[UISimpleTextPrintFormatter alloc] initWithText:[self.inputTextView.text + stringByAppendingString:@"/n iOS 7 Recipes"]]; + + + DTPageRenderer *sendPR = [[DTPageRenderer alloc] init]; + sendPR.title = @"My Print Job Title"; + sendPR.author = @"Document Author"; + sendPR.headerHeight = 72.0/2; + sendPR.footerHeight = 72.0/2; + + + + + [sendPR addPrintFormatter:simplePF startingAtPageAtIndex:0]; + + + + NSLog(@"Print formatters%@",sendPR.printFormatters); + + + pic.showsPageRange = NO; + pic.printPageRenderer = sendPR; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Printing Cancelled"); + } + }]; + } +} + +- (IBAction)printViewPressed:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable]) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + printInfo.orientation = UIPrintInfoOrientationLandscape; + pic.printInfo = printInfo; + + UIViewPrintFormatter *viewPF = [self.inputTextView viewPrintFormatter]; + + pic.printFormatter = viewPF; + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing View: %@", error); + } + else + { + NSLog(@"Printing Cancelled"); + } + }]; + } +} + +- (IBAction)printText:(id)sender +{ + if ([UIPrintInteractionController isPrintingAvailable]) + { + UIPrintInteractionController *pic = + [UIPrintInteractionController sharedPrintController]; + + UIPrintInfo *printInfo = [UIPrintInfo printInfo]; + printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.jobName = self.title; + printInfo.duplex = UIPrintInfoDuplexLongEdge; + pic.printInfo = printInfo; + + UISimpleTextPrintFormatter *simpleTextPF = + [[UISimpleTextPrintFormatter alloc] initWithText:self.inputTextView.text]; + simpleTextPF.startPage = 0; + simpleTextPF.contentInsets = UIEdgeInsetsMake(72.0, 72.0, 72.0, 72.0); + simpleTextPF.maximumContentWidth = 6*72.0; + + pic.printFormatter = simpleTextPF; + + pic.showsPageRange = YES; + + [pic presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *printInteractionController, BOOL completed, + NSError *error) + { + if (!completed && (error != nil)) + { + NSLog(@"Error Printing: %@", error); + } + else + { + NSLog(@"Printing Cancelled"); + } + }]; + } +} + +#pragma mark - helper methods + +-(void)textMessagingAvailabilityChanged:(id)sender +{ + if ([MFMessageComposeViewController canSendText]) + { + NSLog(@"Text Messaging Available"); + } + else + { + NSLog(@"Text Messaging Unavailable"); + } +} + + +#pragma mark - Text Message Delegate methods + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)text +{ + if ([text isEqualToString:@"\n"]) + { + [textView resignFirstResponder]; + return NO; + } + return YES; +} + +-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result +{ + if (result == MessageComposeResultSent) + { + self.inputTextView.text = @"Message sent."; + } + else if (result == MessageComposeResultFailed) + { + NSLog(@"Failed to send message!"); + } + [self dismissViewControllerAnimated:YES completion:nil]; +} + + + +#pragma mark - Mail Message Delegate Methods + +-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error +{ + if (result == MFMailComposeResultSent) + { + self.inputTextView.text = @"Mail sent."; + self.imageView.image = nil; + } + else if (result == MFMailComposeResultCancelled) + NSLog(@"Mail Cancelled"); + else if (result == MFMailComposeResultFailed) + NSLog(@"Error, Mail Send Failed"); + else if (result == MFMailComposeResultSaved) + NSLog(@"Mail Saved"); + [self dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark - Image Picker Delegates + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + self.imageView.image = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + + [self.picker dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/main.m b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/main.m new file mode 100644 index 0000000..7808d8e --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text Messages/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 16-1: Composing Text Messages +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/DTPageRenderer.h b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/DTPageRenderer.h new file mode 100644 index 0000000..87d7855 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/DTPageRenderer.h @@ -0,0 +1,19 @@ +// +// DTPageRenderer.h +// Recipe 16-6 Formatted Printing with Page Renderers +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface DTPageRenderer : UIPrintPageRenderer + +@property (nonatomic, strong) NSString *title; +@property (nonatomic, strong) NSString *author; + + + + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/DTPageRenderer.m b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/DTPageRenderer.m new file mode 100644 index 0000000..072a46c --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/DTPageRenderer.m @@ -0,0 +1,69 @@ +// +// DTPageRenderer.m +// Recipe 16-6 Formatted Printing with Page Renderers +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "DTPageRenderer.h" + +@implementation DTPageRenderer + +- (void)drawHeaderForPageAtIndex:(NSInteger)pageIndex inRect:(CGRect)headerRect +{ + if(pageIndex == 0) + { + UIFont *font = [UIFont fontWithName:@"Helvetica" size:12.0]; + CGSize titleSize = [self.title sizeWithAttributes:@{NSFontAttributeName:font}]; + + CGFloat drawXTitle = CGRectGetMaxX(headerRect) - titleSize.width; + CGFloat drawXAuthor = CGRectGetMinX(headerRect); + CGFloat drawY = CGRectGetMinY(headerRect); + CGPoint drawPointAuthor = CGPointMake(drawXAuthor, drawY); + CGPoint drawPointTitle = CGPointMake(drawXTitle, drawY); + + [self.title drawAtPoint:drawPointTitle withAttributes:@{NSFontAttributeName:font}]; + [self.author drawAtPoint:drawPointAuthor withAttributes:@{NSFontAttributeName:font}]; + } +} + +- (void)drawFooterForPageAtIndex:(NSInteger)pageIndex inRect:(CGRect)footerRect +{ + UIFont *font = [UIFont fontWithName:@"Helvetica" size:12.0]; + NSString *pageNumber = [NSString stringWithFormat:@"%d.", pageIndex+1]; + + CGSize pageNumSize = [pageNumber sizeWithAttributes:@{NSFontAttributeName:font}]; + CGFloat drawX = CGRectGetMaxX(footerRect)/2.0 - pageNumSize.width - 1.0; + CGFloat drawY = CGRectGetMaxY(footerRect) - pageNumSize.height; + CGPoint drawPoint = CGPointMake(drawX, drawY); + [pageNumber drawAtPoint:drawPoint withAttributes:@{NSFontAttributeName:font}]; +} + +-(void)drawPrintFormatter:(UIPrintFormatter *)printFormatter forPageAtIndex:(NSInteger)pageIndex +{ + CGRect contentRect = CGRectMake(self.printableRect.origin.x, + self.printableRect.origin.y+self.headerHeight, self.printableRect.size.width, + self.printableRect.size.height-self.headerHeight-self.footerHeight); + + + [printFormatter drawInRect:contentRect forPageAtIndex:pageIndex]; + + + NSLog(@"pageIndex: %ld:",(long)pageIndex); + + NSString *overlayText = @"Overlay Text"; + UIFont *font = [UIFont fontWithName:@"Helvetica"size:26.0]; + CGSize overlaySize = [overlayText sizeWithAttributes:@{NSFontAttributeName:font}]; + + CGFloat xCenter = CGRectGetMaxX(self.printableRect)/2.0 - overlaySize.width/2.0; + CGFloat yCenter = CGRectGetMaxY(self.printableRect)/2.0 - overlaySize.height/2.0; + CGPoint overlayPoint = CGPointMake(xCenter, yCenter); + + [overlayText drawAtPoint:overlayPoint withAttributes:@{NSFontAttributeName:font}]; +} + + + + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m new file mode 100644 index 0000000..4c8c8d8 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/Recipe_16_1__Composing_Text_MessagesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_16_1__Composing_Text_MessagesTests.m +// Recipe 16-1: Composing Text MessagesTests +// +// Created by joseph hoffman on 9/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_16_1__Composing_Text_MessagesTests : XCTestCase + +@end + +@implementation Recipe_16_1__Composing_Text_MessagesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-1_ Composing Text MessagesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-6 Formatted Printing with Page Renderers.xcodeproj/project.pbxproj b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-6 Formatted Printing with Page Renderers.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5c1cae3 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-6 Formatted Printing with Page Renderers.xcodeproj/project.pbxproj @@ -0,0 +1,483 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20717D9749D007110E0 /* CoreGraphics.framework */; }; + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E20E17D9749D007110E0 /* InfoPlist.strings */; }; + 8848E21217D9749D007110E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21117D9749D007110E0 /* main.m */; }; + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21517D9749D007110E0 /* AppDelegate.m */; }; + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21717D9749D007110E0 /* Main.storyboard */; }; + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E21B17D9749D007110E0 /* ViewController.m */; }; + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848E21D17D9749D007110E0 /* Images.xcassets */; }; + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E22417D9749E007110E0 /* XCTest.framework */; }; + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20517D9749D007110E0 /* Foundation.framework */; }; + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E20917D9749D007110E0 /* UIKit.framework */; }; + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8848E22D17D9749E007110E0 /* InfoPlist.strings */; }; + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */; }; + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8848E23A17D97946007110E0 /* MessageUI.framework */; }; + 8848E23E17DCF9C8007110E0 /* DTPageRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8848E23D17DCF9C8007110E0 /* DTPageRenderer.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8848E22817D9749E007110E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8848E1FA17D9749D007110E0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8848E20117D9749D007110E0; + remoteInfo = "Recipe 16-1: Composing Text Messages"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8848E20217D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 16-6 Formatted Printing with Page Renderers.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E20517D9749D007110E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8848E20717D9749D007110E0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8848E20917D9749D007110E0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8848E20D17D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-6 Formatted Printing with Page Renderers-Info.plist"; sourceTree = ""; }; + 8848E20F17D9749D007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E21117D9749D007110E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8848E21317D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch"; sourceTree = ""; }; + 8848E21417D9749D007110E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8848E21517D9749D007110E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8848E21817D9749D007110E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8848E21A17D9749D007110E0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8848E21B17D9749D007110E0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8848E21D17D9749D007110E0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8848E22317D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page RenderersTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 16-6 Formatted Printing with Page RenderersTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8848E22417D9749E007110E0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8848E22C17D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist"; sourceTree = ""; }; + 8848E22E17D9749E007110E0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_16_1__Composing_Text_MessagesTests.m; sourceTree = ""; }; + 8848E23A17D97946007110E0 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + 8848E23C17DCF9C8007110E0 /* DTPageRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DTPageRenderer.h; path = "Recipe 16-1: Composing Text MessagesTests/DTPageRenderer.h"; sourceTree = SOURCE_ROOT; }; + 8848E23D17DCF9C8007110E0 /* DTPageRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DTPageRenderer.m; path = "Recipe 16-1: Composing Text MessagesTests/DTPageRenderer.m"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8848E1FF17D9749D007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23B17D97946007110E0 /* MessageUI.framework in Frameworks */, + 8848E20817D9749D007110E0 /* CoreGraphics.framework in Frameworks */, + 8848E20A17D9749D007110E0 /* UIKit.framework in Frameworks */, + 8848E20617D9749D007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22017D9749E007110E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22517D9749E007110E0 /* XCTest.framework in Frameworks */, + 8848E22717D9749E007110E0 /* UIKit.framework in Frameworks */, + 8848E22617D9749E007110E0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8848E1F917D9749D007110E0 = { + isa = PBXGroup; + children = ( + 8848E20B17D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers */, + 8848E22A17D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers Test */, + 8848E20417D9749D007110E0 /* Frameworks */, + 8848E20317D9749D007110E0 /* Products */, + ); + sourceTree = ""; + }; + 8848E20317D9749D007110E0 /* Products */ = { + isa = PBXGroup; + children = ( + 8848E20217D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers.app */, + 8848E22317D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page RenderersTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8848E20417D9749D007110E0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8848E23A17D97946007110E0 /* MessageUI.framework */, + 8848E20517D9749D007110E0 /* Foundation.framework */, + 8848E20717D9749D007110E0 /* CoreGraphics.framework */, + 8848E20917D9749D007110E0 /* UIKit.framework */, + 8848E22417D9749E007110E0 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8848E20B17D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers */ = { + isa = PBXGroup; + children = ( + 8848E21417D9749D007110E0 /* AppDelegate.h */, + 8848E21517D9749D007110E0 /* AppDelegate.m */, + 8848E21717D9749D007110E0 /* Main.storyboard */, + 8848E21A17D9749D007110E0 /* ViewController.h */, + 8848E21B17D9749D007110E0 /* ViewController.m */, + 8848E23C17DCF9C8007110E0 /* DTPageRenderer.h */, + 8848E23D17DCF9C8007110E0 /* DTPageRenderer.m */, + 8848E21D17D9749D007110E0 /* Images.xcassets */, + 8848E20C17D9749D007110E0 /* Supporting Files */, + ); + name = "Recipe 16-6 Formatted Printing with Page Renderers"; + path = "Recipe 16-1: Composing Text Messages"; + sourceTree = ""; + }; + 8848E20C17D9749D007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E20D17D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers-Info.plist */, + 8848E20E17D9749D007110E0 /* InfoPlist.strings */, + 8848E21117D9749D007110E0 /* main.m */, + 8848E21317D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8848E22A17D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers Test */ = { + isa = PBXGroup; + children = ( + 8848E23017D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m */, + 8848E22B17D9749E007110E0 /* Supporting Files */, + ); + name = "Recipe 16-6 Formatted Printing with Page Renderers Test"; + path = "Recipe 16-1: Composing Text MessagesTests"; + sourceTree = ""; + }; + 8848E22B17D9749E007110E0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8848E22C17D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist */, + 8848E22D17D9749E007110E0 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8848E20117D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-6 Formatted Printing with Page Renderers" */; + buildPhases = ( + 8848E1FE17D9749D007110E0 /* Sources */, + 8848E1FF17D9749D007110E0 /* Frameworks */, + 8848E20017D9749D007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 16-6 Formatted Printing with Page Renderers"; + productName = "Recipe 16-1: Composing Text Messages"; + productReference = 8848E20217D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers.app */; + productType = "com.apple.product-type.application"; + }; + 8848E22217D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page RenderersTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-6 Formatted Printing with Page RenderersTests" */; + buildPhases = ( + 8848E21F17D9749E007110E0 /* Sources */, + 8848E22017D9749E007110E0 /* Frameworks */, + 8848E22117D9749E007110E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8848E22917D9749E007110E0 /* PBXTargetDependency */, + ); + name = "Recipe 16-6 Formatted Printing with Page RenderersTests"; + productName = "Recipe 16-1: Composing Text MessagesTests"; + productReference = 8848E22317D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page RenderersTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8848E1FA17D9749D007110E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8848E22217D9749E007110E0 = { + TestTargetID = 8848E20117D9749D007110E0; + }; + }; + }; + buildConfigurationList = 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-6 Formatted Printing with Page Renderers" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8848E1F917D9749D007110E0; + productRefGroup = 8848E20317D9749D007110E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8848E20117D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers */, + 8848E22217D9749E007110E0 /* Recipe 16-6 Formatted Printing with Page RenderersTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8848E20017D9749D007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21E17D9749D007110E0 /* Images.xcassets in Resources */, + 8848E21017D9749D007110E0 /* InfoPlist.strings in Resources */, + 8848E21917D9749D007110E0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E22117D9749E007110E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E22F17D9749E007110E0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8848E1FE17D9749D007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E21C17D9749D007110E0 /* ViewController.m in Sources */, + 8848E21617D9749D007110E0 /* AppDelegate.m in Sources */, + 8848E21217D9749D007110E0 /* main.m in Sources */, + 8848E23E17DCF9C8007110E0 /* DTPageRenderer.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8848E21F17D9749E007110E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8848E23117D9749E007110E0 /* Recipe_16_1__Composing_Text_MessagesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8848E22917D9749E007110E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8848E20117D9749D007110E0 /* Recipe 16-6 Formatted Printing with Page Renderers */; + targetProxy = 8848E22817D9749E007110E0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8848E20E17D9749D007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E20F17D9749D007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8848E21717D9749D007110E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8848E21817D9749D007110E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8848E22D17D9749E007110E0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8848E22E17D9749E007110E0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8848E23217D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8848E23317D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8848E23517D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Info.plist"; + PRODUCT_NAME = "Recipe 16-6 Formatted Printing with Page Renderers"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8848E23617D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text Messages/Recipe 16-6 Formatted Printing with Page Renderers-Info.plist"; + PRODUCT_NAME = "Recipe 16-6 Formatted Printing with Page Renderers"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8848E23817D9749E007110E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-6 Formatted Printing with Page RenderersTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8848E23917D9749E007110E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 16-1: Composing Text Messages.app/Recipe 16-1: Composing Text Messages"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 16-1: Composing Text Messages/Recipe 16-1: Composing Text Messages-Prefix.pch"; + INFOPLIST_FILE = "Recipe 16-1: Composing Text MessagesTests/Recipe 16-6 Formatted Printing with Page RenderersTests-Info.plist"; + PRODUCT_NAME = "Recipe 16-6 Formatted Printing with Page RenderersTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8848E1FD17D9749D007110E0 /* Build configuration list for PBXProject "Recipe 16-6 Formatted Printing with Page Renderers" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23217D9749E007110E0 /* Debug */, + 8848E23317D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23417D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-6 Formatted Printing with Page Renderers" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23517D9749E007110E0 /* Debug */, + 8848E23617D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8848E23717D9749E007110E0 /* Build configuration list for PBXNativeTarget "Recipe 16-6 Formatted Printing with Page RenderersTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8848E23817D9749E007110E0 /* Debug */, + 8848E23917D9749E007110E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8848E1FA17D9749D007110E0 /* Project object */; +} diff --git a/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-6 Formatted Printing with Page Renderers.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-6 Formatted Printing with Page Renderers.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..047d187 --- /dev/null +++ b/CH16 - Data Transmission Recipes/Recipe 16-6 Formatted Printing with Page Renderers/Recipe 16-6 Formatted Printing with Page Renderers.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/.DS_Store b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/.DS_Store new file mode 100644 index 0000000..3f708f9 Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/.DS_Store differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.pbxproj b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.pbxproj new file mode 100644 index 0000000..adacc56 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.pbxproj @@ -0,0 +1,501 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88039D1D17DD72BA00A298EF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1C17DD72BA00A298EF /* Foundation.framework */; }; + 88039D1F17DD72BA00A298EF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */; }; + 88039D2117DD72BA00A298EF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D2017DD72BA00A298EF /* UIKit.framework */; }; + 88039D2717DD72BA00A298EF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88039D2517DD72BA00A298EF /* InfoPlist.strings */; }; + 88039D2917DD72BA00A298EF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D2817DD72BA00A298EF /* main.m */; }; + 88039D2D17DD72BA00A298EF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D2C17DD72BA00A298EF /* AppDelegate.m */; }; + 88039D3017DD72BA00A298EF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88039D2E17DD72BA00A298EF /* Main.storyboard */; }; + 88039D3317DD72BA00A298EF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D3217DD72BA00A298EF /* ViewController.m */; }; + 88039D3517DD72BA00A298EF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88039D3417DD72BA00A298EF /* Images.xcassets */; }; + 88039D3C17DD72BA00A298EF /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D3B17DD72BA00A298EF /* XCTest.framework */; }; + 88039D3D17DD72BA00A298EF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1C17DD72BA00A298EF /* Foundation.framework */; }; + 88039D3E17DD72BA00A298EF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D2017DD72BA00A298EF /* UIKit.framework */; }; + 88039D4617DD72BA00A298EF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88039D4417DD72BA00A298EF /* InfoPlist.strings */; }; + 88039D4817DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */; }; + 885BD41417DE95DA0069026B /* GameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885BD41217DE95DA0069026B /* GameViewController.m */; }; + 885BD41517DE95DA0069026B /* GameViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 885BD41317DE95DA0069026B /* GameViewController.xib */; }; + 88C51E9117DECF360081BB46 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88C51E9017DECF360081BB46 /* GameKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88039D3F17DD72BA00A298EF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88039D1117DD72BA00A298EF /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88039D1817DD72BA00A298EF; + remoteInfo = "Recipe 17-1 Making Your App Game Center Aware"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88039D1917DD72BA00A298EF /* Lucky.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Lucky.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 88039D1C17DD72BA00A298EF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88039D2017DD72BA00A298EF /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88039D2417DD72BA00A298EF /* Lucky-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Lucky-Info.plist"; sourceTree = ""; }; + 88039D2617DD72BA00A298EF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88039D2817DD72BA00A298EF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88039D2A17DD72BA00A298EF /* Lucky-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Lucky-Prefix.pch"; sourceTree = ""; }; + 88039D2B17DD72BA00A298EF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88039D2C17DD72BA00A298EF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88039D2F17DD72BA00A298EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88039D3117DD72BA00A298EF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88039D3217DD72BA00A298EF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88039D3417DD72BA00A298EF /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LuckyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 88039D3B17DD72BA00A298EF /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88039D4317DD72BA00A298EF /* LuckyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LuckyTests-Info.plist"; sourceTree = ""; }; + 88039D4517DD72BA00A298EF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m; sourceTree = ""; }; + 885BD41117DE95DA0069026B /* GameViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameViewController.h; sourceTree = ""; }; + 885BD41217DE95DA0069026B /* GameViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameViewController.m; sourceTree = ""; }; + 885BD41317DE95DA0069026B /* GameViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GameViewController.xib; sourceTree = ""; }; + 88C51E9017DECF360081BB46 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88039D1617DD72BA00A298EF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D1F17DD72BA00A298EF /* CoreGraphics.framework in Frameworks */, + 88039D2117DD72BA00A298EF /* UIKit.framework in Frameworks */, + 88039D1D17DD72BA00A298EF /* Foundation.framework in Frameworks */, + 88C51E9117DECF360081BB46 /* GameKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3717DD72BA00A298EF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D3C17DD72BA00A298EF /* XCTest.framework in Frameworks */, + 88039D3E17DD72BA00A298EF /* UIKit.framework in Frameworks */, + 88039D3D17DD72BA00A298EF /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88039D1017DD72BA00A298EF = { + isa = PBXGroup; + children = ( + 88039D2217DD72BA00A298EF /* Lucky */, + 88039D4117DD72BA00A298EF /* Lucky Test */, + 88039D1B17DD72BA00A298EF /* Frameworks */, + 88039D1A17DD72BA00A298EF /* Products */, + ); + sourceTree = ""; + }; + 88039D1A17DD72BA00A298EF /* Products */ = { + isa = PBXGroup; + children = ( + 88039D1917DD72BA00A298EF /* Lucky.app */, + 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88039D1B17DD72BA00A298EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88C51E9017DECF360081BB46 /* GameKit.framework */, + 88039D1C17DD72BA00A298EF /* Foundation.framework */, + 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */, + 88039D2017DD72BA00A298EF /* UIKit.framework */, + 88039D3B17DD72BA00A298EF /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88039D2217DD72BA00A298EF /* Lucky */ = { + isa = PBXGroup; + children = ( + 88039D2B17DD72BA00A298EF /* AppDelegate.h */, + 88039D2C17DD72BA00A298EF /* AppDelegate.m */, + 88039D2E17DD72BA00A298EF /* Main.storyboard */, + 885BD41117DE95DA0069026B /* GameViewController.h */, + 885BD41217DE95DA0069026B /* GameViewController.m */, + 885BD41317DE95DA0069026B /* GameViewController.xib */, + 88039D3117DD72BA00A298EF /* ViewController.h */, + 88039D3217DD72BA00A298EF /* ViewController.m */, + 88039D3417DD72BA00A298EF /* Images.xcassets */, + 88039D2317DD72BA00A298EF /* Supporting Files */, + ); + name = Lucky; + path = "Recipe 17-1 Making Your App Game Center Aware"; + sourceTree = ""; + }; + 88039D2317DD72BA00A298EF /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88039D2417DD72BA00A298EF /* Lucky-Info.plist */, + 88039D2517DD72BA00A298EF /* InfoPlist.strings */, + 88039D2817DD72BA00A298EF /* main.m */, + 88039D2A17DD72BA00A298EF /* Lucky-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88039D4117DD72BA00A298EF /* Lucky Test */ = { + isa = PBXGroup; + children = ( + 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */, + 88039D4217DD72BA00A298EF /* Supporting Files */, + ); + name = "Lucky Test"; + path = "Recipe 17-1 Making Your App Game Center AwareTests"; + sourceTree = ""; + }; + 88039D4217DD72BA00A298EF /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88039D4317DD72BA00A298EF /* LuckyTests-Info.plist */, + 88039D4417DD72BA00A298EF /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88039D1817DD72BA00A298EF /* Lucky */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88039D4B17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "Lucky" */; + buildPhases = ( + 88039D1517DD72BA00A298EF /* Sources */, + 88039D1617DD72BA00A298EF /* Frameworks */, + 88039D1717DD72BA00A298EF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Lucky; + productName = "Recipe 17-1 Making Your App Game Center Aware"; + productReference = 88039D1917DD72BA00A298EF /* Lucky.app */; + productType = "com.apple.product-type.application"; + }; + 88039D3917DD72BA00A298EF /* LuckyTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88039D4E17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "LuckyTests" */; + buildPhases = ( + 88039D3617DD72BA00A298EF /* Sources */, + 88039D3717DD72BA00A298EF /* Frameworks */, + 88039D3817DD72BA00A298EF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88039D4017DD72BA00A298EF /* PBXTargetDependency */, + ); + name = LuckyTests; + productName = "Recipe 17-1 Making Your App Game Center AwareTests"; + productReference = 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88039D1117DD72BA00A298EF /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88039D1817DD72BA00A298EF = { + DevelopmentTeam = H7ALWBN8YV; + SystemCapabilities = { + com.apple.GameCenter = { + enabled = 1; + }; + }; + }; + 88039D3917DD72BA00A298EF = { + TestTargetID = 88039D1817DD72BA00A298EF; + }; + }; + }; + buildConfigurationList = 88039D1417DD72BA00A298EF /* Build configuration list for PBXProject "Lucky" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88039D1017DD72BA00A298EF; + productRefGroup = 88039D1A17DD72BA00A298EF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88039D1817DD72BA00A298EF /* Lucky */, + 88039D3917DD72BA00A298EF /* LuckyTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88039D1717DD72BA00A298EF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885BD41517DE95DA0069026B /* GameViewController.xib in Resources */, + 88039D3517DD72BA00A298EF /* Images.xcassets in Resources */, + 88039D2717DD72BA00A298EF /* InfoPlist.strings in Resources */, + 88039D3017DD72BA00A298EF /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3817DD72BA00A298EF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D4617DD72BA00A298EF /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88039D1517DD72BA00A298EF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885BD41417DE95DA0069026B /* GameViewController.m in Sources */, + 88039D3317DD72BA00A298EF /* ViewController.m in Sources */, + 88039D2D17DD72BA00A298EF /* AppDelegate.m in Sources */, + 88039D2917DD72BA00A298EF /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3617DD72BA00A298EF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D4817DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88039D4017DD72BA00A298EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88039D1817DD72BA00A298EF /* Lucky */; + targetProxy = 88039D3F17DD72BA00A298EF /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88039D2517DD72BA00A298EF /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88039D2617DD72BA00A298EF /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88039D2E17DD72BA00A298EF /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88039D2F17DD72BA00A298EF /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88039D4417DD72BA00A298EF /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88039D4517DD72BA00A298EF /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88039D4917DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88039D4A17DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88039D4C17DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist"; + PRODUCT_NAME = Lucky; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88039D4D17DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist"; + PRODUCT_NAME = Lucky; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88039D4F17DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 17-1 Making Your App Game Center Aware.app/Recipe 17-1 Making Your App Game Center Aware"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist"; + PRODUCT_NAME = LuckyTests; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88039D5017DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 17-1 Making Your App Game Center Aware.app/Recipe 17-1 Making Your App Game Center Aware"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist"; + PRODUCT_NAME = LuckyTests; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88039D1417DD72BA00A298EF /* Build configuration list for PBXProject "Lucky" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4917DD72BA00A298EF /* Debug */, + 88039D4A17DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88039D4B17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "Lucky" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4C17DD72BA00A298EF /* Debug */, + 88039D4D17DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88039D4E17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "LuckyTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4F17DD72BA00A298EF /* Debug */, + 88039D5017DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88039D1117DD72BA00A298EF /* Project object */; +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1116762 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..5d4c2af Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..0bdf7a1 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme new file mode 100644 index 0000000..0ad87be --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..35fae4e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 17-1 Making Your App Game Center Aware.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88039D1817DD72BA00A298EF + + primary + + + 88039D3917DD72BA00A298EF + + primary + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h new file mode 100644 index 0000000..27b527e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m new file mode 100644 index 0000000..ea99077 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard new file mode 100644 index 0000000..993bb9e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h new file mode 100644 index 0000000..fde2838 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h @@ -0,0 +1,30 @@ +// +// GameViewController.h +// Lucky +// +// Created by joseph hoffman on 9/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface GameViewController : UIViewController +{ +@private + int _score; + int _level; +} + + +@property (weak, nonatomic) IBOutlet UILabel *scoreLabel; +@property (weak, nonatomic) IBOutlet UIButton *button1; +@property (weak, nonatomic) IBOutlet UIButton *button2; +@property (weak, nonatomic) IBOutlet UIButton *button3; +@property (weak, nonatomic) IBOutlet UIButton *button4; + +- (IBAction)gameButtonSelected:(UIButton *)sender; + +- (id)initWithLevel:(int)level; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m new file mode 100644 index 0000000..c2f44df --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m @@ -0,0 +1,172 @@ +// +// GameViewController.m +// Lucky +// +// Created by joseph hoffman on 9/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GameViewController.h" + +@interface GameViewController () + +@end + +@implementation GameViewController + +- (id)initWithLevel:(int)level +{ + self = [super initWithNibName:nil bundle:nil]; + if (self) + { + _level = level; + _score = 0; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + switch (_level) + { + case 0: + self.title = @"Easy Game"; + break; + case 1: + self.title = @"Normal Game"; + break; + case 2: + self.title = @"Hard Game"; + break; + + default: + break; + } + + [self updateScoreLabel]; + [self setupButtons]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +- (IBAction)gameButtonSelected:(UIButton *)sender +{ + if (sender.tag == 0) + { + // Safe, continue game + _score += 1; + [self updateScoreLabel]; + [self setupButtons]; + } + else + { + // Game Over + NSString *message = [NSString stringWithFormat:@"Your score was %i.", _score]; + UIAlertView *gameOverAlert = [[UIAlertView alloc] initWithTitle:@"Game Over" + message:message delegate:self cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [gameOverAlert show]; + } +} + +#pragma mark - helper methods +- (void)updateScoreLabel +{ + self.scoreLabel.text = [NSString stringWithFormat:@"Score: %i", _score]; +} + +- (void)setupButtons +{ + switch (_level) { + case 0: + [self setupButtonsForEasyGame]; + break; + case 1: + [self setupButtonsForNormalGame]; + break; + case 2: + [self setupButtonsForHardGame]; + break; + + default: + break; + } +} + +- (void)setupButtonsForEasyGame +{ + [self resetButtonTags]; + int killerButtonIndex = rand() % 4; + [self buttonForIndex:killerButtonIndex].tag = 1; +} + +- (void)setupButtonsForNormalGame +{ + [self resetButtonTags]; + int killerButtonIndex1 = rand() % 4; + int killerButtonIndex2; + do { + killerButtonIndex2 = rand() % 4; + } while (killerButtonIndex1 == killerButtonIndex2); + + [self buttonForIndex:killerButtonIndex1].tag = 1; + [self buttonForIndex:killerButtonIndex2].tag = 1; +} + +- (void)setupButtonsForHardGame +{ + int safeButtonIndex = rand() % 4; + for (int i=0; i < 4; i++) { + if (i == safeButtonIndex) { + [self buttonForIndex:i].tag = 0; + } + else + { + [self buttonForIndex:i].tag = 1; + } + } +} + + +- (void)resetButtonTags +{ + for (int i = 0; i < 4; i++) + { + UIButton *button = [self buttonForIndex:i]; + button.tag = 0; + } +} + +- (UIButton *)buttonForIndex:(int)index +{ + switch (index) + { + case 0: + return self.button1; + case 1: + return self.button2; + case 2: + return self.button3; + case 3: + return self.button4; + default: + return nil; + } +} + +#pragma mark - delegate methods + +- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + [self.navigationController popViewControllerAnimated:YES]; +} + + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib new file mode 100644 index 0000000..7811f9f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist new file mode 100644 index 0000000..35e69b3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist @@ -0,0 +1,41 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + gamekit + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/ViewController.h b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/ViewController.h new file mode 100644 index 0000000..6e7fd34 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/ViewController.h @@ -0,0 +1,24 @@ +// +// ViewController.h +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "GameViewController.h" +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *welcomeLabel; +@property (strong, nonatomic) GKLocalPlayer *player; + +- (IBAction)playEasyGame:(id)sender; +- (IBAction)playNormalGame:(id)sender; +- (IBAction)playHardGame:(id)sender; + +- (IBAction)showGameCenter:(id)sender; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/ViewController.m b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/ViewController.m new file mode 100644 index 0000000..b4807b7 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/ViewController.m @@ -0,0 +1,112 @@ +// +// ViewController.m +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.player = nil; + [self authenticatePlayer]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +#pragma mark - custom setters + +- (void)setPlayer:(GKLocalPlayer *)player +{ + _player = player; + NSString *playerName; + if (_player) + { + playerName = _player.alias; + } + else + { + playerName = @"Anonymous Player"; + } + self.welcomeLabel.text = [NSString stringWithFormat:@"Welcome %@", playerName]; +} + +- (IBAction)playEasyGame:(id)sender +{ + [self playGameWithLevel:0]; +} + +- (IBAction)playNormalGame:(id)sender +{ + [self playGameWithLevel:1]; +} + +- (IBAction)playHardGame:(id)sender +{ + [self playGameWithLevel:2]; +} + +- (IBAction)showGameCenter:(id)sender +{ + GKGameCenterViewController *gameCenterController = + [[GKGameCenterViewController alloc] init]; + if (gameCenterController != nil) + { + gameCenterController.gameCenterDelegate = self; + [self presentViewController:gameCenterController animated:YES completion:nil]; + } +} +#pragma mark - helper methods + +- (void)playGameWithLevel:(int)level +{ + GameViewController *gameViewController = + [[GameViewController alloc] initWithLevel:level]; + [self.navigationController pushViewController:gameViewController animated:YES]; +} + +- (void)authenticatePlayer +{ + __weak GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; + localPlayer.authenticateHandler = + ^(UIViewController *authenticateViewController, NSError *error) + { + if (authenticateViewController != nil) + { + [self presentViewController:authenticateViewController animated:YES + completion:nil]; + } + else if (localPlayer.isAuthenticated) + { + self.player = localPlayer; + } + else + { + // Disable Game Center + self.player = nil; + } + }; +} + +#pragma mark - delegate methods + +- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/main.m b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/main.m new file mode 100644 index 0000000..252b578 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 17-1 Making Your App Game Center Aware +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m new file mode 100644 index 0000000..feef3a0 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m @@ -0,0 +1,34 @@ +// +// Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m +// Recipe 17-1 Making Your App Game Center AwareTests +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_17_1_Making_Your_App_Game_Center_AwareTests : XCTestCase + +@end + +@implementation Recipe_17_1_Making_Your_App_Game_Center_AwareTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/.DS_Store b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/.DS_Store new file mode 100644 index 0000000..948079e Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/.DS_Store differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.pbxproj b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.pbxproj new file mode 100644 index 0000000..adacc56 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.pbxproj @@ -0,0 +1,501 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88039D1D17DD72BA00A298EF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1C17DD72BA00A298EF /* Foundation.framework */; }; + 88039D1F17DD72BA00A298EF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */; }; + 88039D2117DD72BA00A298EF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D2017DD72BA00A298EF /* UIKit.framework */; }; + 88039D2717DD72BA00A298EF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88039D2517DD72BA00A298EF /* InfoPlist.strings */; }; + 88039D2917DD72BA00A298EF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D2817DD72BA00A298EF /* main.m */; }; + 88039D2D17DD72BA00A298EF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D2C17DD72BA00A298EF /* AppDelegate.m */; }; + 88039D3017DD72BA00A298EF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88039D2E17DD72BA00A298EF /* Main.storyboard */; }; + 88039D3317DD72BA00A298EF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D3217DD72BA00A298EF /* ViewController.m */; }; + 88039D3517DD72BA00A298EF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88039D3417DD72BA00A298EF /* Images.xcassets */; }; + 88039D3C17DD72BA00A298EF /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D3B17DD72BA00A298EF /* XCTest.framework */; }; + 88039D3D17DD72BA00A298EF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1C17DD72BA00A298EF /* Foundation.framework */; }; + 88039D3E17DD72BA00A298EF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D2017DD72BA00A298EF /* UIKit.framework */; }; + 88039D4617DD72BA00A298EF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88039D4417DD72BA00A298EF /* InfoPlist.strings */; }; + 88039D4817DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */; }; + 885BD41417DE95DA0069026B /* GameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885BD41217DE95DA0069026B /* GameViewController.m */; }; + 885BD41517DE95DA0069026B /* GameViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 885BD41317DE95DA0069026B /* GameViewController.xib */; }; + 88C51E9117DECF360081BB46 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88C51E9017DECF360081BB46 /* GameKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88039D3F17DD72BA00A298EF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88039D1117DD72BA00A298EF /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88039D1817DD72BA00A298EF; + remoteInfo = "Recipe 17-1 Making Your App Game Center Aware"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88039D1917DD72BA00A298EF /* Lucky.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Lucky.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 88039D1C17DD72BA00A298EF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88039D2017DD72BA00A298EF /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88039D2417DD72BA00A298EF /* Lucky-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Lucky-Info.plist"; sourceTree = ""; }; + 88039D2617DD72BA00A298EF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88039D2817DD72BA00A298EF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88039D2A17DD72BA00A298EF /* Lucky-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Lucky-Prefix.pch"; sourceTree = ""; }; + 88039D2B17DD72BA00A298EF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88039D2C17DD72BA00A298EF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88039D2F17DD72BA00A298EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88039D3117DD72BA00A298EF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88039D3217DD72BA00A298EF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88039D3417DD72BA00A298EF /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LuckyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 88039D3B17DD72BA00A298EF /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88039D4317DD72BA00A298EF /* LuckyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LuckyTests-Info.plist"; sourceTree = ""; }; + 88039D4517DD72BA00A298EF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m; sourceTree = ""; }; + 885BD41117DE95DA0069026B /* GameViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameViewController.h; sourceTree = ""; }; + 885BD41217DE95DA0069026B /* GameViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameViewController.m; sourceTree = ""; }; + 885BD41317DE95DA0069026B /* GameViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GameViewController.xib; sourceTree = ""; }; + 88C51E9017DECF360081BB46 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88039D1617DD72BA00A298EF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D1F17DD72BA00A298EF /* CoreGraphics.framework in Frameworks */, + 88039D2117DD72BA00A298EF /* UIKit.framework in Frameworks */, + 88039D1D17DD72BA00A298EF /* Foundation.framework in Frameworks */, + 88C51E9117DECF360081BB46 /* GameKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3717DD72BA00A298EF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D3C17DD72BA00A298EF /* XCTest.framework in Frameworks */, + 88039D3E17DD72BA00A298EF /* UIKit.framework in Frameworks */, + 88039D3D17DD72BA00A298EF /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88039D1017DD72BA00A298EF = { + isa = PBXGroup; + children = ( + 88039D2217DD72BA00A298EF /* Lucky */, + 88039D4117DD72BA00A298EF /* Lucky Test */, + 88039D1B17DD72BA00A298EF /* Frameworks */, + 88039D1A17DD72BA00A298EF /* Products */, + ); + sourceTree = ""; + }; + 88039D1A17DD72BA00A298EF /* Products */ = { + isa = PBXGroup; + children = ( + 88039D1917DD72BA00A298EF /* Lucky.app */, + 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88039D1B17DD72BA00A298EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88C51E9017DECF360081BB46 /* GameKit.framework */, + 88039D1C17DD72BA00A298EF /* Foundation.framework */, + 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */, + 88039D2017DD72BA00A298EF /* UIKit.framework */, + 88039D3B17DD72BA00A298EF /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88039D2217DD72BA00A298EF /* Lucky */ = { + isa = PBXGroup; + children = ( + 88039D2B17DD72BA00A298EF /* AppDelegate.h */, + 88039D2C17DD72BA00A298EF /* AppDelegate.m */, + 88039D2E17DD72BA00A298EF /* Main.storyboard */, + 885BD41117DE95DA0069026B /* GameViewController.h */, + 885BD41217DE95DA0069026B /* GameViewController.m */, + 885BD41317DE95DA0069026B /* GameViewController.xib */, + 88039D3117DD72BA00A298EF /* ViewController.h */, + 88039D3217DD72BA00A298EF /* ViewController.m */, + 88039D3417DD72BA00A298EF /* Images.xcassets */, + 88039D2317DD72BA00A298EF /* Supporting Files */, + ); + name = Lucky; + path = "Recipe 17-1 Making Your App Game Center Aware"; + sourceTree = ""; + }; + 88039D2317DD72BA00A298EF /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88039D2417DD72BA00A298EF /* Lucky-Info.plist */, + 88039D2517DD72BA00A298EF /* InfoPlist.strings */, + 88039D2817DD72BA00A298EF /* main.m */, + 88039D2A17DD72BA00A298EF /* Lucky-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88039D4117DD72BA00A298EF /* Lucky Test */ = { + isa = PBXGroup; + children = ( + 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */, + 88039D4217DD72BA00A298EF /* Supporting Files */, + ); + name = "Lucky Test"; + path = "Recipe 17-1 Making Your App Game Center AwareTests"; + sourceTree = ""; + }; + 88039D4217DD72BA00A298EF /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88039D4317DD72BA00A298EF /* LuckyTests-Info.plist */, + 88039D4417DD72BA00A298EF /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88039D1817DD72BA00A298EF /* Lucky */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88039D4B17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "Lucky" */; + buildPhases = ( + 88039D1517DD72BA00A298EF /* Sources */, + 88039D1617DD72BA00A298EF /* Frameworks */, + 88039D1717DD72BA00A298EF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Lucky; + productName = "Recipe 17-1 Making Your App Game Center Aware"; + productReference = 88039D1917DD72BA00A298EF /* Lucky.app */; + productType = "com.apple.product-type.application"; + }; + 88039D3917DD72BA00A298EF /* LuckyTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88039D4E17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "LuckyTests" */; + buildPhases = ( + 88039D3617DD72BA00A298EF /* Sources */, + 88039D3717DD72BA00A298EF /* Frameworks */, + 88039D3817DD72BA00A298EF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88039D4017DD72BA00A298EF /* PBXTargetDependency */, + ); + name = LuckyTests; + productName = "Recipe 17-1 Making Your App Game Center AwareTests"; + productReference = 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88039D1117DD72BA00A298EF /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88039D1817DD72BA00A298EF = { + DevelopmentTeam = H7ALWBN8YV; + SystemCapabilities = { + com.apple.GameCenter = { + enabled = 1; + }; + }; + }; + 88039D3917DD72BA00A298EF = { + TestTargetID = 88039D1817DD72BA00A298EF; + }; + }; + }; + buildConfigurationList = 88039D1417DD72BA00A298EF /* Build configuration list for PBXProject "Lucky" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88039D1017DD72BA00A298EF; + productRefGroup = 88039D1A17DD72BA00A298EF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88039D1817DD72BA00A298EF /* Lucky */, + 88039D3917DD72BA00A298EF /* LuckyTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88039D1717DD72BA00A298EF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885BD41517DE95DA0069026B /* GameViewController.xib in Resources */, + 88039D3517DD72BA00A298EF /* Images.xcassets in Resources */, + 88039D2717DD72BA00A298EF /* InfoPlist.strings in Resources */, + 88039D3017DD72BA00A298EF /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3817DD72BA00A298EF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D4617DD72BA00A298EF /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88039D1517DD72BA00A298EF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885BD41417DE95DA0069026B /* GameViewController.m in Sources */, + 88039D3317DD72BA00A298EF /* ViewController.m in Sources */, + 88039D2D17DD72BA00A298EF /* AppDelegate.m in Sources */, + 88039D2917DD72BA00A298EF /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3617DD72BA00A298EF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D4817DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88039D4017DD72BA00A298EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88039D1817DD72BA00A298EF /* Lucky */; + targetProxy = 88039D3F17DD72BA00A298EF /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88039D2517DD72BA00A298EF /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88039D2617DD72BA00A298EF /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88039D2E17DD72BA00A298EF /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88039D2F17DD72BA00A298EF /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88039D4417DD72BA00A298EF /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88039D4517DD72BA00A298EF /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88039D4917DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88039D4A17DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88039D4C17DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist"; + PRODUCT_NAME = Lucky; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88039D4D17DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist"; + PRODUCT_NAME = Lucky; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88039D4F17DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 17-1 Making Your App Game Center Aware.app/Recipe 17-1 Making Your App Game Center Aware"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist"; + PRODUCT_NAME = LuckyTests; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88039D5017DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 17-1 Making Your App Game Center Aware.app/Recipe 17-1 Making Your App Game Center Aware"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist"; + PRODUCT_NAME = LuckyTests; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88039D1417DD72BA00A298EF /* Build configuration list for PBXProject "Lucky" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4917DD72BA00A298EF /* Debug */, + 88039D4A17DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88039D4B17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "Lucky" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4C17DD72BA00A298EF /* Debug */, + 88039D4D17DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88039D4E17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "LuckyTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4F17DD72BA00A298EF /* Debug */, + 88039D5017DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88039D1117DD72BA00A298EF /* Project object */; +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1116762 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2309e89 Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..512fdbf --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme new file mode 100644 index 0000000..0ad87be --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..35fae4e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 17-1 Making Your App Game Center Aware.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88039D1817DD72BA00A298EF + + primary + + + 88039D3917DD72BA00A298EF + + primary + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h new file mode 100644 index 0000000..27b527e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m new file mode 100644 index 0000000..ea99077 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard new file mode 100644 index 0000000..993bb9e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h new file mode 100644 index 0000000..fde2838 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h @@ -0,0 +1,30 @@ +// +// GameViewController.h +// Lucky +// +// Created by joseph hoffman on 9/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface GameViewController : UIViewController +{ +@private + int _score; + int _level; +} + + +@property (weak, nonatomic) IBOutlet UILabel *scoreLabel; +@property (weak, nonatomic) IBOutlet UIButton *button1; +@property (weak, nonatomic) IBOutlet UIButton *button2; +@property (weak, nonatomic) IBOutlet UIButton *button3; +@property (weak, nonatomic) IBOutlet UIButton *button4; + +- (IBAction)gameButtonSelected:(UIButton *)sender; + +- (id)initWithLevel:(int)level; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m new file mode 100644 index 0000000..7f4dd65 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m @@ -0,0 +1,206 @@ +// +// GameViewController.m +// Lucky +// +// Created by joseph hoffman on 9/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GameViewController.h" + +@interface GameViewController () + +@end + +@implementation GameViewController + +- (id)initWithLevel:(int)level +{ + self = [super initWithNibName:nil bundle:nil]; + if (self) + { + _level = level; + _score = 0; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + switch (_level) + { + case 0: + self.title = @"Easy Game"; + break; + case 1: + self.title = @"Normal Game"; + break; + case 2: + self.title = @"Hard Game"; + break; + + default: + break; + } + + [self updateScoreLabel]; + [self setupButtons]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +- (IBAction)gameButtonSelected:(UIButton *)sender +{ + if (sender.tag == 0) + { + // Safe, continue game + _score += 1; + [self updateScoreLabel]; + [self setupButtons]; + } + else + { + // Game Over + NSString *message = [NSString stringWithFormat:@"Your score was %i.", _score]; + UIAlertView *gameOverAlert = [[UIAlertView alloc] initWithTitle:@"Game Over" + message:message delegate:self cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [gameOverAlert show]; + } +} + +#pragma mark - helper methods +- (void)updateScoreLabel +{ + self.scoreLabel.text = [NSString stringWithFormat:@"Score: %i", _score]; +} + +- (void)setupButtons +{ + switch (_level) { + case 0: + [self setupButtonsForEasyGame]; + break; + case 1: + [self setupButtonsForNormalGame]; + break; + case 2: + [self setupButtonsForHardGame]; + break; + + default: + break; + } +} + +- (void)setupButtonsForEasyGame +{ + [self resetButtonTags]; + int killerButtonIndex = rand() % 4; + [self buttonForIndex:killerButtonIndex].tag = 1; +} + +- (void)setupButtonsForNormalGame +{ + [self resetButtonTags]; + int killerButtonIndex1 = rand() % 4; + int killerButtonIndex2; + do { + killerButtonIndex2 = rand() % 4; + } while (killerButtonIndex1 == killerButtonIndex2); + + [self buttonForIndex:killerButtonIndex1].tag = 1; + [self buttonForIndex:killerButtonIndex2].tag = 1; +} + +- (void)setupButtonsForHardGame +{ + int safeButtonIndex = rand() % 4; + for (int i=0; i < 4; i++) { + if (i == safeButtonIndex) { + [self buttonForIndex:i].tag = 0; + } + else + { + [self buttonForIndex:i].tag = 1; + } + } +} + + +- (void)resetButtonTags +{ + for (int i = 0; i < 4; i++) + { + UIButton *button = [self buttonForIndex:i]; + button.tag = 0; + } +} + +- (UIButton *)buttonForIndex:(int)index +{ + switch (index) + { + case 0: + return self.button1; + case 1: + return self.button2; + case 2: + return self.button3; + case 3: + return self.button4; + default: + return nil; + } +} + +- (void)reportScore:(int64_t)score forLeaderboard: (NSString*)leaderboardID +{ + GKScore *gameCenterScore = [[GKScore alloc] initWithLeaderboardIdentifier:leaderboardID]; + gameCenterScore.value = score; + gameCenterScore.context = 0; + + NSArray *scoresArray = [[NSArray alloc] initWithObjects:gameCenterScore, nil]; + + [GKScore reportScores:scoresArray withCompletionHandler:^(NSError *error) + { + if (error) + { + NSLog(@"Error reporting score: %@", error); + } + }]; +} + +- (NSString *)leaderboardID +{ + switch (_level) { + case 0: + return @"Lucky.easy"; + case 1: + return @"Lucky.normal"; + case 2: + return @"Lucky.hard"; + default: + return @""; + } +} +#pragma mark - delegate methods + +- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + [self.navigationController popViewControllerAnimated:YES]; + if ([GKLocalPlayer localPlayer].isAuthenticated) + { + [self reportScore:_score forLeaderboard:[self leaderboardID]]; + } +} + + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib new file mode 100644 index 0000000..7811f9f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist new file mode 100644 index 0000000..35e69b3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist @@ -0,0 +1,41 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + gamekit + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/ViewController.h b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/ViewController.h new file mode 100644 index 0000000..6e7fd34 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/ViewController.h @@ -0,0 +1,24 @@ +// +// ViewController.h +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "GameViewController.h" +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *welcomeLabel; +@property (strong, nonatomic) GKLocalPlayer *player; + +- (IBAction)playEasyGame:(id)sender; +- (IBAction)playNormalGame:(id)sender; +- (IBAction)playHardGame:(id)sender; + +- (IBAction)showGameCenter:(id)sender; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/ViewController.m b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/ViewController.m new file mode 100644 index 0000000..b4807b7 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/ViewController.m @@ -0,0 +1,112 @@ +// +// ViewController.m +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.player = nil; + [self authenticatePlayer]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +#pragma mark - custom setters + +- (void)setPlayer:(GKLocalPlayer *)player +{ + _player = player; + NSString *playerName; + if (_player) + { + playerName = _player.alias; + } + else + { + playerName = @"Anonymous Player"; + } + self.welcomeLabel.text = [NSString stringWithFormat:@"Welcome %@", playerName]; +} + +- (IBAction)playEasyGame:(id)sender +{ + [self playGameWithLevel:0]; +} + +- (IBAction)playNormalGame:(id)sender +{ + [self playGameWithLevel:1]; +} + +- (IBAction)playHardGame:(id)sender +{ + [self playGameWithLevel:2]; +} + +- (IBAction)showGameCenter:(id)sender +{ + GKGameCenterViewController *gameCenterController = + [[GKGameCenterViewController alloc] init]; + if (gameCenterController != nil) + { + gameCenterController.gameCenterDelegate = self; + [self presentViewController:gameCenterController animated:YES completion:nil]; + } +} +#pragma mark - helper methods + +- (void)playGameWithLevel:(int)level +{ + GameViewController *gameViewController = + [[GameViewController alloc] initWithLevel:level]; + [self.navigationController pushViewController:gameViewController animated:YES]; +} + +- (void)authenticatePlayer +{ + __weak GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; + localPlayer.authenticateHandler = + ^(UIViewController *authenticateViewController, NSError *error) + { + if (authenticateViewController != nil) + { + [self presentViewController:authenticateViewController animated:YES + completion:nil]; + } + else if (localPlayer.isAuthenticated) + { + self.player = localPlayer; + } + else + { + // Disable Game Center + self.player = nil; + } + }; +} + +#pragma mark - delegate methods + +- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/main.m b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/main.m new file mode 100644 index 0000000..252b578 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center Aware/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 17-1 Making Your App Game Center Aware +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m new file mode 100644 index 0000000..feef3a0 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m @@ -0,0 +1,34 @@ +// +// Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m +// Recipe 17-1 Making Your App Game Center AwareTests +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_17_1_Making_Your_App_Game_Center_AwareTests : XCTestCase + +@end + +@implementation Recipe_17_1_Making_Your_App_Game_Center_AwareTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-2 Implementing Leaderboards/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/.DS_Store b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/.DS_Store new file mode 100644 index 0000000..948079e Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/.DS_Store differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.pbxproj b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.pbxproj new file mode 100644 index 0000000..adacc56 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.pbxproj @@ -0,0 +1,501 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88039D1D17DD72BA00A298EF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1C17DD72BA00A298EF /* Foundation.framework */; }; + 88039D1F17DD72BA00A298EF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */; }; + 88039D2117DD72BA00A298EF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D2017DD72BA00A298EF /* UIKit.framework */; }; + 88039D2717DD72BA00A298EF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88039D2517DD72BA00A298EF /* InfoPlist.strings */; }; + 88039D2917DD72BA00A298EF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D2817DD72BA00A298EF /* main.m */; }; + 88039D2D17DD72BA00A298EF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D2C17DD72BA00A298EF /* AppDelegate.m */; }; + 88039D3017DD72BA00A298EF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88039D2E17DD72BA00A298EF /* Main.storyboard */; }; + 88039D3317DD72BA00A298EF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D3217DD72BA00A298EF /* ViewController.m */; }; + 88039D3517DD72BA00A298EF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88039D3417DD72BA00A298EF /* Images.xcassets */; }; + 88039D3C17DD72BA00A298EF /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D3B17DD72BA00A298EF /* XCTest.framework */; }; + 88039D3D17DD72BA00A298EF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D1C17DD72BA00A298EF /* Foundation.framework */; }; + 88039D3E17DD72BA00A298EF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88039D2017DD72BA00A298EF /* UIKit.framework */; }; + 88039D4617DD72BA00A298EF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88039D4417DD72BA00A298EF /* InfoPlist.strings */; }; + 88039D4817DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */; }; + 885BD41417DE95DA0069026B /* GameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885BD41217DE95DA0069026B /* GameViewController.m */; }; + 885BD41517DE95DA0069026B /* GameViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 885BD41317DE95DA0069026B /* GameViewController.xib */; }; + 88C51E9117DECF360081BB46 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88C51E9017DECF360081BB46 /* GameKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88039D3F17DD72BA00A298EF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88039D1117DD72BA00A298EF /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88039D1817DD72BA00A298EF; + remoteInfo = "Recipe 17-1 Making Your App Game Center Aware"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88039D1917DD72BA00A298EF /* Lucky.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Lucky.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 88039D1C17DD72BA00A298EF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88039D2017DD72BA00A298EF /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88039D2417DD72BA00A298EF /* Lucky-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Lucky-Info.plist"; sourceTree = ""; }; + 88039D2617DD72BA00A298EF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88039D2817DD72BA00A298EF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88039D2A17DD72BA00A298EF /* Lucky-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Lucky-Prefix.pch"; sourceTree = ""; }; + 88039D2B17DD72BA00A298EF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88039D2C17DD72BA00A298EF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88039D2F17DD72BA00A298EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88039D3117DD72BA00A298EF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88039D3217DD72BA00A298EF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88039D3417DD72BA00A298EF /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LuckyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 88039D3B17DD72BA00A298EF /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88039D4317DD72BA00A298EF /* LuckyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LuckyTests-Info.plist"; sourceTree = ""; }; + 88039D4517DD72BA00A298EF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m; sourceTree = ""; }; + 885BD41117DE95DA0069026B /* GameViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameViewController.h; sourceTree = ""; }; + 885BD41217DE95DA0069026B /* GameViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameViewController.m; sourceTree = ""; }; + 885BD41317DE95DA0069026B /* GameViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GameViewController.xib; sourceTree = ""; }; + 88C51E9017DECF360081BB46 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88039D1617DD72BA00A298EF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D1F17DD72BA00A298EF /* CoreGraphics.framework in Frameworks */, + 88039D2117DD72BA00A298EF /* UIKit.framework in Frameworks */, + 88039D1D17DD72BA00A298EF /* Foundation.framework in Frameworks */, + 88C51E9117DECF360081BB46 /* GameKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3717DD72BA00A298EF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D3C17DD72BA00A298EF /* XCTest.framework in Frameworks */, + 88039D3E17DD72BA00A298EF /* UIKit.framework in Frameworks */, + 88039D3D17DD72BA00A298EF /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88039D1017DD72BA00A298EF = { + isa = PBXGroup; + children = ( + 88039D2217DD72BA00A298EF /* Lucky */, + 88039D4117DD72BA00A298EF /* Lucky Test */, + 88039D1B17DD72BA00A298EF /* Frameworks */, + 88039D1A17DD72BA00A298EF /* Products */, + ); + sourceTree = ""; + }; + 88039D1A17DD72BA00A298EF /* Products */ = { + isa = PBXGroup; + children = ( + 88039D1917DD72BA00A298EF /* Lucky.app */, + 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88039D1B17DD72BA00A298EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88C51E9017DECF360081BB46 /* GameKit.framework */, + 88039D1C17DD72BA00A298EF /* Foundation.framework */, + 88039D1E17DD72BA00A298EF /* CoreGraphics.framework */, + 88039D2017DD72BA00A298EF /* UIKit.framework */, + 88039D3B17DD72BA00A298EF /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88039D2217DD72BA00A298EF /* Lucky */ = { + isa = PBXGroup; + children = ( + 88039D2B17DD72BA00A298EF /* AppDelegate.h */, + 88039D2C17DD72BA00A298EF /* AppDelegate.m */, + 88039D2E17DD72BA00A298EF /* Main.storyboard */, + 885BD41117DE95DA0069026B /* GameViewController.h */, + 885BD41217DE95DA0069026B /* GameViewController.m */, + 885BD41317DE95DA0069026B /* GameViewController.xib */, + 88039D3117DD72BA00A298EF /* ViewController.h */, + 88039D3217DD72BA00A298EF /* ViewController.m */, + 88039D3417DD72BA00A298EF /* Images.xcassets */, + 88039D2317DD72BA00A298EF /* Supporting Files */, + ); + name = Lucky; + path = "Recipe 17-1 Making Your App Game Center Aware"; + sourceTree = ""; + }; + 88039D2317DD72BA00A298EF /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88039D2417DD72BA00A298EF /* Lucky-Info.plist */, + 88039D2517DD72BA00A298EF /* InfoPlist.strings */, + 88039D2817DD72BA00A298EF /* main.m */, + 88039D2A17DD72BA00A298EF /* Lucky-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88039D4117DD72BA00A298EF /* Lucky Test */ = { + isa = PBXGroup; + children = ( + 88039D4717DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m */, + 88039D4217DD72BA00A298EF /* Supporting Files */, + ); + name = "Lucky Test"; + path = "Recipe 17-1 Making Your App Game Center AwareTests"; + sourceTree = ""; + }; + 88039D4217DD72BA00A298EF /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88039D4317DD72BA00A298EF /* LuckyTests-Info.plist */, + 88039D4417DD72BA00A298EF /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88039D1817DD72BA00A298EF /* Lucky */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88039D4B17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "Lucky" */; + buildPhases = ( + 88039D1517DD72BA00A298EF /* Sources */, + 88039D1617DD72BA00A298EF /* Frameworks */, + 88039D1717DD72BA00A298EF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Lucky; + productName = "Recipe 17-1 Making Your App Game Center Aware"; + productReference = 88039D1917DD72BA00A298EF /* Lucky.app */; + productType = "com.apple.product-type.application"; + }; + 88039D3917DD72BA00A298EF /* LuckyTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88039D4E17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "LuckyTests" */; + buildPhases = ( + 88039D3617DD72BA00A298EF /* Sources */, + 88039D3717DD72BA00A298EF /* Frameworks */, + 88039D3817DD72BA00A298EF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88039D4017DD72BA00A298EF /* PBXTargetDependency */, + ); + name = LuckyTests; + productName = "Recipe 17-1 Making Your App Game Center AwareTests"; + productReference = 88039D3A17DD72BA00A298EF /* LuckyTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88039D1117DD72BA00A298EF /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88039D1817DD72BA00A298EF = { + DevelopmentTeam = H7ALWBN8YV; + SystemCapabilities = { + com.apple.GameCenter = { + enabled = 1; + }; + }; + }; + 88039D3917DD72BA00A298EF = { + TestTargetID = 88039D1817DD72BA00A298EF; + }; + }; + }; + buildConfigurationList = 88039D1417DD72BA00A298EF /* Build configuration list for PBXProject "Lucky" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88039D1017DD72BA00A298EF; + productRefGroup = 88039D1A17DD72BA00A298EF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88039D1817DD72BA00A298EF /* Lucky */, + 88039D3917DD72BA00A298EF /* LuckyTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88039D1717DD72BA00A298EF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885BD41517DE95DA0069026B /* GameViewController.xib in Resources */, + 88039D3517DD72BA00A298EF /* Images.xcassets in Resources */, + 88039D2717DD72BA00A298EF /* InfoPlist.strings in Resources */, + 88039D3017DD72BA00A298EF /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3817DD72BA00A298EF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D4617DD72BA00A298EF /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88039D1517DD72BA00A298EF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885BD41417DE95DA0069026B /* GameViewController.m in Sources */, + 88039D3317DD72BA00A298EF /* ViewController.m in Sources */, + 88039D2D17DD72BA00A298EF /* AppDelegate.m in Sources */, + 88039D2917DD72BA00A298EF /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88039D3617DD72BA00A298EF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88039D4817DD72BA00A298EF /* Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88039D4017DD72BA00A298EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88039D1817DD72BA00A298EF /* Lucky */; + targetProxy = 88039D3F17DD72BA00A298EF /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88039D2517DD72BA00A298EF /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88039D2617DD72BA00A298EF /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88039D2E17DD72BA00A298EF /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88039D2F17DD72BA00A298EF /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88039D4417DD72BA00A298EF /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88039D4517DD72BA00A298EF /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88039D4917DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88039D4A17DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88039D4C17DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist"; + PRODUCT_NAME = Lucky; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88039D4D17DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist"; + PRODUCT_NAME = Lucky; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88039D4F17DD72BA00A298EF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 17-1 Making Your App Game Center Aware.app/Recipe 17-1 Making Your App Game Center Aware"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist"; + PRODUCT_NAME = LuckyTests; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88039D5017DD72BA00A298EF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 17-1 Making Your App Game Center Aware.app/Recipe 17-1 Making Your App Game Center Aware"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 17-1 Making Your App Game Center Aware/Recipe 17-1 Making Your App Game Center Aware-Prefix.pch"; + INFOPLIST_FILE = "Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist"; + PRODUCT_NAME = LuckyTests; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88039D1417DD72BA00A298EF /* Build configuration list for PBXProject "Lucky" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4917DD72BA00A298EF /* Debug */, + 88039D4A17DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88039D4B17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "Lucky" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4C17DD72BA00A298EF /* Debug */, + 88039D4D17DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88039D4E17DD72BA00A298EF /* Build configuration list for PBXNativeTarget "LuckyTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88039D4F17DD72BA00A298EF /* Debug */, + 88039D5017DD72BA00A298EF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88039D1117DD72BA00A298EF /* Project object */; +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1116762 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..6668ae0 Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..40052af --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme new file mode 100644 index 0000000..0ad87be --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 17-1 Making Your App Game Center Aware.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..35fae4e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Lucky.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 17-1 Making Your App Game Center Aware.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88039D1817DD72BA00A298EF + + primary + + + 88039D3917DD72BA00A298EF + + primary + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h new file mode 100644 index 0000000..27b527e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m new file mode 100644 index 0000000..ea99077 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard new file mode 100644 index 0000000..993bb9e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Base.lproj/Main.storyboard @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h new file mode 100644 index 0000000..46ba4a0 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.h @@ -0,0 +1,32 @@ +// +// GameViewController.h +// Lucky +// +// Created by joseph hoffman on 9/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface GameViewController : UIViewController +{ +@private + int _score; + int _level; + NSMutableArray *_selectedButtons; +} + + +@property (weak, nonatomic) IBOutlet UILabel *scoreLabel; +@property (weak, nonatomic) IBOutlet UIButton *button1; +@property (weak, nonatomic) IBOutlet UIButton *button2; +@property (weak, nonatomic) IBOutlet UIButton *button3; +@property (weak, nonatomic) IBOutlet UIButton *button4; +@property (strong, nonatomic) NSMutableDictionary *achievements; + +- (IBAction)gameButtonSelected:(UIButton *)sender; + +- (id)initWithLevel:(int)level achievements:(NSMutableDictionary *)achievements;; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m new file mode 100644 index 0000000..8e5d68c --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.m @@ -0,0 +1,269 @@ +// +// GameViewController.m +// Lucky +// +// Created by joseph hoffman on 9/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "GameViewController.h" + +@interface GameViewController () + +@end + +@implementation GameViewController + +- (id)initWithLevel:(int)level achievements:(NSMutableDictionary *)achievements +{ + self = [super initWithNibName:nil bundle:nil]; + if (self) + { + _level = level; + _score = 0; + _selectedButtons = [[NSMutableArray alloc] initWithCapacity:4]; + self.achievements = achievements; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + switch (_level) + { + case 0: + self.title = @"Easy Game"; + break; + case 1: + self.title = @"Normal Game"; + break; + case 2: + self.title = @"Hard Game"; + break; + + default: + break; + } + + [self updateScoreLabel]; + [self setupButtons]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +- (IBAction)gameButtonSelected:(UIButton *)sender +{ + if (sender.tag == 0) + { + // Safe, continue game + _score += 1; + [self updateScoreLabel]; + [self setupButtons]; + if (![_selectedButtons containsObject:sender]) + { + [_selectedButtons addObject:sender]; + if (_selectedButtons.count == 4) + { + [self reportAllFourButtonsAchievementCompleted]; + } + } + } + else + { + // Game Over + NSString *message = [NSString stringWithFormat:@"Your score was %i.", _score]; + UIAlertView *gameOverAlert = [[UIAlertView alloc] initWithTitle:@"Game Over" + message:message delegate:self cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [gameOverAlert show]; + } +} + +#pragma mark - helper methods +- (void)updateScoreLabel +{ + self.scoreLabel.text = [NSString stringWithFormat:@"Score: %i", _score]; +} + +- (void)setupButtons +{ + switch (_level) { + case 0: + [self setupButtonsForEasyGame]; + break; + case 1: + [self setupButtonsForNormalGame]; + break; + case 2: + [self setupButtonsForHardGame]; + break; + + default: + break; + } +} + +- (void)setupButtonsForEasyGame +{ + [self resetButtonTags]; + int killerButtonIndex = rand() % 4; + [self buttonForIndex:killerButtonIndex].tag = 1; +} + +- (void)setupButtonsForNormalGame +{ + [self resetButtonTags]; + int killerButtonIndex1 = rand() % 4; + int killerButtonIndex2; + do { + killerButtonIndex2 = rand() % 4; + } while (killerButtonIndex1 == killerButtonIndex2); + + [self buttonForIndex:killerButtonIndex1].tag = 1; + [self buttonForIndex:killerButtonIndex2].tag = 1; +} + +- (void)setupButtonsForHardGame +{ + int safeButtonIndex = rand() % 4; + for (int i=0; i < 4; i++) { + if (i == safeButtonIndex) { + [self buttonForIndex:i].tag = 0; + } + else + { + [self buttonForIndex:i].tag = 1; + } + } +} + + +- (void)resetButtonTags +{ + for (int i = 0; i < 4; i++) + { + UIButton *button = [self buttonForIndex:i]; + button.tag = 0; + } +} + +- (UIButton *)buttonForIndex:(int)index +{ + switch (index) + { + case 0: + return self.button1; + case 1: + return self.button2; + case 2: + return self.button3; + case 3: + return self.button4; + default: + return nil; + } +} + +- (void)reportScore:(int64_t)score forLeaderboard: (NSString*)leaderboardID +{ + GKScore *gameCenterScore = [[GKScore alloc] initWithLeaderboardIdentifier:leaderboardID]; + gameCenterScore.value = score; + gameCenterScore.context = 0; + + + NSArray *scoresArray = [[NSArray alloc] initWithObjects:gameCenterScore, nil]; + + [GKScore reportScores:scoresArray withCompletionHandler:^(NSError *error) + { + if (error) + { + NSLog(@"Error reporting score: %@", error); + } + }]; +} + +- (NSString *)leaderboardID +{ + switch (_level) { + case 0: + return @"Lucky.easy"; + case 1: + return @"Lucky.normal"; + case 2: + return @"Lucky.hard"; + default: + return @""; + } +} + +- (void)reportAllFourButtonsAchievementCompleted +{ + + GKAchievement *achievement = [self getAchievement]; + if (achievement != nil && !achievement.completed) + { + achievement.percentComplete = 100; + achievement.showsCompletionBanner = NO; + NSArray *achievementArray = [[NSArray alloc] initWithObjects:achievement, nil]; + + [GKAchievement reportAchievements:achievementArray withCompletionHandler:^(NSError *error) + { + if (error != nil) + { + NSLog(@"Error when reporting achievement: %@", error); + } + else + { + [GKNotificationBanner showBannerWithTitle:@"Achievement Completed" + message:@"You have used all four buttons and earned 100 points!" + completionHandler:nil]; + } + }]; + } +} + +- (NSString *)achievementID +{ + switch (_level) { + case 0: + return @"AllFourButtons.easy"; + case 1: + return @"AllFourButtons.normal"; + case 2: + return @"AllFourButtons.hard"; + default: + return @""; + } +} + +- (GKAchievement *)getAchievement +{ + NSString *achievementID = [self achievementID]; + GKAchievement *achievement = [self.achievements objectForKey:achievementID]; + if (achievement == nil) + { + achievement = [[GKAchievement alloc] initWithIdentifier:achievementID]; + [self.achievements setObject:achievement forKey:achievement.identifier]; + } + return achievement; +} +#pragma mark - delegate methods + +- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + [self.navigationController popViewControllerAnimated:YES]; + if ([GKLocalPlayer localPlayer].isAuthenticated) + { + [self reportScore:_score forLeaderboard:[self leaderboardID]]; + } +} + + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib new file mode 100644 index 0000000..7811f9f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/GameViewController.xib @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist new file mode 100644 index 0000000..35e69b3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Lucky-Info.plist @@ -0,0 +1,41 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + gamekit + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/Lucky-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/ViewController.h b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/ViewController.h new file mode 100644 index 0000000..06f8ce3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/ViewController.h @@ -0,0 +1,25 @@ +// +// ViewController.h +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "GameViewController.h" +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *welcomeLabel; +@property (strong, nonatomic) GKLocalPlayer *player; +@property (strong, nonatomic) NSMutableDictionary *achievements; + +- (IBAction)playEasyGame:(id)sender; +- (IBAction)playNormalGame:(id)sender; +- (IBAction)playHardGame:(id)sender; + +- (IBAction)showGameCenter:(id)sender; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/ViewController.m b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/ViewController.m new file mode 100644 index 0000000..bceba47 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/ViewController.m @@ -0,0 +1,137 @@ +// +// ViewController.m +// Lucky +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.achievements = [[NSMutableDictionary alloc] init]; + self.player = nil; + [self authenticatePlayer]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +#pragma mark - custom setters + +- (void)setPlayer:(GKLocalPlayer *)player +{ + if (_player == player) + return; + + [self.achievements removeAllObjects]; + + _player = player; + NSString *playerName; + if (_player) + { + playerName = _player.alias; + [self loadAchievements]; + } + else + { + playerName = @"Anonymous Player"; + } + self.welcomeLabel.text = [NSString stringWithFormat:@"Welcome %@", playerName]; +} + +- (IBAction)playEasyGame:(id)sender +{ + [self playGameWithLevel:0]; +} + +- (IBAction)playNormalGame:(id)sender +{ + [self playGameWithLevel:1]; +} + +- (IBAction)playHardGame:(id)sender +{ + [self playGameWithLevel:2]; +} + +- (IBAction)showGameCenter:(id)sender +{ + GKGameCenterViewController *gameCenterController = + [[GKGameCenterViewController alloc] init]; + if (gameCenterController != nil) + { + gameCenterController.gameCenterDelegate = self; + [self presentViewController:gameCenterController animated:YES completion:nil]; + } +} +#pragma mark - helper methods + +- (void)playGameWithLevel:(int)level +{ + GameViewController *gameViewController = + [[GameViewController alloc] initWithLevel:level achievements:self.achievements]; + [self.navigationController pushViewController:gameViewController animated:YES]; +} + +- (void)authenticatePlayer +{ + __weak GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; + localPlayer.authenticateHandler = + ^(UIViewController *authenticateViewController, NSError *error) + { + if (authenticateViewController != nil) + { + [self presentViewController:authenticateViewController animated:YES + completion:nil]; + } + else if (localPlayer.isAuthenticated) + { + self.player = localPlayer; + } + else + { + // Disable Game Center + self.player = nil; + } + }; +} + +- (void)loadAchievements +{ + [GKAchievement loadAchievementsWithCompletionHandler: + ^(NSArray *achievements, NSError *error) + { + if (error == nil) + { + for (GKAchievement* achievement in achievements) + [self.achievements setObject: achievement + forKey: achievement.identifier]; + } + else + { + NSLog(@"Error loading achievements: %@", error); + } + }]; +} + +#pragma mark - delegate methods + +- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/main.m b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/main.m new file mode 100644 index 0000000..252b578 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center Aware/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 17-1 Making Your App Game Center Aware +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/LuckyTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m new file mode 100644 index 0000000..feef3a0 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m @@ -0,0 +1,34 @@ +// +// Recipe_17_1_Making_Your_App_Game_Center_AwareTests.m +// Recipe 17-1 Making Your App Game Center AwareTests +// +// Created by joseph hoffman on 9/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_17_1_Making_Your_App_Game_Center_AwareTests : XCTestCase + +@end + +@implementation Recipe_17_1_Making_Your_App_Game_Center_AwareTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-3 Implementing Achievements/Recipe 17-1 Making Your App Game Center AwareTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/.DS_Store b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/.DS_Store new file mode 100644 index 0000000..1a33cee Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/.DS_Store differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.pbxproj b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0f6c312 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.pbxproj @@ -0,0 +1,495 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 881925C817E0042E00308772 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881925C717E0042E00308772 /* Foundation.framework */; }; + 881925CA17E0042E00308772 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881925C917E0042E00308772 /* CoreGraphics.framework */; }; + 881925CC17E0042E00308772 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881925CB17E0042E00308772 /* UIKit.framework */; }; + 881925D217E0042E00308772 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881925D017E0042E00308772 /* InfoPlist.strings */; }; + 881925D417E0042E00308772 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 881925D317E0042E00308772 /* main.m */; }; + 881925D817E0042E00308772 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 881925D717E0042E00308772 /* AppDelegate.m */; }; + 881925DB17E0042E00308772 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881925D917E0042E00308772 /* Main.storyboard */; }; + 881925DE17E0042E00308772 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881925DD17E0042E00308772 /* ViewController.m */; }; + 881925E017E0042E00308772 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 881925DF17E0042E00308772 /* Images.xcassets */; }; + 881925E717E0042E00308772 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881925E617E0042E00308772 /* XCTest.framework */; }; + 881925E817E0042E00308772 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881925C717E0042E00308772 /* Foundation.framework */; }; + 881925E917E0042E00308772 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881925CB17E0042E00308772 /* UIKit.framework */; }; + 881925F117E0042E00308772 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881925EF17E0042E00308772 /* InfoPlist.strings */; }; + 881925F317E0042E00308772 /* Tic_Tac_ToeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 881925F217E0042E00308772 /* Tic_Tac_ToeTests.m */; }; + 881925FD17E00A4A00308772 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881925FC17E00A4A00308772 /* GameKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 881925EA17E0042E00308772 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 881925BC17E0042E00308772 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 881925C317E0042E00308772; + remoteInfo = "Tic Tac Toe"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 881925C417E0042E00308772 /* Tic Tac Toe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tic Tac Toe.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881925C717E0042E00308772 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 881925C917E0042E00308772 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 881925CB17E0042E00308772 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 881925CF17E0042E00308772 /* Tic Tac Toe-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tic Tac Toe-Info.plist"; sourceTree = ""; }; + 881925D117E0042E00308772 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881925D317E0042E00308772 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 881925D517E0042E00308772 /* Tic Tac Toe-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tic Tac Toe-Prefix.pch"; sourceTree = ""; }; + 881925D617E0042E00308772 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 881925D717E0042E00308772 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 881925DA17E0042E00308772 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 881925DC17E0042E00308772 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 881925DD17E0042E00308772 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 881925DF17E0042E00308772 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 881925E517E0042E00308772 /* Tic Tac ToeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tic Tac ToeTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881925E617E0042E00308772 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 881925EE17E0042E00308772 /* Tic Tac ToeTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tic Tac ToeTests-Info.plist"; sourceTree = ""; }; + 881925F017E0042E00308772 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881925F217E0042E00308772 /* Tic_Tac_ToeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tic_Tac_ToeTests.m; sourceTree = ""; }; + 881925FC17E00A4A00308772 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 881925C117E0042E00308772 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881925CA17E0042E00308772 /* CoreGraphics.framework in Frameworks */, + 881925CC17E0042E00308772 /* UIKit.framework in Frameworks */, + 881925C817E0042E00308772 /* Foundation.framework in Frameworks */, + 881925FD17E00A4A00308772 /* GameKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881925E217E0042E00308772 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881925E717E0042E00308772 /* XCTest.framework in Frameworks */, + 881925E917E0042E00308772 /* UIKit.framework in Frameworks */, + 881925E817E0042E00308772 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 881925BB17E0042E00308772 = { + isa = PBXGroup; + children = ( + 881925CD17E0042E00308772 /* Tic Tac Toe */, + 881925EC17E0042E00308772 /* Tic Tac ToeTests */, + 881925C617E0042E00308772 /* Frameworks */, + 881925C517E0042E00308772 /* Products */, + ); + sourceTree = ""; + }; + 881925C517E0042E00308772 /* Products */ = { + isa = PBXGroup; + children = ( + 881925C417E0042E00308772 /* Tic Tac Toe.app */, + 881925E517E0042E00308772 /* Tic Tac ToeTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 881925C617E0042E00308772 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 881925FC17E00A4A00308772 /* GameKit.framework */, + 881925C717E0042E00308772 /* Foundation.framework */, + 881925C917E0042E00308772 /* CoreGraphics.framework */, + 881925CB17E0042E00308772 /* UIKit.framework */, + 881925E617E0042E00308772 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 881925CD17E0042E00308772 /* Tic Tac Toe */ = { + isa = PBXGroup; + children = ( + 881925D617E0042E00308772 /* AppDelegate.h */, + 881925D717E0042E00308772 /* AppDelegate.m */, + 881925D917E0042E00308772 /* Main.storyboard */, + 881925DC17E0042E00308772 /* ViewController.h */, + 881925DD17E0042E00308772 /* ViewController.m */, + 881925DF17E0042E00308772 /* Images.xcassets */, + 881925CE17E0042E00308772 /* Supporting Files */, + ); + path = "Tic Tac Toe"; + sourceTree = ""; + }; + 881925CE17E0042E00308772 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881925CF17E0042E00308772 /* Tic Tac Toe-Info.plist */, + 881925D017E0042E00308772 /* InfoPlist.strings */, + 881925D317E0042E00308772 /* main.m */, + 881925D517E0042E00308772 /* Tic Tac Toe-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 881925EC17E0042E00308772 /* Tic Tac ToeTests */ = { + isa = PBXGroup; + children = ( + 881925F217E0042E00308772 /* Tic_Tac_ToeTests.m */, + 881925ED17E0042E00308772 /* Supporting Files */, + ); + path = "Tic Tac ToeTests"; + sourceTree = ""; + }; + 881925ED17E0042E00308772 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881925EE17E0042E00308772 /* Tic Tac ToeTests-Info.plist */, + 881925EF17E0042E00308772 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 881925C317E0042E00308772 /* Tic Tac Toe */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881925F617E0042E00308772 /* Build configuration list for PBXNativeTarget "Tic Tac Toe" */; + buildPhases = ( + 881925C017E0042E00308772 /* Sources */, + 881925C117E0042E00308772 /* Frameworks */, + 881925C217E0042E00308772 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Tic Tac Toe"; + productName = "Tic Tac Toe"; + productReference = 881925C417E0042E00308772 /* Tic Tac Toe.app */; + productType = "com.apple.product-type.application"; + }; + 881925E417E0042E00308772 /* Tic Tac ToeTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881925F917E0042E00308772 /* Build configuration list for PBXNativeTarget "Tic Tac ToeTests" */; + buildPhases = ( + 881925E117E0042E00308772 /* Sources */, + 881925E217E0042E00308772 /* Frameworks */, + 881925E317E0042E00308772 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 881925EB17E0042E00308772 /* PBXTargetDependency */, + ); + name = "Tic Tac ToeTests"; + productName = "Tic Tac ToeTests"; + productReference = 881925E517E0042E00308772 /* Tic Tac ToeTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 881925BC17E0042E00308772 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 881925C317E0042E00308772 = { + DevelopmentTeam = H7ALWBN8YV; + SystemCapabilities = { + com.apple.GameCenter = { + enabled = 1; + }; + }; + }; + 881925E417E0042E00308772 = { + TestTargetID = 881925C317E0042E00308772; + }; + }; + }; + buildConfigurationList = 881925BF17E0042E00308772 /* Build configuration list for PBXProject "Tic Tac Toe" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 881925BB17E0042E00308772; + productRefGroup = 881925C517E0042E00308772 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 881925C317E0042E00308772 /* Tic Tac Toe */, + 881925E417E0042E00308772 /* Tic Tac ToeTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 881925C217E0042E00308772 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881925E017E0042E00308772 /* Images.xcassets in Resources */, + 881925D217E0042E00308772 /* InfoPlist.strings in Resources */, + 881925DB17E0042E00308772 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881925E317E0042E00308772 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881925F117E0042E00308772 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 881925C017E0042E00308772 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881925DE17E0042E00308772 /* ViewController.m in Sources */, + 881925D817E0042E00308772 /* AppDelegate.m in Sources */, + 881925D417E0042E00308772 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881925E117E0042E00308772 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881925F317E0042E00308772 /* Tic_Tac_ToeTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 881925EB17E0042E00308772 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 881925C317E0042E00308772 /* Tic Tac Toe */; + targetProxy = 881925EA17E0042E00308772 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 881925D017E0042E00308772 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881925D117E0042E00308772 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 881925D917E0042E00308772 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 881925DA17E0042E00308772 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 881925EF17E0042E00308772 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881925F017E0042E00308772 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 881925F417E0042E00308772 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 881925F517E0042E00308772 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 881925F717E0042E00308772 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic Tac Toe/Tic Tac Toe-Prefix.pch"; + INFOPLIST_FILE = "Tic Tac Toe/Tic Tac Toe-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 881925F817E0042E00308772 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic Tac Toe/Tic Tac Toe-Prefix.pch"; + INFOPLIST_FILE = "Tic Tac Toe/Tic Tac Toe-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 881925FA17E0042E00308772 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Tic Tac Toe.app/Tic Tac Toe"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic Tac Toe/Tic Tac Toe-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Tic Tac ToeTests/Tic Tac ToeTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 881925FB17E0042E00308772 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Tic Tac Toe.app/Tic Tac Toe"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic Tac Toe/Tic Tac Toe-Prefix.pch"; + INFOPLIST_FILE = "Tic Tac ToeTests/Tic Tac ToeTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 881925BF17E0042E00308772 /* Build configuration list for PBXProject "Tic Tac Toe" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881925F417E0042E00308772 /* Debug */, + 881925F517E0042E00308772 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881925F617E0042E00308772 /* Build configuration list for PBXNativeTarget "Tic Tac Toe" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881925F717E0042E00308772 /* Debug */, + 881925F817E0042E00308772 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881925F917E0042E00308772 /* Build configuration list for PBXNativeTarget "Tic Tac ToeTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881925FA17E0042E00308772 /* Debug */, + 881925FB17E0042E00308772 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 881925BC17E0042E00308772 /* Project object */; +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a9afae6 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..10bade1 Binary files /dev/null and b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..0d2fa15 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Tic Tac Toe.xcscheme b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Tic Tac Toe.xcscheme new file mode 100644 index 0000000..2901c21 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Tic Tac Toe.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..bb54a61 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Tic Tac Toe.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 881925C317E0042E00308772 + + primary + + + 881925E417E0042E00308772 + + primary + + + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/AppDelegate.h b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/AppDelegate.h new file mode 100644 index 0000000..320df1e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Tic Tac Toe +// +// Created by joseph hoffman on 9/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/AppDelegate.m b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/AppDelegate.m new file mode 100644 index 0000000..13df006 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Tic Tac Toe +// +// Created by joseph hoffman on 9/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Base.lproj/Main.storyboard b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Base.lproj/Main.storyboard new file mode 100644 index 0000000..be0c3af --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Base.lproj/Main.storyboard @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Images.xcassets/AppIcon.appiconset/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Tic Tac Toe-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Tic Tac Toe-Info.plist new file mode 100644 index 0000000..35e69b3 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Tic Tac Toe-Info.plist @@ -0,0 +1,41 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + gamekit + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Tic Tac Toe-Prefix.pch b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Tic Tac Toe-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/Tic Tac Toe-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/ViewController.h b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/ViewController.h new file mode 100644 index 0000000..795db26 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/ViewController.h @@ -0,0 +1,39 @@ +// +// ViewController.h +// Tic Tac Toe +// +// Created by joseph hoffman on 9/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + + +} + +@property (weak, nonatomic) IBOutlet UILabel *statusLabel; +@property (weak, nonatomic) IBOutlet UIButton *row1Col1Button; +@property (weak, nonatomic) IBOutlet UIButton *row1Col2Button; +@property (weak, nonatomic) IBOutlet UIButton *row1Col3Button; +@property (weak, nonatomic) IBOutlet UIButton *row2Col1Button; +@property (weak, nonatomic) IBOutlet UIButton *row2Col2Button; +@property (weak, nonatomic) IBOutlet UIButton *row2Col3Button; +@property (weak, nonatomic) IBOutlet UIButton *row3Col1Button; +@property (weak, nonatomic) IBOutlet UIButton *row3Col2Button; +@property (weak, nonatomic) IBOutlet UIButton *row3Col3Button; +@property (weak, nonatomic) IBOutlet UILabel *player1Label; +@property (weak, nonatomic) IBOutlet UILabel *player2Label; + +@property (strong, nonatomic) GKLocalPlayer *localPlayer; +@property (strong, nonatomic) GKTurnBasedMatch *match; +@property (strong, nonatomic) GKPlayer *player1; +@property (strong, nonatomic) GKPlayer *player2; + +- (IBAction)selectButton:(id)sender; +- (IBAction)playGame:(id)sender; + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/ViewController.m b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/ViewController.m new file mode 100644 index 0000000..7f32037 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/ViewController.m @@ -0,0 +1,581 @@ +// +// ViewController.m +// Tic Tac Toe +// +// Created by joseph hoffman on 9/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + [self enableSquareButtons:NO]; + + self.statusLabel.text = @"Press Play to start a game"; + + self.player1 = nil; + self.player2 = nil; + + [self authenticateLocalPlayer]; + [[GKLocalPlayer localPlayer] registerListener:self]; +} + +#pragma mark - custom setter methods + +- (void)setMatch:(GKTurnBasedMatch *)match +{ + _match = match; + + [self loadPlayers]; + [self loadMatchData]; +} + +- (void)setPlayer1:(GKPlayer *)player1 +{ + _player1 = player1; + if (_player1) + { + self.player1Label.text = _player1.displayName; + } + else + { + self.player1Label.text = @""; + } +} + +- (void)setPlayer2:(GKPlayer *)player2 +{ + _player2 = player2; + if (_player2) + { + self.player2Label.text = _player2.displayName; + } + else + { + self.player2Label.text = @""; + } +} + +/* + +- (void)setLocalPlayer:(GKLocalPlayer *)localPlayer +{ + _localPlayer = localPlayer; + if (_localPlayer) + { + //[GKTurnBasedEventHandler sharedTurnBasedEventHandler].delegate = self; + [[GKLocalPlayer localPlayer] registerListener:self]; + } + else + { + //[GKTurnBasedEventHandler sharedTurnBasedEventHandler].delegate = nil; + [[GKLocalPlayer localPlayer] registerListener:nil]; + } +} + +*/ + +#pragma mark - game logic + +- (IBAction)playGame:(id)sender +{ + if (self.localPlayer.isAuthenticated) + { + GKMatchRequest *request = [[GKMatchRequest alloc] init]; + request.minPlayers = 2; + request.maxPlayers = 2; + + GKTurnBasedMatchmakerViewController *matchMakerViewController = + [[GKTurnBasedMatchmakerViewController alloc] initWithMatchRequest:request]; + matchMakerViewController.turnBasedMatchmakerDelegate = self; + [self presentViewController:matchMakerViewController animated:YES + completion:nil]; + } + else + { + UIAlertView *notLoggedInAlert = [[UIAlertView alloc] initWithTitle:@"Error" + message:@"You must be logged into Game Center to play this game!" + delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; + [notLoggedInAlert show]; + } +} + +- (void)loadPlayers +{ + GKTurnBasedParticipant *participant1 = [self.match.participants objectAtIndex:0]; + GKTurnBasedParticipant *participant2 = [self.match.participants objectAtIndex:1]; + + NSMutableArray *playerIDs = [[NSMutableArray alloc] initWithCapacity:2]; + if (participant1.playerID && + ![participant1.playerID isEqualToString:self.player1.playerID]) + { + [playerIDs addObject:participant1.playerID]; + } + if (participant2.playerID && + ![participant2.playerID isEqualToString:self.player2.playerID]) + { + [playerIDs addObject:participant2.playerID]; + } + + if (playerIDs.count == 0) + return; // No players to load + + [GKPlayer loadPlayersForIdentifiers:playerIDs withCompletionHandler: + ^(NSArray *players, NSError *error) + { + if (players) + { + GKPlayer *player1; + GKPlayer *player2; + for (GKPlayer *player in players) + { + if ([player.playerID isEqualToString:participant1.playerID]) + { + player1 = player; + } + else if ([player.playerID isEqualToString:participant2.playerID]) + { + player2 = player; + } + } + dispatch_async(dispatch_get_main_queue(),^{ + self.player1 = player1; + self.player2 = player2; + }); + } + if (error) + { + NSLog(@"Error loading players: %@", error); + } + + }]; + +} + +- (void)resetButtonTitles +{ + [self.row1Col1Button setTitle:@"" forState:UIControlStateNormal]; + [self.row1Col2Button setTitle:@"" forState:UIControlStateNormal]; + [self.row1Col3Button setTitle:@"" forState:UIControlStateNormal]; + [self.row2Col1Button setTitle:@"" forState:UIControlStateNormal]; + [self.row2Col2Button setTitle:@"" forState:UIControlStateNormal]; + [self.row2Col3Button setTitle:@"" forState:UIControlStateNormal]; + [self.row3Col1Button setTitle:@"" forState:UIControlStateNormal]; + [self.row3Col2Button setTitle:@"" forState:UIControlStateNormal]; + [self.row3Col3Button setTitle:@"" forState:UIControlStateNormal]; +} + +- (void)enableSquareButtons:(BOOL)enable +{ + self.row1Col1Button.enabled = enable; + self.row1Col2Button.enabled = enable; + self.row1Col3Button.enabled = enable; + self.row2Col1Button.enabled = enable; + self.row2Col2Button.enabled = enable; + self.row2Col3Button.enabled = enable; + self.row3Col1Button.enabled = enable; + self.row3Col2Button.enabled = enable; + self.row3Col3Button.enabled = enable; +} + +- (IBAction)selectButton:(UIButton *)sender +{ + if (sender.currentTitle.length != 0) + { + UIAlertView *squareOccupiedAlert = [[UIAlertView alloc] + initWithTitle:@"Invalid Move" message:@"You can only pick empty squares" + delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [squareOccupiedAlert show]; + return; + } + + [sender setTitle:[self localPlayerMark] forState:UIControlStateNormal]; + [self checkCurrentState]; +} + + +- (void)checkCurrentState +{ + if ([self equalMarksForButton1:self.row1Col1Button button2:self.row1Col2Button + button3:self.row1Col3Button]) + { + [self gameEndedWithWinner:self.row1Col1Button.currentTitle]; + } + else if ([self equalMarksForButton1:self.row2Col1Button button2:self.row2Col2Button + button3:self.row2Col3Button]) + { + [self gameEndedWithWinner:self.row2Col1Button.currentTitle]; + } + else if ([self equalMarksForButton1:self.row3Col1Button button2:self.row3Col2Button + button3:self.row3Col3Button]) + { + [self gameEndedWithWinner:self.row3Col1Button.currentTitle]; + } + else if ([self equalMarksForButton1:self.row1Col1Button button2:self.row2Col1Button + button3:self.row3Col1Button]) + { + [self gameEndedWithWinner:self.row1Col1Button.currentTitle]; + } + else if ([self equalMarksForButton1:self.row1Col2Button button2:self.row2Col2Button + button3:self.row3Col2Button]) + { + [self gameEndedWithWinner:self.row1Col2Button.currentTitle]; + } + else if ([self equalMarksForButton1:self.row1Col3Button button2:self.row2Col3Button + button3:self.row3Col3Button]) + { + [self gameEndedWithWinner:self.row1Col3Button.currentTitle]; + } + else if ([self equalMarksForButton1:self.row1Col1Button button2:self.row2Col2Button + button3:self.row3Col3Button]) + { + [self gameEndedWithWinner:self.row1Col1Button.currentTitle]; + } + else if ([self equalMarksForButton1:self.row1Col3Button button2:self.row2Col2Button + button3:self.row3Col1Button]) + { + [self gameEndedWithWinner:self.row1Col3Button.currentTitle]; + } + else if ([self noEmptySquaresLeft]) + { + [self gameEndedInTie]; + } + else + { + [self advanceTurn]; + } +} + +- (BOOL)equalMarksForButton1:(UIButton *)button1 button2:(UIButton *)button2 button3:(UIButton *)button3 +{ + return button1.currentTitle.length > 0 && + [button1.currentTitle isEqualToString:button2.currentTitle] && + [button1.currentTitle isEqualToString:button3.currentTitle]; +} + +- (void)gameEndedWithWinner:(NSString *)mark +{ + NSString *message = [NSString stringWithFormat:@"%@ won!", mark]; + UIAlertView *gameOverAlert = [[UIAlertView alloc] initWithTitle:@"Game Over" + message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [gameOverAlert show]; + + //_currentMark = @""; + self.statusLabel.text = message; + + self.match.message = self.statusLabel.text; + + GKTurnBasedParticipant *participant1 = [self.match.participants objectAtIndex:0]; + GKTurnBasedParticipant *participant2 = [self.match.participants objectAtIndex:1]; + participant1.matchOutcome = GKTurnBasedMatchOutcomeTied; + participant2.matchOutcome = GKTurnBasedMatchOutcomeTied; + + if ([participant1.playerID isEqualToString:self.localPlayer.playerID]) + { + participant1.matchOutcome = GKTurnBasedMatchOutcomeWon; + participant2.matchOutcome = GKTurnBasedMatchOutcomeLost; + } + else + { + participant2.matchOutcome = GKTurnBasedMatchOutcomeWon; + participant1.matchOutcome = GKTurnBasedMatchOutcomeLost; + } + + NSData *matchData = [self encodeMatchData]; + [self.match endMatchInTurnWithMatchData:matchData completionHandler: + ^(NSError *error) + { + if (error) + { + NSLog(@"Error ending match: %@", error); + } + // + }]; + [self enableSquareButtons:NO]; +} + +- (BOOL)noEmptySquaresLeft +{ + if (self.row1Col1Button.currentTitle.length == 0) + return NO; + if (self.row1Col2Button.currentTitle.length == 0) + return NO; + if (self.row1Col3Button.currentTitle.length == 0) + return NO; + if (self.row2Col1Button.currentTitle.length == 0) + return NO; + if (self.row2Col2Button.currentTitle.length == 0) + return NO; + if (self.row2Col3Button.currentTitle.length == 0) + return NO; + if (self.row3Col1Button.currentTitle.length == 0) + return NO; + if (self.row3Col2Button.currentTitle.length == 0) + return NO; + if (self.row3Col3Button.currentTitle.length == 0) + return NO; + return YES; +} + +- (void)gameEndedInTie +{ + NSString *message = @"Game ended in a tie!"; + UIAlertView *gameOverAlert = [[UIAlertView alloc] initWithTitle:@"Game Over" + message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [gameOverAlert show]; + + //_currentMark = @""; + self.statusLabel.text = message; + self.match.message = self.statusLabel.text; + NSData *matchData = [self encodeMatchData]; + GKTurnBasedParticipant *participant1 = [self.match.participants objectAtIndex:0]; + GKTurnBasedParticipant *participant2 = [self.match.participants objectAtIndex:1]; + participant1.matchOutcome = GKTurnBasedMatchOutcomeTied; + participant2.matchOutcome = GKTurnBasedMatchOutcomeTied; + [self.match endMatchInTurnWithMatchData:matchData completionHandler: + ^(NSError *error) + { + if (error) + { + NSLog(@"Error ending match: %@", error); + } + // + }]; + [self enableSquareButtons:NO]; +} + +- (void)advanceTurn +{ + [self enableSquareButtons:NO]; + self.statusLabel.text = + [NSString stringWithFormat:@"%@'s turn", [self opponentMark]]; + self.match.message = self.statusLabel.text; + NSData *matchData = [self encodeMatchData]; + [self.match endTurnWithNextParticipants:@[[self opponentParticipant]] + turnTimeout:GKTurnTimeoutDefault matchData:matchData completionHandler: + ^(NSError *error) + { + if (error) + { + NSLog(@"Error advancing turn: %@", error); + } + }]; +} + +- (void)authenticateLocalPlayer +{ + __weak GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; + localPlayer.authenticateHandler = + ^(UIViewController *authenticateViewController, NSError *error) + { + if (authenticateViewController != nil) + { + [self presentViewController:authenticateViewController animated:YES + completion:nil]; + } + else if (localPlayer.isAuthenticated) + { + self.localPlayer = localPlayer; + } + else + { + // Disable Game Center + self.localPlayer = nil; + } + }; +} + +#pragma mark - math data methods + +- (NSData *)encodeMatchData +{ + NSArray *stateArray = @[@1 /* version */, + self.row1Col1Button.currentTitle, self.row1Col2Button.currentTitle, + self.row1Col3Button.currentTitle, + self.row2Col1Button.currentTitle, self.row2Col2Button.currentTitle, + self.row2Col3Button.currentTitle, + self.row3Col1Button.currentTitle, self.row3Col2Button.currentTitle, + self.row3Col3Button.currentTitle + ]; + return [NSKeyedArchiver archivedDataWithRootObject:stateArray]; +} + +- (void)decodeMatchData:(NSData *)matchData +{ + NSArray *stateArray = [NSKeyedUnarchiver unarchiveObjectWithData:matchData]; + + [self.row1Col1Button setTitle:[stateArray objectAtIndex:1] + forState:UIControlStateNormal]; + [self.row1Col2Button setTitle:[stateArray objectAtIndex:2] + forState:UIControlStateNormal]; + [self.row1Col3Button setTitle:[stateArray objectAtIndex:3] + forState:UIControlStateNormal]; + [self.row2Col1Button setTitle:[stateArray objectAtIndex:4] + forState:UIControlStateNormal]; + [self.row2Col2Button setTitle:[stateArray objectAtIndex:5] + forState:UIControlStateNormal]; + [self.row2Col3Button setTitle:[stateArray objectAtIndex:6] + forState:UIControlStateNormal]; + [self.row3Col1Button setTitle:[stateArray objectAtIndex:7] + forState:UIControlStateNormal]; + [self.row3Col2Button setTitle:[stateArray objectAtIndex:8] + forState:UIControlStateNormal]; + [self.row3Col3Button setTitle:[stateArray objectAtIndex:9] + forState:UIControlStateNormal]; +} + +- (void)loadMatchData +{ + [_match loadMatchDataWithCompletionHandler:^(NSData *matchData, NSError *error) + { + dispatch_async(dispatch_get_main_queue(),^{ + if (matchData.length > 0) + { + [self decodeMatchData:matchData]; + } + else + { + [self resetButtonTitles]; + } + NSString *currentMark; + if ([self localPlayerIsCurrentPlayer]) + { + [self enableSquareButtons:YES]; + currentMark = [self localPlayerMark]; + } + else + { + [self enableSquareButtons:NO]; + currentMark = [self opponentMark]; + } + self.statusLabel.text = + [NSString stringWithFormat:@"%@'s turn", currentMark]; + }); + }]; +} + +- (BOOL)localPlayerIsCurrentPlayer +{ + return [self.localPlayer.playerID + isEqualToString:self.match.currentParticipant.playerID]; +} + +- (NSString *)localPlayerMark +{ + if ([self.localPlayer.playerID isEqualToString:self.player1.playerID]) + { + return @"X"; + } + else + { + return @"O"; + } +} + +- (NSString *)opponentMark +{ + if ([[self localPlayerMark] isEqualToString:@"X"]) + { + return @"O"; + } + else + { + return @"X"; + } +} + +- (GKTurnBasedParticipant *)opponentParticipant +{ + GKTurnBasedParticipant *candidate = [self.match.participants objectAtIndex:0]; + if ([self.localPlayer.playerID isEqualToString:candidate.playerID]) + { + return [self.match.participants objectAtIndex:1]; + } + else + { + return candidate; + } +} +- (void)handleMatchEnded:(GKTurnBasedMatch *)match +{ + if ([self.match.matchID isEqualToString:match.matchID]) + { + [self.match loadMatchDataWithCompletionHandler: + ^(NSData *matchData, NSError *error) + { + dispatch_async(dispatch_get_main_queue(),^{ + if (matchData.length > 0) + { + [self decodeMatchData:matchData]; + } + self.statusLabel.text = match.message; + }); + }]; + } +} + + + + +#pragma mark - Matchmaker delegates + +- (void)turnBasedMatchmakerViewControllerWasCancelled: +(GKTurnBasedMatchmakerViewController *)viewController +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)turnBasedMatchmakerViewController: +(GKTurnBasedMatchmakerViewController *)viewController didFailWithError:(NSError *)error +{ + [self dismissViewControllerAnimated:YES completion:nil]; + NSLog(@"Error while matchmaking: %@", error); +} +- (void)turnBasedMatchmakerViewController: +(GKTurnBasedMatchmakerViewController *)viewController didFindMatch:(GKTurnBasedMatch *)match +{ + [self dismissViewControllerAnimated:YES completion:nil]; + + self.match = match; +} + +- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController *)viewController playerQuitForMatch:(GKTurnBasedMatch *)match +{ + if ([self.match.matchID isEqualToString:match.matchID]) + { + [self gameEndedWithWinner:[self localPlayerMark]]; + } +} + +#pragma mark - turn based delegates + + + + +-(void)player:(GKPlayer *)player receivedTurnEventForMatch:(GKTurnBasedMatch *)match didBecomeActive:(BOOL)didBecomeActive +{ + + self.match = match; + +} + +-(void)player:(GKPlayer *)player matchEnded:(GKTurnBasedMatch *)match +{ + + + self.match = match; +} + + + + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/main.m b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/main.m new file mode 100644 index 0000000..44c425e --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac Toe/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Tic Tac Toe +// +// Created by joseph hoffman on 9/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/Tic Tac ToeTests-Info.plist b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/Tic Tac ToeTests-Info.plist new file mode 100644 index 0000000..325dccc --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/Tic Tac ToeTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/Tic_Tac_ToeTests.m b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/Tic_Tac_ToeTests.m new file mode 100644 index 0000000..211a1c8 --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/Tic_Tac_ToeTests.m @@ -0,0 +1,34 @@ +// +// Tic_Tac_ToeTests.m +// Tic Tac ToeTests +// +// Created by joseph hoffman on 9/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Tic_Tac_ToeTests : XCTestCase + +@end + +@implementation Tic_Tac_ToeTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/en.lproj/InfoPlist.strings b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH17 - Game Kit Recipes/Recipe 17-4 Creating a Simple Turn-Based Multiplayer Game/Tic Tac ToeTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/.DS_Store b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/.DS_Store new file mode 100644 index 0000000..8d60a76 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/.DS_Store differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.pbxproj b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f8e8bf1 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.pbxproj @@ -0,0 +1,495 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 881D4C1817828FB60035E64B /* AppTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 881D4C1717828FB60035E64B /* AppTableViewCell.m */; }; + 8880BA6A178121C70033EA04 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8880BA69178121C70033EA04 /* Foundation.framework */; }; + 8880BA6C178121C70033EA04 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8880BA6B178121C70033EA04 /* CoreGraphics.framework */; }; + 8880BA6E178121C70033EA04 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8880BA6D178121C70033EA04 /* UIKit.framework */; }; + 8880BA74178121C70033EA04 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8880BA72178121C70033EA04 /* InfoPlist.strings */; }; + 8880BA76178121C70033EA04 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8880BA75178121C70033EA04 /* main.m */; }; + 8880BA7A178121C70033EA04 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8880BA79178121C70033EA04 /* AppDelegate.m */; }; + 8880BA7D178121C70033EA04 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8880BA7B178121C70033EA04 /* Main.storyboard */; }; + 8880BA80178121C70033EA04 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8880BA7F178121C70033EA04 /* ViewController.m */; }; + 8880BA82178121C70033EA04 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8880BA81178121C70033EA04 /* Images.xcassets */; }; + 8880BA89178121C70033EA04 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8880BA88178121C70033EA04 /* XCTest.framework */; }; + 8880BA8A178121C70033EA04 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8880BA69178121C70033EA04 /* Foundation.framework */; }; + 8880BA8B178121C70033EA04 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8880BA6D178121C70033EA04 /* UIKit.framework */; }; + 8880BA93178121C70033EA04 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8880BA91178121C70033EA04 /* InfoPlist.strings */; }; + 8880BA95178121C70033EA04 /* Recipe_2_1_to_2_2__About_UsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8880BA94178121C70033EA04 /* Recipe_2_1_to_2_2__About_UsTests.m */; }; + 88ABFFBA17813DFA00C0B67D /* AppDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 88ABFFB917813DFA00C0B67D /* AppDetails.m */; }; + 88ABFFBD178140BE00C0B67D /* AppDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88ABFFBC178140BE00C0B67D /* AppDetailsViewController.m */; }; + 88ABFFC0178269CA00C0B67D /* OurAppsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88ABFFBF178269CA00C0B67D /* OurAppsTableViewController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8880BA8C178121C70033EA04 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8880BA5E178121C70033EA04 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8880BA65178121C70033EA04; + remoteInfo = "Recipe 2-1 to 2-2: About Us"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 881D4C1617828FB60035E64B /* AppTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppTableViewCell.h; sourceTree = ""; }; + 881D4C1717828FB60035E64B /* AppTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppTableViewCell.m; sourceTree = ""; }; + 8880BA66178121C70033EA04 /* Recipe 2-1 to 2-2 About Us.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 2-1 to 2-2 About Us.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8880BA69178121C70033EA04 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8880BA6B178121C70033EA04 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8880BA6D178121C70033EA04 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8880BA71178121C70033EA04 /* Recipe 2-1 to 2-2 About Us-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 2-1 to 2-2 About Us-Info.plist"; sourceTree = ""; }; + 8880BA73178121C70033EA04 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8880BA75178121C70033EA04 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8880BA77178121C70033EA04 /* Recipe 2-1 to 2-2 About Us-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 2-1 to 2-2 About Us-Prefix.pch"; sourceTree = ""; }; + 8880BA78178121C70033EA04 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8880BA79178121C70033EA04 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8880BA7C178121C70033EA04 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8880BA7E178121C70033EA04 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8880BA7F178121C70033EA04 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8880BA81178121C70033EA04 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8880BA87178121C70033EA04 /* Recipe 2-1 to 2-2 About UsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 2-1 to 2-2 About UsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8880BA88178121C70033EA04 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8880BA90178121C70033EA04 /* Recipe 2-1 to 2-2 About UsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 2-1 to 2-2 About UsTests-Info.plist"; sourceTree = ""; }; + 8880BA92178121C70033EA04 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8880BA94178121C70033EA04 /* Recipe_2_1_to_2_2__About_UsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_2_1_to_2_2__About_UsTests.m; sourceTree = ""; }; + 88ABFFB817813DFA00C0B67D /* AppDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDetails.h; sourceTree = ""; }; + 88ABFFB917813DFA00C0B67D /* AppDetails.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDetails.m; sourceTree = ""; }; + 88ABFFBB178140BE00C0B67D /* AppDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDetailsViewController.h; sourceTree = ""; }; + 88ABFFBC178140BE00C0B67D /* AppDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDetailsViewController.m; sourceTree = ""; }; + 88ABFFBE178269CA00C0B67D /* OurAppsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OurAppsTableViewController.h; sourceTree = ""; }; + 88ABFFBF178269CA00C0B67D /* OurAppsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OurAppsTableViewController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8880BA63178121C70033EA04 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8880BA6C178121C70033EA04 /* CoreGraphics.framework in Frameworks */, + 8880BA6E178121C70033EA04 /* UIKit.framework in Frameworks */, + 8880BA6A178121C70033EA04 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8880BA84178121C70033EA04 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8880BA89178121C70033EA04 /* XCTest.framework in Frameworks */, + 8880BA8B178121C70033EA04 /* UIKit.framework in Frameworks */, + 8880BA8A178121C70033EA04 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8880BA5D178121C70033EA04 = { + isa = PBXGroup; + children = ( + 8880BA6F178121C70033EA04 /* Recipe 2-1 to 2-2: About Us */, + 8880BA8E178121C70033EA04 /* Recipe 2-1 to 2-2: About UsTests */, + 8880BA68178121C70033EA04 /* Frameworks */, + 8880BA67178121C70033EA04 /* Products */, + ); + sourceTree = ""; + }; + 8880BA67178121C70033EA04 /* Products */ = { + isa = PBXGroup; + children = ( + 8880BA66178121C70033EA04 /* Recipe 2-1 to 2-2 About Us.app */, + 8880BA87178121C70033EA04 /* Recipe 2-1 to 2-2 About UsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8880BA68178121C70033EA04 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8880BA69178121C70033EA04 /* Foundation.framework */, + 8880BA6B178121C70033EA04 /* CoreGraphics.framework */, + 8880BA6D178121C70033EA04 /* UIKit.framework */, + 8880BA88178121C70033EA04 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8880BA6F178121C70033EA04 /* Recipe 2-1 to 2-2: About Us */ = { + isa = PBXGroup; + children = ( + 8880BA78178121C70033EA04 /* AppDelegate.h */, + 8880BA79178121C70033EA04 /* AppDelegate.m */, + 8880BA7B178121C70033EA04 /* Main.storyboard */, + 881D4C1617828FB60035E64B /* AppTableViewCell.h */, + 881D4C1717828FB60035E64B /* AppTableViewCell.m */, + 88ABFFB817813DFA00C0B67D /* AppDetails.h */, + 88ABFFB917813DFA00C0B67D /* AppDetails.m */, + 88ABFFBB178140BE00C0B67D /* AppDetailsViewController.h */, + 88ABFFBC178140BE00C0B67D /* AppDetailsViewController.m */, + 88ABFFBE178269CA00C0B67D /* OurAppsTableViewController.h */, + 88ABFFBF178269CA00C0B67D /* OurAppsTableViewController.m */, + 8880BA7E178121C70033EA04 /* ViewController.h */, + 8880BA7F178121C70033EA04 /* ViewController.m */, + 8880BA81178121C70033EA04 /* Images.xcassets */, + 8880BA70178121C70033EA04 /* Supporting Files */, + ); + path = "Recipe 2-1 to 2-2: About Us"; + sourceTree = ""; + }; + 8880BA70178121C70033EA04 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8880BA71178121C70033EA04 /* Recipe 2-1 to 2-2 About Us-Info.plist */, + 8880BA72178121C70033EA04 /* InfoPlist.strings */, + 8880BA75178121C70033EA04 /* main.m */, + 8880BA77178121C70033EA04 /* Recipe 2-1 to 2-2 About Us-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8880BA8E178121C70033EA04 /* Recipe 2-1 to 2-2: About UsTests */ = { + isa = PBXGroup; + children = ( + 8880BA94178121C70033EA04 /* Recipe_2_1_to_2_2__About_UsTests.m */, + 8880BA8F178121C70033EA04 /* Supporting Files */, + ); + path = "Recipe 2-1 to 2-2: About UsTests"; + sourceTree = ""; + }; + 8880BA8F178121C70033EA04 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8880BA90178121C70033EA04 /* Recipe 2-1 to 2-2 About UsTests-Info.plist */, + 8880BA91178121C70033EA04 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8880BA65178121C70033EA04 /* Recipe 2-1 to 2-2 About Us */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8880BA98178121C70033EA04 /* Build configuration list for PBXNativeTarget "Recipe 2-1 to 2-2 About Us" */; + buildPhases = ( + 8880BA62178121C70033EA04 /* Sources */, + 8880BA63178121C70033EA04 /* Frameworks */, + 8880BA64178121C70033EA04 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 2-1 to 2-2 About Us"; + productName = "Recipe 2-1 to 2-2: About Us"; + productReference = 8880BA66178121C70033EA04 /* Recipe 2-1 to 2-2 About Us.app */; + productType = "com.apple.product-type.application"; + }; + 8880BA86178121C70033EA04 /* Recipe 2-1 to 2-2 About UsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8880BA9B178121C70033EA04 /* Build configuration list for PBXNativeTarget "Recipe 2-1 to 2-2 About UsTests" */; + buildPhases = ( + 8880BA83178121C70033EA04 /* Sources */, + 8880BA84178121C70033EA04 /* Frameworks */, + 8880BA85178121C70033EA04 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8880BA8D178121C70033EA04 /* PBXTargetDependency */, + ); + name = "Recipe 2-1 to 2-2 About UsTests"; + productName = "Recipe 2-1 to 2-2: About UsTests"; + productReference = 8880BA87178121C70033EA04 /* Recipe 2-1 to 2-2 About UsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8880BA5E178121C70033EA04 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8880BA86178121C70033EA04 = { + TestTargetID = 8880BA65178121C70033EA04; + }; + }; + }; + buildConfigurationList = 8880BA61178121C70033EA04 /* Build configuration list for PBXProject "Recipe 2-1 to 2-2 About Us" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8880BA5D178121C70033EA04; + productRefGroup = 8880BA67178121C70033EA04 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8880BA65178121C70033EA04 /* Recipe 2-1 to 2-2 About Us */, + 8880BA86178121C70033EA04 /* Recipe 2-1 to 2-2 About UsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8880BA64178121C70033EA04 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8880BA82178121C70033EA04 /* Images.xcassets in Resources */, + 8880BA74178121C70033EA04 /* InfoPlist.strings in Resources */, + 8880BA7D178121C70033EA04 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8880BA85178121C70033EA04 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8880BA93178121C70033EA04 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8880BA62178121C70033EA04 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88ABFFC0178269CA00C0B67D /* OurAppsTableViewController.m in Sources */, + 8880BA80178121C70033EA04 /* ViewController.m in Sources */, + 8880BA7A178121C70033EA04 /* AppDelegate.m in Sources */, + 881D4C1817828FB60035E64B /* AppTableViewCell.m in Sources */, + 88ABFFBD178140BE00C0B67D /* AppDetailsViewController.m in Sources */, + 88ABFFBA17813DFA00C0B67D /* AppDetails.m in Sources */, + 8880BA76178121C70033EA04 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8880BA83178121C70033EA04 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8880BA95178121C70033EA04 /* Recipe_2_1_to_2_2__About_UsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8880BA8D178121C70033EA04 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8880BA65178121C70033EA04 /* Recipe 2-1 to 2-2 About Us */; + targetProxy = 8880BA8C178121C70033EA04 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8880BA72178121C70033EA04 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8880BA73178121C70033EA04 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8880BA7B178121C70033EA04 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8880BA7C178121C70033EA04 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8880BA91178121C70033EA04 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8880BA92178121C70033EA04 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8880BA96178121C70033EA04 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8880BA97178121C70033EA04 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8880BA99178121C70033EA04 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-1 to 2-2: About Us/Recipe 2-1 to 2-2 About Us-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-1 to 2-2: About Us/Recipe 2-1 to 2-2 About Us-Info.plist"; + PRODUCT_NAME = "Recipe 2-1 to 2-2 About Us"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8880BA9A178121C70033EA04 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-1 to 2-2: About Us/Recipe 2-1 to 2-2 About Us-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-1 to 2-2: About Us/Recipe 2-1 to 2-2 About Us-Info.plist"; + PRODUCT_NAME = "Recipe 2-1 to 2-2 About Us"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8880BA9C178121C70033EA04 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 2-1 to 2-2: About Us.app/Recipe 2-1 to 2-2: About Us"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-1 to 2-2: About Us/Recipe 2-1 to 2-2: About Us-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 2-1 to 2-2: About UsTests/Recipe 2-1 to 2-2 About UsTests-Info.plist"; + PRODUCT_NAME = "Recipe 2-1 to 2-2 About UsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8880BA9D178121C70033EA04 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 2-1 to 2-2: About Us.app/Recipe 2-1 to 2-2: About Us"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-1 to 2-2: About Us/Recipe 2-1 to 2-2: About Us-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-1 to 2-2: About UsTests/Recipe 2-1 to 2-2 About UsTests-Info.plist"; + PRODUCT_NAME = "Recipe 2-1 to 2-2 About UsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8880BA61178121C70033EA04 /* Build configuration list for PBXProject "Recipe 2-1 to 2-2 About Us" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8880BA96178121C70033EA04 /* Debug */, + 8880BA97178121C70033EA04 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8880BA98178121C70033EA04 /* Build configuration list for PBXNativeTarget "Recipe 2-1 to 2-2 About Us" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8880BA99178121C70033EA04 /* Debug */, + 8880BA9A178121C70033EA04 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8880BA9B178121C70033EA04 /* Build configuration list for PBXNativeTarget "Recipe 2-1 to 2-2 About UsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8880BA9C178121C70033EA04 /* Debug */, + 8880BA9D178121C70033EA04 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8880BA5E178121C70033EA04 /* Project object */; +} diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1105770 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..af4a038 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-1 to 2-2 About Us.xcscheme b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-1 to 2-2 About Us.xcscheme new file mode 100644 index 0000000..0853cba --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-1 to 2-2 About Us.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d37e5cd --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 2-1 to 2-2 About Us.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8880BA65178121C70033EA04 + + primary + + + 8880BA86178121C70033EA04 + + primary + + + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDelegate.h b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDelegate.h new file mode 100644 index 0000000..7d0c0a4 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDelegate.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDelegate.m new file mode 100644 index 0000000..54986fc --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetails.h b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetails.h new file mode 100644 index 0000000..a4388a5 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetails.h @@ -0,0 +1,18 @@ +// +// AppDetails.h +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDetails : NSObject + +@property(strong, nonatomic) NSString *name; +@property(strong, nonatomic) NSString *description; + +-(id)initWithName:(NSString *)name description:(NSString *)descr; + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetails.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetails.m new file mode 100644 index 0000000..cab6d56 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetails.m @@ -0,0 +1,22 @@ +// +// AppDetails.m +// Recipe 2-1 to 2-2 About Us +// + +#import "AppDetails.h" + +@implementation AppDetails + + +-(id)initWithName:(NSString *)name description:(NSString *)descr +{ + self = [super init]; + if (self) + { + self.name = name; + self.description = descr; + } + return self; +} + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetailsViewController.h b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetailsViewController.h new file mode 100644 index 0000000..5984ba4 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetailsViewController.h @@ -0,0 +1,18 @@ +// +// AppDetailsViewController.h +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "AppDetails.h" + +@interface AppDetailsViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UITextView *descriptionTextView; +@property (strong,nonatomic) AppDetails *appDetails; + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetailsViewController.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetailsViewController.m new file mode 100644 index 0000000..ae3e362 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppDetailsViewController.m @@ -0,0 +1,40 @@ +// +// AppDetailsViewController.m +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDetailsViewController.h" + +@interface AppDetailsViewController () + +@end + +@implementation AppDetailsViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.nameLabel.text = self.appDetails.name; + self.descriptionTextView.text = self.appDetails.description; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppTableViewCell.h b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppTableViewCell.h new file mode 100644 index 0000000..7f884c1 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppTableViewCell.h @@ -0,0 +1,13 @@ +// +// AppTableViewCell.h +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 7/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppTableViewCell : UITableViewCell + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppTableViewCell.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppTableViewCell.m new file mode 100644 index 0000000..48efff2 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/AppTableViewCell.m @@ -0,0 +1,29 @@ +// +// AppTableViewCell.m +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 7/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppTableViewCell.h" + +@implementation AppTableViewCell + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Base.lproj/Main.storyboard b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Base.lproj/Main.storyboard new file mode 100644 index 0000000..3f1c549 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Base.lproj/Main.storyboard @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Images.xcassets/AppIcon.appiconset/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/OurAppsTableViewController.h b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/OurAppsTableViewController.h new file mode 100644 index 0000000..ecc71bc --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/OurAppsTableViewController.h @@ -0,0 +1,13 @@ +// +// OurAppsTableViewController.h +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 7/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface OurAppsTableViewController : UITableViewController + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/OurAppsTableViewController.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/OurAppsTableViewController.m new file mode 100644 index 0000000..b6cb8c4 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/OurAppsTableViewController.m @@ -0,0 +1,102 @@ +// +// OurAppsTableViewController.m +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 7/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "OurAppsTableViewController.h" +#import "AppDetailsViewController.h" +#import "AppDetails.h" + +@interface OurAppsTableViewController () + +@end + +@implementation OurAppsTableViewController + + + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + if ([segue.identifier isEqualToString:@"PushAppDetails"]) + { + AppDetailsViewController *appDetailsViewController = segue.destinationViewController; + UITableViewCell *cell = sender; + appDetailsViewController.appDetails = + [[AppDetails alloc] initWithName:cell.textLabel.text + description:cell.detailTextLabel.text]; + } +} + +- (id)initWithStyle:(UITableViewStyle)style +{ + self = [super initWithStyle:style]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 3; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + //Set the CellIdentifier that you set in the storyboard + static NSString *CellIdentifier = @"AppCell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + + switch (indexPath.row) + { + case 0: + cell.textLabel.text = @"Awesome App"; + cell.detailTextLabel.text = @"Long description of the awesome app..."; + break; + case 1: + cell.textLabel.text = @"Even More Awesome App"; + cell.detailTextLabel.text = @"Long description of the even more awesome app..."; + break; + case 2: + cell.textLabel.text = @"The Most Awesome App Ever"; + cell.detailTextLabel.text = + @"Long description of the most awesome app ever seen..."; + break; + + default: + cell.textLabel.text = @"Unkown"; + cell.detailTextLabel.text = @"Unknown"; + break; + } + + return cell; +} + + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us-Info.plist b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us-Prefix.pch b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2 About Us-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/ViewController.h b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/ViewController.h new file mode 100644 index 0000000..e4e9a8c --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/ViewController.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/ViewController.m new file mode 100644 index 0000000..81366c0 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 2-1 to 2-2 About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/en.lproj/InfoPlist.strings b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/main.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/main.m new file mode 100644 index 0000000..07a49be --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About Us/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 2-1 to 2-2: About Us +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/Recipe 2-1 to 2-2 About UsTests-Info.plist b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/Recipe 2-1 to 2-2 About UsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/Recipe 2-1 to 2-2 About UsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/Recipe_2_1_to_2_2__About_UsTests.m b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/Recipe_2_1_to_2_2__About_UsTests.m new file mode 100644 index 0000000..18790c8 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/Recipe_2_1_to_2_2__About_UsTests.m @@ -0,0 +1,36 @@ +// +// Recipe_2_1_to_2_2__About_UsTests.m +// Recipe 2-1 to 2-2: About UsTests +// +// Created by joseph hoffman on 6/30/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_2_1_to_2_2__About_UsTests : XCTestCase + +@end + +@implementation Recipe_2_1_to_2_2__About_UsTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/en.lproj/InfoPlist.strings b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-1 to 2-2_ About Us/Recipe 2-1 to 2-2_ About UsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/.DS_Store b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/.DS_Store new file mode 100644 index 0000000..e682641 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/.DS_Store differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.pbxproj b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.pbxproj new file mode 100644 index 0000000..88f1b8a --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88B975A41783D8B700D87D88 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88B975A31783D8B700D87D88 /* Foundation.framework */; }; + 88B975A61783D8B700D87D88 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88B975A51783D8B700D87D88 /* CoreGraphics.framework */; }; + 88B975A81783D8B700D87D88 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88B975A71783D8B700D87D88 /* UIKit.framework */; }; + 88B975AE1783D8B700D87D88 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88B975AC1783D8B700D87D88 /* InfoPlist.strings */; }; + 88B975B01783D8B700D87D88 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88B975AF1783D8B700D87D88 /* main.m */; }; + 88B975B41783D8B700D87D88 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88B975B31783D8B700D87D88 /* AppDelegate.m */; }; + 88B975B71783D8B700D87D88 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88B975B51783D8B700D87D88 /* Main.storyboard */; }; + 88B975BA1783D8B700D87D88 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88B975B91783D8B700D87D88 /* ViewController.m */; }; + 88B975BC1783D8B700D87D88 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88B975BB1783D8B700D87D88 /* Images.xcassets */; }; + 88B975C31783D8B700D87D88 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88B975C21783D8B700D87D88 /* XCTest.framework */; }; + 88B975C41783D8B700D87D88 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88B975A31783D8B700D87D88 /* Foundation.framework */; }; + 88B975C51783D8B700D87D88 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88B975A71783D8B700D87D88 /* UIKit.framework */; }; + 88B975CD1783D8B700D87D88 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88B975CB1783D8B700D87D88 /* InfoPlist.strings */; }; + 88B975CF1783D8B700D87D88 /* Recipe_2_3__News_AppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88B975CE1783D8B700D87D88 /* Recipe_2_3__News_AppTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88B975C61783D8B700D87D88 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88B975981783D8B700D87D88 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88B9759F1783D8B700D87D88; + remoteInfo = "Recipe 2-3: News App"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88B975A01783D8B700D87D88 /* Recipe 2-3 News App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 2-3 News App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88B975A31783D8B700D87D88 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88B975A51783D8B700D87D88 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88B975A71783D8B700D87D88 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88B975AB1783D8B700D87D88 /* Recipe 2-3 News App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 2-3 News App-Info.plist"; sourceTree = ""; }; + 88B975AD1783D8B700D87D88 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88B975AF1783D8B700D87D88 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88B975B11783D8B700D87D88 /* Recipe 2-3 News App-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 2-3 News App-Prefix.pch"; sourceTree = ""; }; + 88B975B21783D8B700D87D88 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88B975B31783D8B700D87D88 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88B975B61783D8B700D87D88 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88B975B81783D8B700D87D88 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88B975B91783D8B700D87D88 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88B975BB1783D8B700D87D88 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88B975C11783D8B700D87D88 /* Recipe 2-3 News AppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 2-3 News AppTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88B975C21783D8B700D87D88 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88B975CA1783D8B700D87D88 /* Recipe 2-3 News AppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 2-3 News AppTests-Info.plist"; sourceTree = ""; }; + 88B975CC1783D8B700D87D88 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88B975CE1783D8B700D87D88 /* Recipe_2_3__News_AppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_2_3__News_AppTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88B9759D1783D8B700D87D88 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88B975A61783D8B700D87D88 /* CoreGraphics.framework in Frameworks */, + 88B975A81783D8B700D87D88 /* UIKit.framework in Frameworks */, + 88B975A41783D8B700D87D88 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88B975BE1783D8B700D87D88 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88B975C31783D8B700D87D88 /* XCTest.framework in Frameworks */, + 88B975C51783D8B700D87D88 /* UIKit.framework in Frameworks */, + 88B975C41783D8B700D87D88 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88B975971783D8B700D87D88 = { + isa = PBXGroup; + children = ( + 88B975A91783D8B700D87D88 /* Recipe 2-3 News App */, + 88B975C81783D8B700D87D88 /* Recipe 2-3 News AppTests */, + 88B975A21783D8B700D87D88 /* Frameworks */, + 88B975A11783D8B700D87D88 /* Products */, + ); + sourceTree = ""; + }; + 88B975A11783D8B700D87D88 /* Products */ = { + isa = PBXGroup; + children = ( + 88B975A01783D8B700D87D88 /* Recipe 2-3 News App.app */, + 88B975C11783D8B700D87D88 /* Recipe 2-3 News AppTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88B975A21783D8B700D87D88 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88B975A31783D8B700D87D88 /* Foundation.framework */, + 88B975A51783D8B700D87D88 /* CoreGraphics.framework */, + 88B975A71783D8B700D87D88 /* UIKit.framework */, + 88B975C21783D8B700D87D88 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88B975A91783D8B700D87D88 /* Recipe 2-3 News App */ = { + isa = PBXGroup; + children = ( + 88B975B21783D8B700D87D88 /* AppDelegate.h */, + 88B975B31783D8B700D87D88 /* AppDelegate.m */, + 88B975B51783D8B700D87D88 /* Main.storyboard */, + 88B975B81783D8B700D87D88 /* ViewController.h */, + 88B975B91783D8B700D87D88 /* ViewController.m */, + 88B975BB1783D8B700D87D88 /* Images.xcassets */, + 88B975AA1783D8B700D87D88 /* Supporting Files */, + ); + name = "Recipe 2-3 News App"; + path = "Recipe 2-3: News App"; + sourceTree = ""; + }; + 88B975AA1783D8B700D87D88 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88B975AB1783D8B700D87D88 /* Recipe 2-3 News App-Info.plist */, + 88B975AC1783D8B700D87D88 /* InfoPlist.strings */, + 88B975AF1783D8B700D87D88 /* main.m */, + 88B975B11783D8B700D87D88 /* Recipe 2-3 News App-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88B975C81783D8B700D87D88 /* Recipe 2-3 News AppTests */ = { + isa = PBXGroup; + children = ( + 88B975CE1783D8B700D87D88 /* Recipe_2_3__News_AppTests.m */, + 88B975C91783D8B700D87D88 /* Supporting Files */, + ); + name = "Recipe 2-3 News AppTests"; + path = "Recipe 2-3: News AppTests"; + sourceTree = ""; + }; + 88B975C91783D8B700D87D88 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88B975CA1783D8B700D87D88 /* Recipe 2-3 News AppTests-Info.plist */, + 88B975CB1783D8B700D87D88 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88B9759F1783D8B700D87D88 /* Recipe 2-3 News App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88B975D21783D8B700D87D88 /* Build configuration list for PBXNativeTarget "Recipe 2-3 News App" */; + buildPhases = ( + 88B9759C1783D8B700D87D88 /* Sources */, + 88B9759D1783D8B700D87D88 /* Frameworks */, + 88B9759E1783D8B700D87D88 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 2-3 News App"; + productName = "Recipe 2-3: News App"; + productReference = 88B975A01783D8B700D87D88 /* Recipe 2-3 News App.app */; + productType = "com.apple.product-type.application"; + }; + 88B975C01783D8B700D87D88 /* Recipe 2-3 News AppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88B975D51783D8B700D87D88 /* Build configuration list for PBXNativeTarget "Recipe 2-3 News AppTests" */; + buildPhases = ( + 88B975BD1783D8B700D87D88 /* Sources */, + 88B975BE1783D8B700D87D88 /* Frameworks */, + 88B975BF1783D8B700D87D88 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88B975C71783D8B700D87D88 /* PBXTargetDependency */, + ); + name = "Recipe 2-3 News AppTests"; + productName = "Recipe 2-3: News AppTests"; + productReference = 88B975C11783D8B700D87D88 /* Recipe 2-3 News AppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88B975981783D8B700D87D88 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88B975C01783D8B700D87D88 = { + TestTargetID = 88B9759F1783D8B700D87D88; + }; + }; + }; + buildConfigurationList = 88B9759B1783D8B700D87D88 /* Build configuration list for PBXProject "Recipe 2-3 News App" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88B975971783D8B700D87D88; + productRefGroup = 88B975A11783D8B700D87D88 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88B9759F1783D8B700D87D88 /* Recipe 2-3 News App */, + 88B975C01783D8B700D87D88 /* Recipe 2-3 News AppTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88B9759E1783D8B700D87D88 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88B975BC1783D8B700D87D88 /* Images.xcassets in Resources */, + 88B975AE1783D8B700D87D88 /* InfoPlist.strings in Resources */, + 88B975B71783D8B700D87D88 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88B975BF1783D8B700D87D88 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88B975CD1783D8B700D87D88 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88B9759C1783D8B700D87D88 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88B975BA1783D8B700D87D88 /* ViewController.m in Sources */, + 88B975B41783D8B700D87D88 /* AppDelegate.m in Sources */, + 88B975B01783D8B700D87D88 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88B975BD1783D8B700D87D88 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88B975CF1783D8B700D87D88 /* Recipe_2_3__News_AppTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88B975C71783D8B700D87D88 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88B9759F1783D8B700D87D88 /* Recipe 2-3 News App */; + targetProxy = 88B975C61783D8B700D87D88 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88B975AC1783D8B700D87D88 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88B975AD1783D8B700D87D88 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88B975B51783D8B700D87D88 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88B975B61783D8B700D87D88 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88B975CB1783D8B700D87D88 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88B975CC1783D8B700D87D88 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88B975D01783D8B700D87D88 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88B975D11783D8B700D87D88 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88B975D31783D8B700D87D88 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: News App/Recipe 2-3 News App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-3: News App/Recipe 2-3 News App-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 News App"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88B975D41783D8B700D87D88 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: News App/Recipe 2-3 News App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-3: News App/Recipe 2-3 News App-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 News App"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88B975D61783D8B700D87D88 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 2-3: News App.app/Recipe 2-3: News App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: News App/Recipe 2-3: News App-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 2-3: News AppTests/Recipe 2-3 News AppTests-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 News AppTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88B975D71783D8B700D87D88 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 2-3: News App.app/Recipe 2-3: News App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: News App/Recipe 2-3: News App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-3: News AppTests/Recipe 2-3 News AppTests-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 News AppTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88B9759B1783D8B700D87D88 /* Build configuration list for PBXProject "Recipe 2-3 News App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88B975D01783D8B700D87D88 /* Debug */, + 88B975D11783D8B700D87D88 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88B975D21783D8B700D87D88 /* Build configuration list for PBXNativeTarget "Recipe 2-3 News App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88B975D31783D8B700D87D88 /* Debug */, + 88B975D41783D8B700D87D88 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88B975D51783D8B700D87D88 /* Build configuration list for PBXNativeTarget "Recipe 2-3 News AppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88B975D61783D8B700D87D88 /* Debug */, + 88B975D71783D8B700D87D88 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88B975981783D8B700D87D88 /* Project object */; +} diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..30dfdc8 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..1e1c1fc Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-3_ News App.xcscheme b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-3_ News App.xcscheme new file mode 100644 index 0000000..663a841 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-3_ News App.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..b849925 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3 News App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 2-3: News App.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88B9759F1783D8B700D87D88 + + primary + + + 88B975C01783D8B700D87D88 + + primary + + + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/AppDelegate.h b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/AppDelegate.h new file mode 100644 index 0000000..18645b2 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 2-3 News App +// +// Created by joseph hoffman on 7/2/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/AppDelegate.m b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/AppDelegate.m new file mode 100644 index 0000000..f85a642 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 2-3 News App +// +// Created by joseph hoffman on 7/2/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Base.lproj/Main.storyboard b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Base.lproj/Main.storyboard new file mode 100644 index 0000000..3ffc4b7 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Base.lproj/Main.storyboard @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/AppIcon.appiconset/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/Contents.json new file mode 100644 index 0000000..75e812a --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "headlinesIcon.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "headlinesIcon@2x 2.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/headlinesIcon.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/headlinesIcon.png new file mode 100644 index 0000000..b2b89ed Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/headlinesIcon.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/headlinesIcon@2x 2.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/headlinesIcon@2x 2.png new file mode 100644 index 0000000..9eb4646 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/headlinesIcon.imageset/headlinesIcon@2x 2.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/Contents.json new file mode 100644 index 0000000..7b31d7f --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "poloticsIcon 2.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "poloticsIcon@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/poloticsIcon 2.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/poloticsIcon 2.png new file mode 100644 index 0000000..bd7434c Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/poloticsIcon 2.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/poloticsIcon@2x.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/poloticsIcon@2x.png new file mode 100644 index 0000000..6a92c32 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/politicsIcon.imageset/poloticsIcon@2x.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/Contents.json new file mode 100644 index 0000000..e8fa145 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "sportsIcon.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "sportsIcon@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/sportsIcon.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/sportsIcon.png new file mode 100644 index 0000000..9b871c8 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/sportsIcon.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/sportsIcon@2x.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/sportsIcon@2x.png new file mode 100644 index 0000000..0f51c57 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/sportsIcon.imageset/sportsIcon@2x.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/Contents.json b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/Contents.json new file mode 100644 index 0000000..3316e2d --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "techIcon.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "techIcon@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/techIcon.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/techIcon.png new file mode 100644 index 0000000..04e11ab Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/techIcon.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/techIcon@2x.png b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/techIcon@2x.png new file mode 100644 index 0000000..7e3fc91 Binary files /dev/null and b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Images.xcassets/techIcon.imageset/techIcon@2x.png differ diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Recipe 2-3 News App-Info.plist b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Recipe 2-3 News App-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Recipe 2-3 News App-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Recipe 2-3 News App-Prefix.pch b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Recipe 2-3 News App-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/Recipe 2-3 News App-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/ViewController.h b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/ViewController.h new file mode 100644 index 0000000..f2e42d8 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 2-3 News App +// +// Created by joseph hoffman on 7/2/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/ViewController.m b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/ViewController.m new file mode 100644 index 0000000..0e81cfa --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 2-3 News App +// +// Created by joseph hoffman on 7/2/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/en.lproj/InfoPlist.strings b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/main.m b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/main.m new file mode 100644 index 0000000..a032537 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News App/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 2-3: News App +// +// Created by joseph hoffman on 7/2/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/Recipe 2-3 News AppTests-Info.plist b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/Recipe 2-3 News AppTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/Recipe 2-3 News AppTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/Recipe_2_3__News_AppTests.m b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/Recipe_2_3__News_AppTests.m new file mode 100644 index 0000000..bcd416c --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/Recipe_2_3__News_AppTests.m @@ -0,0 +1,36 @@ +// +// Recipe_2_3__News_AppTests.m +// Recipe 2-3: News AppTests +// +// Created by joseph hoffman on 7/2/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_2_3__News_AppTests : XCTestCase + +@end + +@implementation Recipe_2_3__News_AppTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/en.lproj/InfoPlist.strings b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH2 - Storyboard Recipes/Recipe 2-3_ News App/Recipe 2-3_ News AppTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.pbxproj b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4333517 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 886F924317861C490066A7F7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886F924217861C490066A7F7 /* Foundation.framework */; }; + 886F924517861C490066A7F7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886F924417861C490066A7F7 /* CoreGraphics.framework */; }; + 886F924717861C490066A7F7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886F924617861C490066A7F7 /* UIKit.framework */; }; + 886F924D17861C490066A7F7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886F924B17861C490066A7F7 /* InfoPlist.strings */; }; + 886F924F17861C490066A7F7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 886F924E17861C490066A7F7 /* main.m */; }; + 886F925317861C490066A7F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 886F925217861C490066A7F7 /* AppDelegate.m */; }; + 886F925617861C490066A7F7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 886F925417861C490066A7F7 /* Main.storyboard */; }; + 886F925917861C490066A7F7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 886F925817861C490066A7F7 /* ViewController.m */; }; + 886F925B17861C490066A7F7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 886F925A17861C490066A7F7 /* Images.xcassets */; }; + 886F926217861C490066A7F7 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886F926117861C490066A7F7 /* XCTest.framework */; }; + 886F926317861C490066A7F7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886F924217861C490066A7F7 /* Foundation.framework */; }; + 886F926417861C490066A7F7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886F924617861C490066A7F7 /* UIKit.framework */; }; + 886F926C17861C4A0066A7F7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886F926A17861C4A0066A7F7 /* InfoPlist.strings */; }; + 886F926E17861C4A0066A7F7 /* Recipe_3_1___Using_AutolayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 886F926D17861C4A0066A7F7 /* Recipe_3_1___Using_AutolayoutTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 886F926517861C4A0066A7F7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 886F923717861C490066A7F7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 886F923E17861C490066A7F7; + remoteInfo = "Recipe 3-1 : Using Autolayout"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 886F923F17861C490066A7F7 /* Recipe 3-1 Using Autolayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 3-1 Using Autolayout.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886F924217861C490066A7F7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 886F924417861C490066A7F7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 886F924617861C490066A7F7 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 886F924A17861C490066A7F7 /* Recipe 3-1 Using Autolayout-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 3-1 Using Autolayout-Info.plist"; sourceTree = ""; }; + 886F924C17861C490066A7F7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886F924E17861C490066A7F7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 886F925017861C490066A7F7 /* Recipe 3-1 Using Autolayout-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 3-1 Using Autolayout-Prefix.pch"; sourceTree = ""; }; + 886F925117861C490066A7F7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 886F925217861C490066A7F7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 886F925517861C490066A7F7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 886F925717861C490066A7F7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 886F925817861C490066A7F7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 886F925A17861C490066A7F7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 886F926017861C490066A7F7 /* Recipe 3-1 Using AutolayoutTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 3-1 Using AutolayoutTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886F926117861C490066A7F7 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 886F926917861C4A0066A7F7 /* Recipe 3-1 Using AutolayoutTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 3-1 Using AutolayoutTests-Info.plist"; sourceTree = ""; }; + 886F926B17861C4A0066A7F7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886F926D17861C4A0066A7F7 /* Recipe_3_1___Using_AutolayoutTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Recipe_3_1___Using_AutolayoutTests.m"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 886F923C17861C490066A7F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886F924517861C490066A7F7 /* CoreGraphics.framework in Frameworks */, + 886F924717861C490066A7F7 /* UIKit.framework in Frameworks */, + 886F924317861C490066A7F7 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886F925D17861C490066A7F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886F926217861C490066A7F7 /* XCTest.framework in Frameworks */, + 886F926417861C490066A7F7 /* UIKit.framework in Frameworks */, + 886F926317861C490066A7F7 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 886F923617861C490066A7F7 = { + isa = PBXGroup; + children = ( + 886F924817861C490066A7F7 /* Recipe 3-1 Using Autolayout */, + 886F926717861C4A0066A7F7 /* Recipe 3-1 Using AutolayoutTests */, + 886F924117861C490066A7F7 /* Frameworks */, + 886F924017861C490066A7F7 /* Products */, + ); + sourceTree = ""; + }; + 886F924017861C490066A7F7 /* Products */ = { + isa = PBXGroup; + children = ( + 886F923F17861C490066A7F7 /* Recipe 3-1 Using Autolayout.app */, + 886F926017861C490066A7F7 /* Recipe 3-1 Using AutolayoutTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 886F924117861C490066A7F7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 886F924217861C490066A7F7 /* Foundation.framework */, + 886F924417861C490066A7F7 /* CoreGraphics.framework */, + 886F924617861C490066A7F7 /* UIKit.framework */, + 886F926117861C490066A7F7 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 886F924817861C490066A7F7 /* Recipe 3-1 Using Autolayout */ = { + isa = PBXGroup; + children = ( + 886F925117861C490066A7F7 /* AppDelegate.h */, + 886F925217861C490066A7F7 /* AppDelegate.m */, + 886F925417861C490066A7F7 /* Main.storyboard */, + 886F925717861C490066A7F7 /* ViewController.h */, + 886F925817861C490066A7F7 /* ViewController.m */, + 886F925A17861C490066A7F7 /* Images.xcassets */, + 886F924917861C490066A7F7 /* Supporting Files */, + ); + name = "Recipe 3-1 Using Autolayout"; + path = "Recipe 3-1 : Using Autolayout"; + sourceTree = ""; + }; + 886F924917861C490066A7F7 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886F924A17861C490066A7F7 /* Recipe 3-1 Using Autolayout-Info.plist */, + 886F924B17861C490066A7F7 /* InfoPlist.strings */, + 886F924E17861C490066A7F7 /* main.m */, + 886F925017861C490066A7F7 /* Recipe 3-1 Using Autolayout-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 886F926717861C4A0066A7F7 /* Recipe 3-1 Using AutolayoutTests */ = { + isa = PBXGroup; + children = ( + 886F926D17861C4A0066A7F7 /* Recipe_3_1___Using_AutolayoutTests.m */, + 886F926817861C4A0066A7F7 /* Supporting Files */, + ); + name = "Recipe 3-1 Using AutolayoutTests"; + path = "Recipe 3-1 : Using AutolayoutTests"; + sourceTree = ""; + }; + 886F926817861C4A0066A7F7 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886F926917861C4A0066A7F7 /* Recipe 3-1 Using AutolayoutTests-Info.plist */, + 886F926A17861C4A0066A7F7 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 886F923E17861C490066A7F7 /* Recipe 3-1 Using Autolayout */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886F927117861C4A0066A7F7 /* Build configuration list for PBXNativeTarget "Recipe 3-1 Using Autolayout" */; + buildPhases = ( + 886F923B17861C490066A7F7 /* Sources */, + 886F923C17861C490066A7F7 /* Frameworks */, + 886F923D17861C490066A7F7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 3-1 Using Autolayout"; + productName = "Recipe 3-1 : Using Autolayout"; + productReference = 886F923F17861C490066A7F7 /* Recipe 3-1 Using Autolayout.app */; + productType = "com.apple.product-type.application"; + }; + 886F925F17861C490066A7F7 /* Recipe 3-1 Using AutolayoutTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886F927417861C4A0066A7F7 /* Build configuration list for PBXNativeTarget "Recipe 3-1 Using AutolayoutTests" */; + buildPhases = ( + 886F925C17861C490066A7F7 /* Sources */, + 886F925D17861C490066A7F7 /* Frameworks */, + 886F925E17861C490066A7F7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 886F926617861C4A0066A7F7 /* PBXTargetDependency */, + ); + name = "Recipe 3-1 Using AutolayoutTests"; + productName = "Recipe 3-1 : Using AutolayoutTests"; + productReference = 886F926017861C490066A7F7 /* Recipe 3-1 Using AutolayoutTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 886F923717861C490066A7F7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 886F925F17861C490066A7F7 = { + TestTargetID = 886F923E17861C490066A7F7; + }; + }; + }; + buildConfigurationList = 886F923A17861C490066A7F7 /* Build configuration list for PBXProject "Recipe 3-1 Using Autolayout" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 886F923617861C490066A7F7; + productRefGroup = 886F924017861C490066A7F7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 886F923E17861C490066A7F7 /* Recipe 3-1 Using Autolayout */, + 886F925F17861C490066A7F7 /* Recipe 3-1 Using AutolayoutTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 886F923D17861C490066A7F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886F925B17861C490066A7F7 /* Images.xcassets in Resources */, + 886F924D17861C490066A7F7 /* InfoPlist.strings in Resources */, + 886F925617861C490066A7F7 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886F925E17861C490066A7F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886F926C17861C4A0066A7F7 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 886F923B17861C490066A7F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886F925917861C490066A7F7 /* ViewController.m in Sources */, + 886F925317861C490066A7F7 /* AppDelegate.m in Sources */, + 886F924F17861C490066A7F7 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886F925C17861C490066A7F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886F926E17861C4A0066A7F7 /* Recipe_3_1___Using_AutolayoutTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 886F926617861C4A0066A7F7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 886F923E17861C490066A7F7 /* Recipe 3-1 Using Autolayout */; + targetProxy = 886F926517861C4A0066A7F7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 886F924B17861C490066A7F7 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886F924C17861C490066A7F7 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 886F925417861C490066A7F7 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 886F925517861C490066A7F7 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 886F926A17861C4A0066A7F7 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886F926B17861C4A0066A7F7 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 886F926F17861C4A0066A7F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 886F927017861C4A0066A7F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 886F927217861C4A0066A7F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-1 : Using Autolayout/Recipe 3-1 Using Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 3-1 : Using Autolayout/Recipe 3-1 Using Autolayout-Info.plist"; + PRODUCT_NAME = "Recipe 3-1 Using Autolayout"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 886F927317861C4A0066A7F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-1 : Using Autolayout/Recipe 3-1 Using Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 3-1 : Using Autolayout/Recipe 3-1 Using Autolayout-Info.plist"; + PRODUCT_NAME = "Recipe 3-1 Using Autolayout"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 886F927517861C4A0066A7F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 3-1 : Using Autolayout.app/Recipe 3-1 : Using Autolayout"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-1 : Using Autolayout/Recipe 3-1 : Using Autolayout-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 3-1 : Using AutolayoutTests/Recipe 3-1 Using AutolayoutTests-Info.plist"; + PRODUCT_NAME = "Recipe 3-1 Using AutolayoutTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 886F927617861C4A0066A7F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 3-1 : Using Autolayout.app/Recipe 3-1 : Using Autolayout"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-1 : Using Autolayout/Recipe 3-1 : Using Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 3-1 : Using AutolayoutTests/Recipe 3-1 Using AutolayoutTests-Info.plist"; + PRODUCT_NAME = "Recipe 3-1 Using AutolayoutTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 886F923A17861C490066A7F7 /* Build configuration list for PBXProject "Recipe 3-1 Using Autolayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886F926F17861C4A0066A7F7 /* Debug */, + 886F927017861C4A0066A7F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886F927117861C4A0066A7F7 /* Build configuration list for PBXNativeTarget "Recipe 3-1 Using Autolayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886F927217861C4A0066A7F7 /* Debug */, + 886F927317861C4A0066A7F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886F927417861C4A0066A7F7 /* Build configuration list for PBXNativeTarget "Recipe 3-1 Using AutolayoutTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886F927517861C4A0066A7F7 /* Debug */, + 886F927617861C4A0066A7F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 886F923717861C490066A7F7 /* Project object */; +} diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..2567196 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0188c26 Binary files /dev/null and b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 3-1 _ Using Autolayout.xcscheme b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 3-1 _ Using Autolayout.xcscheme new file mode 100644 index 0000000..b456ab3 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 3-1 _ Using Autolayout.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..11afb8c --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 3-1 : Using Autolayout.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 886F923E17861C490066A7F7 + + primary + + + 886F925F17861C490066A7F7 + + primary + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/AppDelegate.h b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/AppDelegate.h new file mode 100644 index 0000000..1765079 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 3-1 Using Autolayout +// +// Created by joseph hoffman on 7/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/AppDelegate.m b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/AppDelegate.m new file mode 100644 index 0000000..a9af10b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 3-1 Using Autolayout +// +// Created by joseph hoffman on 7/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Base.lproj/Main.storyboard b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ab98ba5 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Base.lproj/Main.storyboard @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout-Info.plist b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout-Prefix.pch b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/Recipe 3-1 Using Autolayout-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/ViewController.h b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/ViewController.h new file mode 100644 index 0000000..f6023df --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 3-1 Using Autolayout +// +// Created by joseph hoffman on 7/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/ViewController.m b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/ViewController.m new file mode 100644 index 0000000..8b3445b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// Recipe 3-1 Using Autolayout +// +// Created by joseph hoffman on 7/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/en.lproj/InfoPlist.strings b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/main.m b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/main.m new file mode 100644 index 0000000..92e403a --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using Autolayout/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 3-1 : Using Autolayout +// +// Created by joseph hoffman on 7/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/Recipe 3-1 Using AutolayoutTests-Info.plist b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/Recipe 3-1 Using AutolayoutTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/Recipe 3-1 Using AutolayoutTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/Recipe_3_1___Using_AutolayoutTests.m b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/Recipe_3_1___Using_AutolayoutTests.m new file mode 100644 index 0000000..35aec88 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/Recipe_3_1___Using_AutolayoutTests.m @@ -0,0 +1,36 @@ +// +// Recipe_3_1___Using_AutolayoutTests.m +// Recipe 3-1 : Using AutolayoutTests +// +// Created by joseph hoffman on 7/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_3_1___Using_AutolayoutTests : XCTestCase + +@end + +@implementation Recipe_3_1___Using_AutolayoutTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/en.lproj/InfoPlist.strings b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-1 _ Using Autolayout/Recipe 3-1 _ Using AutolayoutTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.pbxproj b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.pbxproj new file mode 100644 index 0000000..48b8f3f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88008CC5178780CB00FE1058 /* sweflag.png in Resources */ = {isa = PBXBuildFile; fileRef = 88008CC4178780CB00FE1058 /* sweflag.png */; }; + 886519C317876CCF00DFCDE6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886519C217876CCF00DFCDE6 /* Foundation.framework */; }; + 886519C517876CCF00DFCDE6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886519C417876CCF00DFCDE6 /* CoreGraphics.framework */; }; + 886519C717876CCF00DFCDE6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886519C617876CCF00DFCDE6 /* UIKit.framework */; }; + 886519CD17876CCF00DFCDE6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886519CB17876CCF00DFCDE6 /* InfoPlist.strings */; }; + 886519CF17876CCF00DFCDE6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 886519CE17876CCF00DFCDE6 /* main.m */; }; + 886519D317876CCF00DFCDE6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 886519D217876CCF00DFCDE6 /* AppDelegate.m */; }; + 886519D617876CCF00DFCDE6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 886519D417876CCF00DFCDE6 /* Main.storyboard */; }; + 886519D917876CCF00DFCDE6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 886519D817876CCF00DFCDE6 /* ViewController.m */; }; + 886519DB17876CCF00DFCDE6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 886519DA17876CCF00DFCDE6 /* Images.xcassets */; }; + 886519E217876CCF00DFCDE6 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886519E117876CCF00DFCDE6 /* XCTest.framework */; }; + 886519E317876CCF00DFCDE6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886519C217876CCF00DFCDE6 /* Foundation.framework */; }; + 886519E417876CCF00DFCDE6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886519C617876CCF00DFCDE6 /* UIKit.framework */; }; + 886519EC17876CCF00DFCDE6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886519EA17876CCF00DFCDE6 /* InfoPlist.strings */; }; + 886519EE17876CCF00DFCDE6 /* Recipe_2_3__Coding_AutolayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 886519ED17876CCF00DFCDE6 /* Recipe_2_3__Coding_AutolayoutTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 886519E517876CCF00DFCDE6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 886519B717876CCF00DFCDE6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 886519BE17876CCF00DFCDE6; + remoteInfo = "Recipe 2-3: Coding Autolayout"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88008CC4178780CB00FE1058 /* sweflag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sweflag.png; sourceTree = ""; }; + 886519BF17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 2-3 Coding Autolayout.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886519C217876CCF00DFCDE6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 886519C417876CCF00DFCDE6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 886519C617876CCF00DFCDE6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 886519CA17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 2-3 Coding Autolayout-Info.plist"; sourceTree = ""; }; + 886519CC17876CCF00DFCDE6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886519CE17876CCF00DFCDE6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 886519D017876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 2-3 Coding Autolayout-Prefix.pch"; sourceTree = ""; }; + 886519D117876CCF00DFCDE6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 886519D217876CCF00DFCDE6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 886519D517876CCF00DFCDE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 886519D717876CCF00DFCDE6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 886519D817876CCF00DFCDE6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 886519DA17876CCF00DFCDE6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 886519E017876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 2-3 Coding AutolayoutTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886519E117876CCF00DFCDE6 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 886519E917876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 2-3 Coding AutolayoutTests-Info.plist"; sourceTree = ""; }; + 886519EB17876CCF00DFCDE6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886519ED17876CCF00DFCDE6 /* Recipe_2_3__Coding_AutolayoutTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_2_3__Coding_AutolayoutTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 886519BC17876CCF00DFCDE6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886519C517876CCF00DFCDE6 /* CoreGraphics.framework in Frameworks */, + 886519C717876CCF00DFCDE6 /* UIKit.framework in Frameworks */, + 886519C317876CCF00DFCDE6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886519DD17876CCF00DFCDE6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886519E217876CCF00DFCDE6 /* XCTest.framework in Frameworks */, + 886519E417876CCF00DFCDE6 /* UIKit.framework in Frameworks */, + 886519E317876CCF00DFCDE6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 886519B617876CCF00DFCDE6 = { + isa = PBXGroup; + children = ( + 886519C817876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout */, + 886519E717876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests */, + 886519C117876CCF00DFCDE6 /* Frameworks */, + 886519C017876CCF00DFCDE6 /* Products */, + ); + sourceTree = ""; + }; + 886519C017876CCF00DFCDE6 /* Products */ = { + isa = PBXGroup; + children = ( + 886519BF17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout.app */, + 886519E017876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 886519C117876CCF00DFCDE6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 886519C217876CCF00DFCDE6 /* Foundation.framework */, + 886519C417876CCF00DFCDE6 /* CoreGraphics.framework */, + 886519C617876CCF00DFCDE6 /* UIKit.framework */, + 886519E117876CCF00DFCDE6 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 886519C817876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout */ = { + isa = PBXGroup; + children = ( + 886519D117876CCF00DFCDE6 /* AppDelegate.h */, + 886519D217876CCF00DFCDE6 /* AppDelegate.m */, + 886519D417876CCF00DFCDE6 /* Main.storyboard */, + 886519D717876CCF00DFCDE6 /* ViewController.h */, + 886519D817876CCF00DFCDE6 /* ViewController.m */, + 886519DA17876CCF00DFCDE6 /* Images.xcassets */, + 886519C917876CCF00DFCDE6 /* Supporting Files */, + ); + name = "Recipe 2-3 Coding Autolayout"; + path = "Recipe 2-3: Coding Autolayout"; + sourceTree = ""; + }; + 886519C917876CCF00DFCDE6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88008CC4178780CB00FE1058 /* sweflag.png */, + 886519CA17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout-Info.plist */, + 886519CB17876CCF00DFCDE6 /* InfoPlist.strings */, + 886519CE17876CCF00DFCDE6 /* main.m */, + 886519D017876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 886519E717876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests */ = { + isa = PBXGroup; + children = ( + 886519ED17876CCF00DFCDE6 /* Recipe_2_3__Coding_AutolayoutTests.m */, + 886519E817876CCF00DFCDE6 /* Supporting Files */, + ); + name = "Recipe 2-3 Coding AutolayoutTests"; + path = "Recipe 2-3: Coding AutolayoutTests"; + sourceTree = ""; + }; + 886519E817876CCF00DFCDE6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886519E917876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests-Info.plist */, + 886519EA17876CCF00DFCDE6 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 886519BE17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886519F117876CCF00DFCDE6 /* Build configuration list for PBXNativeTarget "Recipe 2-3 Coding Autolayout" */; + buildPhases = ( + 886519BB17876CCF00DFCDE6 /* Sources */, + 886519BC17876CCF00DFCDE6 /* Frameworks */, + 886519BD17876CCF00DFCDE6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 2-3 Coding Autolayout"; + productName = "Recipe 2-3: Coding Autolayout"; + productReference = 886519BF17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout.app */; + productType = "com.apple.product-type.application"; + }; + 886519DF17876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886519F417876CCF00DFCDE6 /* Build configuration list for PBXNativeTarget "Recipe 2-3 Coding AutolayoutTests" */; + buildPhases = ( + 886519DC17876CCF00DFCDE6 /* Sources */, + 886519DD17876CCF00DFCDE6 /* Frameworks */, + 886519DE17876CCF00DFCDE6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 886519E617876CCF00DFCDE6 /* PBXTargetDependency */, + ); + name = "Recipe 2-3 Coding AutolayoutTests"; + productName = "Recipe 2-3: Coding AutolayoutTests"; + productReference = 886519E017876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 886519B717876CCF00DFCDE6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 886519DF17876CCF00DFCDE6 = { + TestTargetID = 886519BE17876CCF00DFCDE6; + }; + }; + }; + buildConfigurationList = 886519BA17876CCF00DFCDE6 /* Build configuration list for PBXProject "Recipe 2-3 Coding Autolayout" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 886519B617876CCF00DFCDE6; + productRefGroup = 886519C017876CCF00DFCDE6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 886519BE17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout */, + 886519DF17876CCF00DFCDE6 /* Recipe 2-3 Coding AutolayoutTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 886519BD17876CCF00DFCDE6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886519DB17876CCF00DFCDE6 /* Images.xcassets in Resources */, + 886519CD17876CCF00DFCDE6 /* InfoPlist.strings in Resources */, + 886519D617876CCF00DFCDE6 /* Main.storyboard in Resources */, + 88008CC5178780CB00FE1058 /* sweflag.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886519DE17876CCF00DFCDE6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886519EC17876CCF00DFCDE6 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 886519BB17876CCF00DFCDE6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886519D917876CCF00DFCDE6 /* ViewController.m in Sources */, + 886519D317876CCF00DFCDE6 /* AppDelegate.m in Sources */, + 886519CF17876CCF00DFCDE6 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886519DC17876CCF00DFCDE6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886519EE17876CCF00DFCDE6 /* Recipe_2_3__Coding_AutolayoutTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 886519E617876CCF00DFCDE6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 886519BE17876CCF00DFCDE6 /* Recipe 2-3 Coding Autolayout */; + targetProxy = 886519E517876CCF00DFCDE6 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 886519CB17876CCF00DFCDE6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886519CC17876CCF00DFCDE6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 886519D417876CCF00DFCDE6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 886519D517876CCF00DFCDE6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 886519EA17876CCF00DFCDE6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886519EB17876CCF00DFCDE6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 886519EF17876CCF00DFCDE6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 886519F017876CCF00DFCDE6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 886519F217876CCF00DFCDE6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: Coding Autolayout/Recipe 2-3 Coding Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-3: Coding Autolayout/Recipe 2-3 Coding Autolayout-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 Coding Autolayout"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 886519F317876CCF00DFCDE6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: Coding Autolayout/Recipe 2-3 Coding Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-3: Coding Autolayout/Recipe 2-3 Coding Autolayout-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 Coding Autolayout"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 886519F517876CCF00DFCDE6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 2-3: Coding Autolayout.app/Recipe 2-3: Coding Autolayout"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: Coding Autolayout/Recipe 2-3: Coding Autolayout-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 2-3: Coding AutolayoutTests/Recipe 2-3 Coding AutolayoutTests-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 Coding AutolayoutTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 886519F617876CCF00DFCDE6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 2-3: Coding Autolayout.app/Recipe 2-3: Coding Autolayout"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 2-3: Coding Autolayout/Recipe 2-3: Coding Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 2-3: Coding AutolayoutTests/Recipe 2-3 Coding AutolayoutTests-Info.plist"; + PRODUCT_NAME = "Recipe 2-3 Coding AutolayoutTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 886519BA17876CCF00DFCDE6 /* Build configuration list for PBXProject "Recipe 2-3 Coding Autolayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886519EF17876CCF00DFCDE6 /* Debug */, + 886519F017876CCF00DFCDE6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886519F117876CCF00DFCDE6 /* Build configuration list for PBXNativeTarget "Recipe 2-3 Coding Autolayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886519F217876CCF00DFCDE6 /* Debug */, + 886519F317876CCF00DFCDE6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886519F417876CCF00DFCDE6 /* Build configuration list for PBXNativeTarget "Recipe 2-3 Coding AutolayoutTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886519F517876CCF00DFCDE6 /* Debug */, + 886519F617876CCF00DFCDE6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 886519B717876CCF00DFCDE6 /* Project object */; +} diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9844fc9 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..43d62c6 Binary files /dev/null and b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..1e04784 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-3 Coding Autolayout.xcscheme b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-3 Coding Autolayout.xcscheme new file mode 100644 index 0000000..21c4c02 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 2-3 Coding Autolayout.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..816ecae --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3 Coding Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 2-3 Coding Autolayout.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 886519BE17876CCF00DFCDE6 + + primary + + + 886519DF17876CCF00DFCDE6 + + primary + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/AppDelegate.h b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/AppDelegate.h new file mode 100644 index 0000000..1693a2b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 2-3: Coding Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/AppDelegate.m b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/AppDelegate.m new file mode 100644 index 0000000..ba7237b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 2-3: Coding Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Base.lproj/Main.storyboard b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b99208b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/Image-1.imageset/Contents.json b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/Image-1.imageset/Contents.json new file mode 100644 index 0000000..8a4ea0b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/Image-1.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/Image.imageset/Contents.json b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/Image.imageset/Contents.json new file mode 100644 index 0000000..8a4ea0b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/Image.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Recipe 2-3 Coding Autolayout-Info.plist b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Recipe 2-3 Coding Autolayout-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Recipe 2-3 Coding Autolayout-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Recipe 2-3 Coding Autolayout-Prefix.pch b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Recipe 2-3 Coding Autolayout-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/Recipe 2-3 Coding Autolayout-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/ViewController.h b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/ViewController.h new file mode 100644 index 0000000..9bd7d49 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 2-3: Coding Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) UIButton *addButton; +@property (strong, nonatomic) UIButton *removeButton; +@property (strong, nonatomic) UIButton *clearButton; +@property (strong, nonatomic) NSMutableArray *imageViews; +@property (strong, nonatomic) NSMutableArray *imageViewConstraints; + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/ViewController.m b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/ViewController.m new file mode 100644 index 0000000..0123a2f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/ViewController.m @@ -0,0 +1,167 @@ +// +// ViewController.m +// Recipe 2-3: Coding Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.addButton = [self addButtonWithTitle:@"Add" action:@selector(addImageView)]; + self.removeButton = [self addButtonWithTitle:@"Remove" action:@selector(removeImageView)]; + self.clearButton = [self addButtonWithTitle:@"Clear" action:@selector(clearImageViews)]; + + NSDictionary *viewsDictionary = + [[NSDictionary alloc] initWithObjectsAndKeys: + self.addButton, @"addButton", + self.removeButton, @"removeButton", + self.clearButton, @"clearButton", nil]; + + [self.view addConstraints:[NSLayoutConstraint + constraintsWithVisualFormat:@"H:|-[addButton]-[removeButton]-[clearButton]" + options:0 metrics:nil views:viewsDictionary]]; + + [self.view addConstraints:[NSLayoutConstraint + constraintsWithVisualFormat:@"V:|-[addButton]" + options:0 metrics:nil views:viewsDictionary]]; + [self.view addConstraints:[NSLayoutConstraint + constraintsWithVisualFormat:@"V:|-[removeButton]" + options:0 metrics:nil views:viewsDictionary]]; + [self.view addConstraints:[NSLayoutConstraint + constraintsWithVisualFormat:@"V:|-[clearButton]" + options:0 metrics:nil views:viewsDictionary]]; + + self.imageViews = [[NSMutableArray alloc]initWithCapacity:10]; + self.imageViewConstraints = [[NSMutableArray alloc]initWithCapacity:10]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (UIButton *)addButtonWithTitle:(NSString *)title action:(SEL)selector +{ + UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; + [button setTitle:title forState:UIControlStateNormal]; + [button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside]; + button.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:button]; + return button; +} +- (void)addImageView +{ + UIImage *image = [UIImage imageNamed:@"sweflag"]; + UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; + [self.view addSubview:imageView]; + imageView.translatesAutoresizingMaskIntoConstraints = NO; + [self.imageViews addObject:imageView]; + + [self rebuildImageViewsConstraints]; +} + +- (void)removeImageView +{ + if (self.imageViews.count > 0) + { + [self.imageViews.lastObject removeFromSuperview]; + [self.imageViews removeLastObject]; + [self rebuildImageViewsConstraints]; + } +} + +- (void)clearImageViews +{ + if (self.imageViews.count > 0) + { + for (int i=self.imageViews.count - 1; i >= 0; i--) + { + UIImageView *imageView = [self.imageViews objectAtIndex:i]; + [imageView removeFromSuperview]; + [self.imageViews removeObjectAtIndex:i]; + } + + [self rebuildImageViewsConstraints]; + } +} +- (void)rebuildImageViewsConstraints +{ + [self.view removeConstraints:self.imageViewConstraints]; + [self.imageViewConstraints removeAllObjects]; + + if (self.imageViews.count == 0) + return; + + UIImageView *firstImageView = [self.imageViews objectAtIndex:0]; + + // Pin first view to the top left corner + NSDictionary *viewsDictionary = + [[NSDictionary alloc] initWithObjectsAndKeys: + self.addButton, @"firstButton", + firstImageView, @"firstImageView", nil]; + + [self.imageViewConstraints addObjectsFromArray:[NSLayoutConstraint + constraintsWithVisualFormat:@"H:|-[firstImageView(50)]" + options:0 metrics:nil views:viewsDictionary]]; + + [self.imageViewConstraints addObjectsFromArray:[NSLayoutConstraint + constraintsWithVisualFormat:@"V:[firstButton]-[firstImageView(50)]" + options:0 metrics:nil views:viewsDictionary]]; + + if (self.imageViews.count > 1) + { + UIImageView *previousImageView = firstImageView; + + for (int i=1; i < self.imageViews.count; i++) + { + UIImageView *imageView = [self.imageViews objectAtIndex:i]; + + [self.imageViewConstraints addObject:[NSLayoutConstraint + constraintWithItem:imageView attribute:NSLayoutAttributeLeading + relatedBy:NSLayoutRelationEqual + toItem:previousImageView attribute:NSLayoutAttributeLeading + multiplier:1 constant:10]]; + + [self.imageViewConstraints addObject:[NSLayoutConstraint + constraintWithItem:imageView attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:previousImageView attribute:NSLayoutAttributeTop + multiplier:1 constant:10]]; + + [self.imageViewConstraints addObject:[NSLayoutConstraint + constraintWithItem:imageView attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem:previousImageView attribute:NSLayoutAttributeWidth + multiplier:1.1 constant:0]]; + + [self.imageViewConstraints addObject:[NSLayoutConstraint + constraintWithItem:imageView attribute:NSLayoutAttributeHeight + relatedBy:NSLayoutRelationEqual + toItem:previousImageView attribute:NSLayoutAttributeHeight + multiplier:1.1 constant:0]]; + + previousImageView = imageView; + } + + } + + [self.view addConstraints:self.imageViewConstraints]; +} + + + + + + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/en.lproj/InfoPlist.strings b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/main.m b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/main.m new file mode 100644 index 0000000..c3413c2 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 2-3: Coding Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/sweflag.png b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/sweflag.png new file mode 100644 index 0000000..0caea98 Binary files /dev/null and b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding Autolayout/sweflag.png differ diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/Recipe 2-3 Coding AutolayoutTests-Info.plist b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/Recipe 2-3 Coding AutolayoutTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/Recipe 2-3 Coding AutolayoutTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/Recipe_2_3__Coding_AutolayoutTests.m b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/Recipe_2_3__Coding_AutolayoutTests.m new file mode 100644 index 0000000..686fcfa --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/Recipe_2_3__Coding_AutolayoutTests.m @@ -0,0 +1,36 @@ +// +// Recipe_2_3__Coding_AutolayoutTests.m +// Recipe 2-3: Coding AutolayoutTests +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_2_3__Coding_AutolayoutTests : XCTestCase + +@end + +@implementation Recipe_2_3__Coding_AutolayoutTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/en.lproj/InfoPlist.strings b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-2_ Coding Autolayout/Recipe 2-3_ Coding AutolayoutTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.pbxproj b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d3ff3bc --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88D109321787875B007C488A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D109311787875B007C488A /* Foundation.framework */; }; + 88D109341787875B007C488A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D109331787875B007C488A /* CoreGraphics.framework */; }; + 88D109361787875B007C488A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D109351787875B007C488A /* UIKit.framework */; }; + 88D1093C1787875B007C488A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88D1093A1787875B007C488A /* InfoPlist.strings */; }; + 88D1093E1787875B007C488A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D1093D1787875B007C488A /* main.m */; }; + 88D109421787875B007C488A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D109411787875B007C488A /* AppDelegate.m */; }; + 88D109451787875B007C488A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88D109431787875B007C488A /* Main.storyboard */; }; + 88D109481787875B007C488A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D109471787875B007C488A /* ViewController.m */; }; + 88D1094A1787875B007C488A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88D109491787875B007C488A /* Images.xcassets */; }; + 88D109511787875B007C488A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D109501787875B007C488A /* XCTest.framework */; }; + 88D109521787875B007C488A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D109311787875B007C488A /* Foundation.framework */; }; + 88D109531787875B007C488A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D109351787875B007C488A /* UIKit.framework */; }; + 88D1095B1787875B007C488A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88D109591787875B007C488A /* InfoPlist.strings */; }; + 88D1095D1787875B007C488A /* Recipe_3_3__Debugging_AutolayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D1095C1787875B007C488A /* Recipe_3_3__Debugging_AutolayoutTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88D109541787875B007C488A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88D109261787875B007C488A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88D1092D1787875B007C488A; + remoteInfo = "Recipe 3-3: Debugging Autolayout"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88D1092E1787875B007C488A /* Recipe 3-3 Debugging Autolayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 3-3 Debugging Autolayout.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88D109311787875B007C488A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88D109331787875B007C488A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88D109351787875B007C488A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88D109391787875B007C488A /* Recipe 3-3 Debugging Autolayout-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 3-3 Debugging Autolayout-Info.plist"; sourceTree = ""; }; + 88D1093B1787875B007C488A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88D1093D1787875B007C488A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88D1093F1787875B007C488A /* Recipe 3-3 Debugging Autolayout-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 3-3 Debugging Autolayout-Prefix.pch"; sourceTree = ""; }; + 88D109401787875B007C488A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88D109411787875B007C488A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88D109441787875B007C488A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88D109461787875B007C488A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88D109471787875B007C488A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88D109491787875B007C488A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88D1094F1787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 3-3 Debugging AutolayoutTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88D109501787875B007C488A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88D109581787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 3-3 Debugging AutolayoutTests-Info.plist"; sourceTree = ""; }; + 88D1095A1787875B007C488A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88D1095C1787875B007C488A /* Recipe_3_3__Debugging_AutolayoutTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_3_3__Debugging_AutolayoutTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88D1092B1787875B007C488A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D109341787875B007C488A /* CoreGraphics.framework in Frameworks */, + 88D109361787875B007C488A /* UIKit.framework in Frameworks */, + 88D109321787875B007C488A /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88D1094C1787875B007C488A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D109511787875B007C488A /* XCTest.framework in Frameworks */, + 88D109531787875B007C488A /* UIKit.framework in Frameworks */, + 88D109521787875B007C488A /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88D109251787875B007C488A = { + isa = PBXGroup; + children = ( + 88D109371787875B007C488A /* Recipe 3-3 Debugging Autolayout */, + 88D109561787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests */, + 88D109301787875B007C488A /* Frameworks */, + 88D1092F1787875B007C488A /* Products */, + ); + sourceTree = ""; + }; + 88D1092F1787875B007C488A /* Products */ = { + isa = PBXGroup; + children = ( + 88D1092E1787875B007C488A /* Recipe 3-3 Debugging Autolayout.app */, + 88D1094F1787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88D109301787875B007C488A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88D109311787875B007C488A /* Foundation.framework */, + 88D109331787875B007C488A /* CoreGraphics.framework */, + 88D109351787875B007C488A /* UIKit.framework */, + 88D109501787875B007C488A /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88D109371787875B007C488A /* Recipe 3-3 Debugging Autolayout */ = { + isa = PBXGroup; + children = ( + 88D109401787875B007C488A /* AppDelegate.h */, + 88D109411787875B007C488A /* AppDelegate.m */, + 88D109431787875B007C488A /* Main.storyboard */, + 88D109461787875B007C488A /* ViewController.h */, + 88D109471787875B007C488A /* ViewController.m */, + 88D109491787875B007C488A /* Images.xcassets */, + 88D109381787875B007C488A /* Supporting Files */, + ); + name = "Recipe 3-3 Debugging Autolayout"; + path = "Recipe 3-3: Debugging Autolayout"; + sourceTree = ""; + }; + 88D109381787875B007C488A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88D109391787875B007C488A /* Recipe 3-3 Debugging Autolayout-Info.plist */, + 88D1093A1787875B007C488A /* InfoPlist.strings */, + 88D1093D1787875B007C488A /* main.m */, + 88D1093F1787875B007C488A /* Recipe 3-3 Debugging Autolayout-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88D109561787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests */ = { + isa = PBXGroup; + children = ( + 88D1095C1787875B007C488A /* Recipe_3_3__Debugging_AutolayoutTests.m */, + 88D109571787875B007C488A /* Supporting Files */, + ); + name = "Recipe 3-3 Debugging AutolayoutTests"; + path = "Recipe 3-3: Debugging AutolayoutTests"; + sourceTree = ""; + }; + 88D109571787875B007C488A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88D109581787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests-Info.plist */, + 88D109591787875B007C488A /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88D1092D1787875B007C488A /* Recipe 3-3 Debugging Autolayout */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88D109601787875B007C488A /* Build configuration list for PBXNativeTarget "Recipe 3-3 Debugging Autolayout" */; + buildPhases = ( + 88D1092A1787875B007C488A /* Sources */, + 88D1092B1787875B007C488A /* Frameworks */, + 88D1092C1787875B007C488A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 3-3 Debugging Autolayout"; + productName = "Recipe 3-3: Debugging Autolayout"; + productReference = 88D1092E1787875B007C488A /* Recipe 3-3 Debugging Autolayout.app */; + productType = "com.apple.product-type.application"; + }; + 88D1094E1787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88D109631787875B007C488A /* Build configuration list for PBXNativeTarget "Recipe 3-3 Debugging AutolayoutTests" */; + buildPhases = ( + 88D1094B1787875B007C488A /* Sources */, + 88D1094C1787875B007C488A /* Frameworks */, + 88D1094D1787875B007C488A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88D109551787875B007C488A /* PBXTargetDependency */, + ); + name = "Recipe 3-3 Debugging AutolayoutTests"; + productName = "Recipe 3-3: Debugging AutolayoutTests"; + productReference = 88D1094F1787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88D109261787875B007C488A /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88D1094E1787875B007C488A = { + TestTargetID = 88D1092D1787875B007C488A; + }; + }; + }; + buildConfigurationList = 88D109291787875B007C488A /* Build configuration list for PBXProject "Recipe 3-3 Debugging Autolayout" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88D109251787875B007C488A; + productRefGroup = 88D1092F1787875B007C488A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88D1092D1787875B007C488A /* Recipe 3-3 Debugging Autolayout */, + 88D1094E1787875B007C488A /* Recipe 3-3 Debugging AutolayoutTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88D1092C1787875B007C488A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D1094A1787875B007C488A /* Images.xcassets in Resources */, + 88D1093C1787875B007C488A /* InfoPlist.strings in Resources */, + 88D109451787875B007C488A /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88D1094D1787875B007C488A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D1095B1787875B007C488A /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88D1092A1787875B007C488A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D109481787875B007C488A /* ViewController.m in Sources */, + 88D109421787875B007C488A /* AppDelegate.m in Sources */, + 88D1093E1787875B007C488A /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88D1094B1787875B007C488A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D1095D1787875B007C488A /* Recipe_3_3__Debugging_AutolayoutTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88D109551787875B007C488A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88D1092D1787875B007C488A /* Recipe 3-3 Debugging Autolayout */; + targetProxy = 88D109541787875B007C488A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88D1093A1787875B007C488A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88D1093B1787875B007C488A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88D109431787875B007C488A /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88D109441787875B007C488A /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88D109591787875B007C488A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88D1095A1787875B007C488A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88D1095E1787875B007C488A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88D1095F1787875B007C488A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88D109611787875B007C488A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-3: Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 3-3: Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Info.plist"; + PRODUCT_NAME = "Recipe 3-3 Debugging Autolayout"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88D109621787875B007C488A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-3: Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 3-3: Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Info.plist"; + PRODUCT_NAME = "Recipe 3-3 Debugging Autolayout"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88D109641787875B007C488A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 3-3: Debugging Autolayout.app/Recipe 3-3: Debugging Autolayout"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-3: Debugging Autolayout/Recipe 3-3: Debugging Autolayout-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 3-3: Debugging AutolayoutTests/Recipe 3-3 Debugging AutolayoutTests-Info.plist"; + PRODUCT_NAME = "Recipe 3-3 Debugging AutolayoutTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88D109651787875B007C488A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 3-3: Debugging Autolayout.app/Recipe 3-3: Debugging Autolayout"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 3-3: Debugging Autolayout/Recipe 3-3: Debugging Autolayout-Prefix.pch"; + INFOPLIST_FILE = "Recipe 3-3: Debugging AutolayoutTests/Recipe 3-3 Debugging AutolayoutTests-Info.plist"; + PRODUCT_NAME = "Recipe 3-3 Debugging AutolayoutTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88D109291787875B007C488A /* Build configuration list for PBXProject "Recipe 3-3 Debugging Autolayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88D1095E1787875B007C488A /* Debug */, + 88D1095F1787875B007C488A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88D109601787875B007C488A /* Build configuration list for PBXNativeTarget "Recipe 3-3 Debugging Autolayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88D109611787875B007C488A /* Debug */, + 88D109621787875B007C488A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88D109631787875B007C488A /* Build configuration list for PBXNativeTarget "Recipe 3-3 Debugging AutolayoutTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88D109641787875B007C488A /* Debug */, + 88D109651787875B007C488A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88D109261787875B007C488A /* Project object */; +} diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9f42174 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..4b09641 Binary files /dev/null and b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 3-3_ Debugging Autolayout.xcscheme b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 3-3_ Debugging Autolayout.xcscheme new file mode 100644 index 0000000..47d4f3e --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 3-3_ Debugging Autolayout.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d4f5e61 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 3-3: Debugging Autolayout.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88D1092D1787875B007C488A + + primary + + + 88D1094E1787875B007C488A + + primary + + + + + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/AppDelegate.h b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/AppDelegate.h new file mode 100644 index 0000000..c0d74ba --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 3-3: Debugging Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/AppDelegate.m b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/AppDelegate.m new file mode 100644 index 0000000..92a2e9e --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 3-3: Debugging Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Base.lproj/Main.storyboard b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b99208b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Info.plist b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Prefix.pch b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/Recipe 3-3 Debugging Autolayout-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/ViewController.h b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/ViewController.h new file mode 100644 index 0000000..975375b --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 3-3: Debugging Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/ViewController.m b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/ViewController.m new file mode 100644 index 0000000..c87779d --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/ViewController.m @@ -0,0 +1,79 @@ +// +// ViewController.m +// Recipe 3-3: Debugging Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [button1 setTitle:@"Button 1" forState:UIControlStateNormal]; + button1.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:button1]; + + UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [button2 setTitle:@"Button 2" forState:UIControlStateNormal]; + button2.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:button2]; + + UIButton *button3 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [button3 setTitle:@"Button 3" forState:UIControlStateNormal]; + button3.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:button3]; + + NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(button1, button2, button3); + + [self.view addConstraints: + [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[button1]" options:0 metrics:nil views:viewsDictionary]]; + [self.view addConstraints: + [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[button2]" options:0 metrics:nil views:viewsDictionary]]; + [self.view addConstraints: + [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[button3]" options:0 metrics:nil views:viewsDictionary]]; + + [self.view addConstraints:[NSLayoutConstraint + constraintsWithVisualFormat:@"[button1(<=100)]-[button2(==button1)]-[button3(==button1)]" + options:0 metrics:nil views:viewsDictionary]]; + + NSLayoutConstraint *pinToLeft = [NSLayoutConstraint + constraintWithItem:button1 attribute:NSLayoutAttributeLeading + relatedBy:NSLayoutRelationEqual + toItem:self.view attribute:NSLayoutAttributeLeading + multiplier:1 constant:20]; + pinToLeft.priority = 500; + [self.view addConstraint:pinToLeft]; + + NSLayoutConstraint *pinToRight = [NSLayoutConstraint + constraintWithItem:button3 attribute:NSLayoutAttributeTrailing + relatedBy:NSLayoutRelationEqual + toItem:self.view attribute:NSLayoutAttributeTrailing + multiplier:1 constant:20]; + pinToRight.priority = 500; + [self.view addConstraint:pinToRight]; + + NSLayoutConstraint *center = [NSLayoutConstraint + constraintWithItem:button2 attribute:NSLayoutAttributeCenterX + relatedBy:NSLayoutRelationEqual + toItem:self.view attribute:NSLayoutAttributeCenterX + multiplier:1 constant:0]; + [self.view addConstraint:center]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/en.lproj/InfoPlist.strings b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/main.m b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/main.m new file mode 100644 index 0000000..c229686 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging Autolayout/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 3-3: Debugging Autolayout +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/Recipe 3-3 Debugging AutolayoutTests-Info.plist b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/Recipe 3-3 Debugging AutolayoutTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/Recipe 3-3 Debugging AutolayoutTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/Recipe_3_3__Debugging_AutolayoutTests.m b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/Recipe_3_3__Debugging_AutolayoutTests.m new file mode 100644 index 0000000..7c3be55 --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/Recipe_3_3__Debugging_AutolayoutTests.m @@ -0,0 +1,36 @@ +// +// Recipe_3_3__Debugging_AutolayoutTests.m +// Recipe 3-3: Debugging AutolayoutTests +// +// Created by joseph hoffman on 7/5/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_3_3__Debugging_AutolayoutTests : XCTestCase + +@end + +@implementation Recipe_3_3__Debugging_AutolayoutTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/en.lproj/InfoPlist.strings b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH3 - Layout Recipes/Recipe 3-3_ Debugging Autolayout/Recipe 3-3_ Debugging AutolayoutTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Country.h b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Country.h new file mode 100644 index 0000000..a153046 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Country.h @@ -0,0 +1,18 @@ +// +// Country.h +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Country : NSObject + +@property (nonatomic, strong) NSString *name; +@property (nonatomic, strong) NSString *capital; +@property (nonatomic, strong) NSString *motto; +@property (nonatomic, strong) UIImage *flag; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Country.m b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Country.m new file mode 100644 index 0000000..47e9dec --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Country.m @@ -0,0 +1,13 @@ +// +// Country.m +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "Country.h" + +@implementation Country + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryCell.h b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryCell.h new file mode 100644 index 0000000..aaa6d68 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryCell.h @@ -0,0 +1,16 @@ +// +// CountryCell.h +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "Country.h" + +@interface CountryCell : UITableViewCell + +@property (strong,nonatomic) Country *country; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryCell.m b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryCell.m new file mode 100644 index 0000000..7eed73f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryCell.m @@ -0,0 +1,47 @@ +// +// CountryCell.m +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "CountryCell.h" + +@implementation CountryCell + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + self.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; + self.textLabel.font = [UIFont systemFontOfSize:19.0]; + self.detailTextLabel.font = [UIFont systemFontOfSize:12]; + } + return self; +} + ++ (UIImage *)scale:(UIImage *)image toSize:(CGSize)size +{ + UIGraphicsBeginImageContext(size); + [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; + UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return scaledImage; +} + +- (void)setCountry:(Country *)country +{ + if (country != _country) + { + _country = country; + self.textLabel.text = _country.name; + self.detailTextLabel.text = _country.capital; + self.imageView.image = + [CountryCell scale: _country.flag toSize:CGSizeMake(115, 75)]; + } +} + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.h b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.h new file mode 100644 index 0000000..5d7632c --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.h @@ -0,0 +1,30 @@ +// +// CountryDetailsViewsController.h +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "Country.h" + +/* Forward declaration needed for the protocol to use + the CountryDetailsViewController type */ +@class CountryDetailsViewController; + +@protocol CountryDetailsViewControllerDelegate +-(void)countryDetailsViewControllerDidFinish:(CountryDetailsViewController *)sender; +@end + +@interface CountryDetailsViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UITextField *capitalTextField; +@property (weak, nonatomic) IBOutlet UITextField *mottoTextField; +@property (weak, nonatomic) IBOutlet UIImageView *flagImageView; + +@property (strong, nonatomic) Country *currentCountry; +@property (strong, nonatomic) id delegate; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.m b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.m new file mode 100644 index 0000000..dabac6f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.m @@ -0,0 +1,86 @@ +// +// CountryDetailsViewsControllerViewController.m +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "CountryDetailsViewController.h" + +@interface CountryDetailsViewController () + +@end + +@implementation CountryDetailsViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +-(void)viewWillAppear:(BOOL)animated +{ + [self populateViewWithCountry:self.currentCountry]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + self.mottoTextField.delegate = self; + self.capitalTextField.delegate = self; + + UIBarButtonItem *revertButton = + [[UIBarButtonItem alloc] initWithTitle:@"Revert" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(revert)]; + + self.navigationItem.rightBarButtonItems = + [NSArray arrayWithObject:revertButton]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(void)populateViewWithCountry:(Country *)country +{ + self.currentCountry = country; + + self.flagImageView.image = country.flag; + self.nameLabel.text = country.name; + self.capitalTextField.text = country.capital; + self.mottoTextField.text = country.motto; +} + +-(BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} +-(void)revert +{ + [self populateViewWithCountry:self.currentCountry]; +} + +-(void)viewWillDisappear:(BOOL)animated +{ + // End any editing that may be in progress at this point + [self.view.window endEditing: YES]; + + // Update the country object with the new values + self.currentCountry.capital = self.capitalTextField.text; + self.currentCountry.motto = self.mottoTextField.text; + [self.delegate countryDetailsViewControllerDidFinish:self]; +} + + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.xib b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.xib new file mode 100644 index 0000000..e381f41 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/CountryDetailsViewController.xib @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.h b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.h new file mode 100644 index 0000000..655344b --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.h @@ -0,0 +1,27 @@ +// +// MainTableViewController.h +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "Country.h" +#import "CountryDetailsViewController.h" + +@interface MainTableViewController : UIViewController +{ + + NSIndexPath *selectedIndexPath; + +} + + +@property (weak, nonatomic) IBOutlet UITableView *countriesTableView; + +@property (strong, nonatomic) NSMutableArray *countries; +@property (strong, nonatomic) NSMutableArray *unitedKingdomCountries; +@property (strong, nonatomic) NSMutableArray *nonUKCountries; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.m b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.m new file mode 100644 index 0000000..757db8f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.m @@ -0,0 +1,251 @@ +// +// MainTableViewController.m +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MainTableViewController.h" +#import "CountryCell.h" + +@interface MainTableViewController () + + +@end + +@implementation MainTableViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + + self.title = @"Countries"; + self.countriesTableView.delegate = self; + self.countriesTableView.dataSource = self; + self.navigationItem.rightBarButtonItem = self.editButtonItem; + + [self.countriesTableView registerClass:CountryCell.class + forCellReuseIdentifier:@"CountryCell"]; + + + self.countriesTableView.delegate = self; + self.countriesTableView.dataSource = self; + + self.title = @"Countries"; + Country *usa = [[Country alloc] init]; + usa.name = @"United States of America"; + usa.motto = @"E Pluribus Unum"; + usa.capital = @"Washington, D.C."; + usa.flag = [UIImage imageNamed:@"usa.png"]; + + Country *france = [[Country alloc] init]; + france.name = @"French Republic"; + france.motto = @"Liberté, Égalité, Fraternité"; + france.capital = @"Paris"; + france.flag = [UIImage imageNamed:@"france.png"]; + + Country *england = [[Country alloc] init]; + england.name = @"England"; + england.motto = @"Dieu et mon droit"; + england.capital = @"London"; + england.flag = [UIImage imageNamed:@"england.png"]; + + Country *scotland = [[Country alloc] init]; + scotland.name = @"Scotland"; + scotland.motto = @"In My Defens God Me Defend"; + scotland.capital = @"Edinburgh"; + scotland.flag = [UIImage imageNamed:@"scotland.png"]; + + Country *spain = [[Country alloc] init]; + spain.name = @"Kingdom of Spain"; + spain.motto = @"Plus Ultra"; + spain.capital = @"Madrid"; + spain.flag = [UIImage imageNamed:@"spain.png"]; + + self.unitedKingdomCountries = [NSMutableArray arrayWithObjects:england, scotland, nil]; + self.nonUKCountries = [NSMutableArray arrayWithObjects:usa, france, spain, nil]; + self.countries = [NSMutableArray arrayWithObjects:self.unitedKingdomCountries, self.nonUKCountries, nil]; + + + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - overrides + +-(void)setEditing:(BOOL)editing animated:(BOOL)animated +{ + [super setEditing:editing animated:animated]; + [self.countriesTableView setEditing:editing animated:animated]; +} + +#pragma mark - Data Source Methods + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + NSArray *group = [self.countries objectAtIndex:section]; + return [group count]; +} + +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return [self.countries count]; +} + +-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + if (section == 0) + { + return @"United Kingdom Countries"; + } + return @"Non-United Kingdom Countries"; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + CountryCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CountryCell"]; + NSArray *group = [self.countries objectAtIndex:indexPath.section]; + cell.country = [group objectAtIndex:indexPath.row]; + return cell; +} + +-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) + { + NSMutableArray *group = [self.countries objectAtIndex:indexPath.section]; + Country *deletedCountry = [group objectAtIndex:indexPath.row]; + [group removeObject:deletedCountry]; + + [self.countriesTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + } + else if (editingStyle == UITableViewCellEditingStyleInsert) + { + NSMutableArray *group = [self.countries objectAtIndex:indexPath.section]; + Country *copiedCountry = [group objectAtIndex:indexPath.row]; + Country *newCountry = [[Country alloc] init]; + newCountry.name = copiedCountry.name; + newCountry.flag = copiedCountry.flag; + newCountry.capital = copiedCountry.capital; + newCountry.motto = copiedCountry.motto; + + [group insertObject:newCountry atIndex:indexPath.row+1]; + + [self.countriesTableView insertRowsAtIndexPaths: + [NSArray arrayWithObject:[NSIndexPath indexPathForRow:indexPath.row+1 + inSection:indexPath.section]] + withRowAnimation:UITableViewRowAnimationRight]; + } +} + +-(void)tableView:(UITableView *)tableView moveRowAtIndexPath: +(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath +{ + //Assume same Section + NSMutableArray *group = [self.countries objectAtIndex:sourceIndexPath.section]; + if (destinationIndexPath.row < [group count]) + { + [group exchangeObjectAtIndex:sourceIndexPath.row + withObjectAtIndex:destinationIndexPath.row]; + } + [self.countriesTableView reloadData]; +} + +-(BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + return YES; +} + +-(NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section +{ + if (section == 0) + return @"United Kingdom Countries"; + return @"Non-United Kingdom Countries"; +} + + +#pragma mark - delegate methods + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + + selectedIndexPath = indexPath; + + NSArray *group = [self.countries objectAtIndex:indexPath.section]; + Country *chosenCountry = [group objectAtIndex:indexPath.row]; + CountryDetailsViewController *detailedViewController = + [[CountryDetailsViewController alloc] init]; + detailedViewController.delegate = self; + detailedViewController.currentCountry = chosenCountry; + + [self.navigationController pushViewController:detailedViewController animated:YES]; +} +-(void)countryDetailsViewControllerDidFinish:(CountryDetailsViewController *)sender +{ + if (selectedIndexPath) + { + [self.countriesTableView beginUpdates]; + [self.countriesTableView reloadRowsAtIndexPaths: + [NSArray arrayWithObject:selectedIndexPath] withRowAnimation:UITableViewRowAnimationNone]; + [self.countriesTableView endUpdates]; + } + selectedIndexPath = nil; +} + +-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + + selectedIndexPath = indexPath; + + NSArray *group = [self.countries objectAtIndex:indexPath.section]; + Country *chosenCountry = [group objectAtIndex:indexPath.row]; + CountryDetailsViewController *detailedViewController = + [[CountryDetailsViewController alloc] init]; + detailedViewController.delegate = self; + detailedViewController.currentCountry = chosenCountry; + + NSLog(@"Accessory Button Tapped"); + [self.navigationController pushViewController:detailedViewController animated:YES]; +} + + +-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ((indexPath.row % 2) == 1) + { + return UITableViewCellEditingStyleInsert; + } + return UITableViewCellEditingStyleDelete; +} + + + + + + + + + + + + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.xib b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.xib new file mode 100644 index 0000000..281a0f8 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/MainTableViewController.xib @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/project.pbxproj b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f065bdf --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/project.pbxproj @@ -0,0 +1,528 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88750AD2178FAB300078548E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88750AD1178FAB300078548E /* Foundation.framework */; }; + 88750AD4178FAB300078548E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88750AD3178FAB300078548E /* CoreGraphics.framework */; }; + 88750AD6178FAB300078548E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88750AD5178FAB300078548E /* UIKit.framework */; }; + 88750ADC178FAB300078548E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88750ADA178FAB300078548E /* InfoPlist.strings */; }; + 88750ADE178FAB300078548E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750ADD178FAB300078548E /* main.m */; }; + 88750AE2178FAB300078548E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750AE1178FAB300078548E /* AppDelegate.m */; }; + 88750AE4178FAB300078548E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88750AE3178FAB300078548E /* Images.xcassets */; }; + 88750AEB178FAB300078548E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88750AEA178FAB300078548E /* XCTest.framework */; }; + 88750AEC178FAB300078548E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88750AD1178FAB300078548E /* Foundation.framework */; }; + 88750AED178FAB300078548E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88750AD5178FAB300078548E /* UIKit.framework */; }; + 88750AF5178FAB300078548E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88750AF3178FAB300078548E /* InfoPlist.strings */; }; + 88750AF7178FAB300078548E /* Recipe_4_1_to_4_5__Creating_UITableViewsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750AF6178FAB300078548E /* Recipe_4_1_to_4_5__Creating_UITableViewsTests.m */; }; + 88750B03178FABEA0078548E /* MainTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750B01178FABEA0078548E /* MainTableViewController.m */; }; + 88750B04178FABEA0078548E /* MainTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750B01178FABEA0078548E /* MainTableViewController.m */; }; + 88750B05178FABEA0078548E /* MainTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88750B02178FABEA0078548E /* MainTableViewController.xib */; }; + 88750B06178FABEA0078548E /* MainTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88750B02178FABEA0078548E /* MainTableViewController.xib */; }; + 88750B09178FAFF00078548E /* Country.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750B08178FAFF00078548E /* Country.m */; }; + 88750B0A178FAFF00078548E /* Country.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750B08178FAFF00078548E /* Country.m */; }; + 88750B10178FB15A0078548E /* england.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0B178FB15A0078548E /* england.png */; }; + 88750B11178FB15A0078548E /* england.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0B178FB15A0078548E /* england.png */; }; + 88750B12178FB15A0078548E /* france.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0C178FB15A0078548E /* france.png */; }; + 88750B13178FB15A0078548E /* france.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0C178FB15A0078548E /* france.png */; }; + 88750B14178FB15A0078548E /* Scotland.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0D178FB15A0078548E /* Scotland.png */; }; + 88750B15178FB15A0078548E /* Scotland.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0D178FB15A0078548E /* Scotland.png */; }; + 88750B16178FB15A0078548E /* spain.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0E178FB15A0078548E /* spain.png */; }; + 88750B17178FB15A0078548E /* spain.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0E178FB15A0078548E /* spain.png */; }; + 88750B18178FB15A0078548E /* usa.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0F178FB15A0078548E /* usa.png */; }; + 88750B19178FB15A0078548E /* usa.png in Resources */ = {isa = PBXBuildFile; fileRef = 88750B0F178FB15A0078548E /* usa.png */; }; + 88750B20178FBF220078548E /* CountryDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750B1E178FBF220078548E /* CountryDetailsViewController.m */; }; + 88750B21178FBF220078548E /* CountryDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88750B1E178FBF220078548E /* CountryDetailsViewController.m */; }; + 88750B22178FBF220078548E /* CountryDetailsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88750B1F178FBF220078548E /* CountryDetailsViewController.xib */; }; + 88750B23178FBF220078548E /* CountryDetailsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88750B1F178FBF220078548E /* CountryDetailsViewController.xib */; }; + 8887A3BA17921AB80097037C /* CountryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A3B917921AB80097037C /* CountryCell.m */; }; + 8887A3BB17921AB80097037C /* CountryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A3B917921AB80097037C /* CountryCell.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88750AEE178FAB300078548E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88750AC6178FAB300078548E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88750ACD178FAB300078548E; + remoteInfo = "Recipe 4-1 to 4-5: Creating UITableViews"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88750ACE178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 4-1 to 4-5 Creating UITableViews.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88750AD1178FAB300078548E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88750AD3178FAB300078548E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88750AD5178FAB300078548E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88750AD9178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 4-1 to 4-5 Creating UITableViews-Info.plist"; sourceTree = ""; }; + 88750ADB178FAB300078548E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88750ADD178FAB300078548E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88750ADF178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch"; sourceTree = ""; }; + 88750AE0178FAB300078548E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88750AE1178FAB300078548E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88750AE3178FAB300078548E /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88750AE9178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 4-1 to 4-5 Creating UITableViewsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88750AEA178FAB300078548E /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88750AF2178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist"; sourceTree = ""; }; + 88750AF4178FAB300078548E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88750AF6178FAB300078548E /* Recipe_4_1_to_4_5__Creating_UITableViewsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_4_1_to_4_5__Creating_UITableViewsTests.m; sourceTree = ""; }; + 88750B00178FABEA0078548E /* MainTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainTableViewController.h; sourceTree = ""; }; + 88750B01178FABEA0078548E /* MainTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainTableViewController.m; sourceTree = ""; }; + 88750B02178FABEA0078548E /* MainTableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainTableViewController.xib; sourceTree = ""; }; + 88750B07178FAFF00078548E /* Country.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Country.h; sourceTree = ""; }; + 88750B08178FAFF00078548E /* Country.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Country.m; sourceTree = ""; }; + 88750B0B178FB15A0078548E /* england.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = england.png; sourceTree = ""; }; + 88750B0C178FB15A0078548E /* france.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = france.png; sourceTree = ""; }; + 88750B0D178FB15A0078548E /* Scotland.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Scotland.png; sourceTree = ""; }; + 88750B0E178FB15A0078548E /* spain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spain.png; sourceTree = ""; }; + 88750B0F178FB15A0078548E /* usa.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = usa.png; sourceTree = ""; }; + 88750B1D178FBF220078548E /* CountryDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountryDetailsViewController.h; sourceTree = ""; }; + 88750B1E178FBF220078548E /* CountryDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountryDetailsViewController.m; sourceTree = ""; }; + 88750B1F178FBF220078548E /* CountryDetailsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CountryDetailsViewController.xib; sourceTree = ""; }; + 8887A3B817921AB80097037C /* CountryCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountryCell.h; sourceTree = ""; }; + 8887A3B917921AB80097037C /* CountryCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountryCell.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88750ACB178FAB300078548E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88750AD4178FAB300078548E /* CoreGraphics.framework in Frameworks */, + 88750AD6178FAB300078548E /* UIKit.framework in Frameworks */, + 88750AD2178FAB300078548E /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88750AE6178FAB300078548E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88750AEB178FAB300078548E /* XCTest.framework in Frameworks */, + 88750AED178FAB300078548E /* UIKit.framework in Frameworks */, + 88750AEC178FAB300078548E /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88750AC5178FAB300078548E = { + isa = PBXGroup; + children = ( + 88750B00178FABEA0078548E /* MainTableViewController.h */, + 88750B01178FABEA0078548E /* MainTableViewController.m */, + 8887A3B817921AB80097037C /* CountryCell.h */, + 8887A3B917921AB80097037C /* CountryCell.m */, + 88750B1D178FBF220078548E /* CountryDetailsViewController.h */, + 88750B1E178FBF220078548E /* CountryDetailsViewController.m */, + 88750B1F178FBF220078548E /* CountryDetailsViewController.xib */, + 88750B07178FAFF00078548E /* Country.h */, + 88750B08178FAFF00078548E /* Country.m */, + 88750B02178FABEA0078548E /* MainTableViewController.xib */, + 88750AD7178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews */, + 88750AF0178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests */, + 88750AD0178FAB300078548E /* Frameworks */, + 88750ACF178FAB300078548E /* Products */, + ); + sourceTree = ""; + }; + 88750ACF178FAB300078548E /* Products */ = { + isa = PBXGroup; + children = ( + 88750ACE178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews.app */, + 88750AE9178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88750AD0178FAB300078548E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88750AD1178FAB300078548E /* Foundation.framework */, + 88750AD3178FAB300078548E /* CoreGraphics.framework */, + 88750AD5178FAB300078548E /* UIKit.framework */, + 88750AEA178FAB300078548E /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88750AD7178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews */ = { + isa = PBXGroup; + children = ( + 88750AE0178FAB300078548E /* AppDelegate.h */, + 88750AE1178FAB300078548E /* AppDelegate.m */, + 88750AE3178FAB300078548E /* Images.xcassets */, + 88750AD8178FAB300078548E /* Supporting Files */, + ); + name = "Recipe 4-1 to 4-5 Creating UITableViews"; + path = "Recipe 4-1 to 4-5: Creating UITableViews"; + sourceTree = ""; + }; + 88750AD8178FAB300078548E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88750B0B178FB15A0078548E /* england.png */, + 88750B0C178FB15A0078548E /* france.png */, + 88750B0D178FB15A0078548E /* Scotland.png */, + 88750B0E178FB15A0078548E /* spain.png */, + 88750B0F178FB15A0078548E /* usa.png */, + 88750AD9178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews-Info.plist */, + 88750ADA178FAB300078548E /* InfoPlist.strings */, + 88750ADD178FAB300078548E /* main.m */, + 88750ADF178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88750AF0178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests */ = { + isa = PBXGroup; + children = ( + 88750AF6178FAB300078548E /* Recipe_4_1_to_4_5__Creating_UITableViewsTests.m */, + 88750AF1178FAB300078548E /* Supporting Files */, + ); + name = "Recipe 4-1 to 4-5 Creating UITableViewsTests"; + path = "Recipe 4-1 to 4-5: Creating UITableViewsTests"; + sourceTree = ""; + }; + 88750AF1178FAB300078548E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88750AF2178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist */, + 88750AF3178FAB300078548E /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88750ACD178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88750AFA178FAB300078548E /* Build configuration list for PBXNativeTarget "Recipe 4-1 to 4-5 Creating UITableViews" */; + buildPhases = ( + 88750ACA178FAB300078548E /* Sources */, + 88750ACB178FAB300078548E /* Frameworks */, + 88750ACC178FAB300078548E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 4-1 to 4-5 Creating UITableViews"; + productName = "Recipe 4-1 to 4-5: Creating UITableViews"; + productReference = 88750ACE178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews.app */; + productType = "com.apple.product-type.application"; + }; + 88750AE8178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88750AFD178FAB300078548E /* Build configuration list for PBXNativeTarget "Recipe 4-1 to 4-5 Creating UITableViewsTests" */; + buildPhases = ( + 88750AE5178FAB300078548E /* Sources */, + 88750AE6178FAB300078548E /* Frameworks */, + 88750AE7178FAB300078548E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88750AEF178FAB300078548E /* PBXTargetDependency */, + ); + name = "Recipe 4-1 to 4-5 Creating UITableViewsTests"; + productName = "Recipe 4-1 to 4-5: Creating UITableViewsTests"; + productReference = 88750AE9178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88750AC6178FAB300078548E /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88750AE8178FAB300078548E = { + TestTargetID = 88750ACD178FAB300078548E; + }; + }; + }; + buildConfigurationList = 88750AC9178FAB300078548E /* Build configuration list for PBXProject "Recipe 4-1 to 4-5 Creating UITableViews" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 88750AC5178FAB300078548E; + productRefGroup = 88750ACF178FAB300078548E /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88750ACD178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews */, + 88750AE8178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViewsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88750ACC178FAB300078548E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88750B12178FB15A0078548E /* france.png in Resources */, + 88750B14178FB15A0078548E /* Scotland.png in Resources */, + 88750ADC178FAB300078548E /* InfoPlist.strings in Resources */, + 88750B18178FB15A0078548E /* usa.png in Resources */, + 88750B05178FABEA0078548E /* MainTableViewController.xib in Resources */, + 88750AE4178FAB300078548E /* Images.xcassets in Resources */, + 88750B22178FBF220078548E /* CountryDetailsViewController.xib in Resources */, + 88750B10178FB15A0078548E /* england.png in Resources */, + 88750B16178FB15A0078548E /* spain.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88750AE7178FAB300078548E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88750B13178FB15A0078548E /* france.png in Resources */, + 88750B17178FB15A0078548E /* spain.png in Resources */, + 88750B19178FB15A0078548E /* usa.png in Resources */, + 88750B23178FBF220078548E /* CountryDetailsViewController.xib in Resources */, + 88750B06178FABEA0078548E /* MainTableViewController.xib in Resources */, + 88750B15178FB15A0078548E /* Scotland.png in Resources */, + 88750B11178FB15A0078548E /* england.png in Resources */, + 88750AF5178FAB300078548E /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88750ACA178FAB300078548E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88750B09178FAFF00078548E /* Country.m in Sources */, + 88750AE2178FAB300078548E /* AppDelegate.m in Sources */, + 88750ADE178FAB300078548E /* main.m in Sources */, + 88750B20178FBF220078548E /* CountryDetailsViewController.m in Sources */, + 8887A3BA17921AB80097037C /* CountryCell.m in Sources */, + 88750B03178FABEA0078548E /* MainTableViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88750AE5178FAB300078548E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88750B04178FABEA0078548E /* MainTableViewController.m in Sources */, + 8887A3BB17921AB80097037C /* CountryCell.m in Sources */, + 88750B0A178FAFF00078548E /* Country.m in Sources */, + 88750AF7178FAB300078548E /* Recipe_4_1_to_4_5__Creating_UITableViewsTests.m in Sources */, + 88750B21178FBF220078548E /* CountryDetailsViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88750AEF178FAB300078548E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88750ACD178FAB300078548E /* Recipe 4-1 to 4-5 Creating UITableViews */; + targetProxy = 88750AEE178FAB300078548E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88750ADA178FAB300078548E /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88750ADB178FAB300078548E /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88750AF3178FAB300078548E /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88750AF4178FAB300078548E /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88750AF8178FAB300078548E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88750AF9178FAB300078548E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88750AFB178FAB300078548E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-1 to 4-5: Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch"; + INFOPLIST_FILE = "Recipe 4-1 to 4-5: Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Info.plist"; + PRODUCT_NAME = "Recipe 4-1 to 4-5 Creating UITableViews"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88750AFC178FAB300078548E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-1 to 4-5: Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch"; + INFOPLIST_FILE = "Recipe 4-1 to 4-5: Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Info.plist"; + PRODUCT_NAME = "Recipe 4-1 to 4-5 Creating UITableViews"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88750AFE178FAB300078548E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 4-1 to 4-5: Creating UITableViews.app/Recipe 4-1 to 4-5: Creating UITableViews"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-1 to 4-5: Creating UITableViews/Recipe 4-1 to 4-5: Creating UITableViews-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 4-1 to 4-5: Creating UITableViewsTests/Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist"; + PRODUCT_NAME = "Recipe 4-1 to 4-5 Creating UITableViewsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88750AFF178FAB300078548E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 4-1 to 4-5: Creating UITableViews.app/Recipe 4-1 to 4-5: Creating UITableViews"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-1 to 4-5: Creating UITableViews/Recipe 4-1 to 4-5: Creating UITableViews-Prefix.pch"; + INFOPLIST_FILE = "Recipe 4-1 to 4-5: Creating UITableViewsTests/Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist"; + PRODUCT_NAME = "Recipe 4-1 to 4-5 Creating UITableViewsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88750AC9178FAB300078548E /* Build configuration list for PBXProject "Recipe 4-1 to 4-5 Creating UITableViews" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88750AF8178FAB300078548E /* Debug */, + 88750AF9178FAB300078548E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88750AFA178FAB300078548E /* Build configuration list for PBXNativeTarget "Recipe 4-1 to 4-5 Creating UITableViews" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88750AFB178FAB300078548E /* Debug */, + 88750AFC178FAB300078548E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88750AFD178FAB300078548E /* Build configuration list for PBXNativeTarget "Recipe 4-1 to 4-5 Creating UITableViewsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88750AFE178FAB300078548E /* Debug */, + 88750AFF178FAB300078548E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88750AC6178FAB300078548E /* Project object */; +} diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..8318a9f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1d78a2e --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 4-1 to 4-5: Creating UITableViews.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88750ACD178FAB300078548E + + primary + + + 88750AE8178FAB300078548E + + primary + + + + + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/AppDelegate.h b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/AppDelegate.h new file mode 100644 index 0000000..ac895d7 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/AppDelegate.h @@ -0,0 +1,18 @@ +// +// AppDelegate.h +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "MainTableViewController.h" + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; +@property (nonatomic, strong) UINavigationController *navigationController; +@property (nonatomic, strong) MainTableViewController *tableViewController; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/AppDelegate.m b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/AppDelegate.m new file mode 100644 index 0000000..c347058 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/AppDelegate.m @@ -0,0 +1,54 @@ +// +// AppDelegate.m +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + // Override point for customization after application launch. + self.window.backgroundColor = [UIColor whiteColor]; + + self.tableViewController = [[MainTableViewController alloc] init]; + self.navigationController = [[UINavigationController alloc] + initWithRootViewController:self.tableViewController]; + self.window.rootViewController = self.navigationController; + [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/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Images.xcassets/AppIcon.appiconset/Contents.json b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Info.plist b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Info.plist new file mode 100644 index 0000000..6c23e04 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${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/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch new file mode 100644 index 0000000..743435c --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5 Creating UITableViews-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Scotland.png b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Scotland.png new file mode 100644 index 0000000..c8cc01b Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/Scotland.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/en.lproj/InfoPlist.strings b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/england.png b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/england.png new file mode 100644 index 0000000..bdb150f Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/england.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/france.png b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/france.png new file mode 100644 index 0000000..0f4122a Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/france.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/main.m b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/main.m new file mode 100644 index 0000000..77d4caf --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 4-1 to 4-5: Creating UITableViews +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/spain.png b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/spain.png new file mode 100644 index 0000000..1a038b8 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/spain.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/usa.png b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/usa.png new file mode 100644 index 0000000..48ee7b8 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViews/usa.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/Recipe 4-1 to 4-5 Creating UITableViewsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/Recipe_4_1_to_4_5__Creating_UITableViewsTests.m b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/Recipe_4_1_to_4_5__Creating_UITableViewsTests.m new file mode 100644 index 0000000..8fadba7 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/Recipe_4_1_to_4_5__Creating_UITableViewsTests.m @@ -0,0 +1,36 @@ +// +// Recipe_4_1_to_4_5__Creating_UITableViewsTests.m +// Recipe 4-1 to 4-5: Creating UITableViewsTests +// +// Created by joseph hoffman on 7/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_4_1_to_4_5__Creating_UITableViewsTests : XCTestCase + +@end + +@implementation Recipe_4_1_to_4_5__Creating_UITableViewsTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/en.lproj/InfoPlist.strings b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-1 to 4-5_ Creating UITableViews/Recipe 4-1 to 4-5_ Creating UITableViewsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view.xcodeproj/project.pbxproj b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view.xcodeproj/project.pbxproj new file mode 100644 index 0000000..07bf0db --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view.xcodeproj/project.pbxproj @@ -0,0 +1,631 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 884A48CF1794C65E0098E250 /* ContinentHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 884A48CE1794C65E0098E250 /* ContinentHeader.m */; }; + 884A48D01794C65E0098E250 /* ContinentHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 884A48CE1794C65E0098E250 /* ContinentHeader.m */; }; + 8887A3C9179224EE0097037C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8887A3C8179224EE0097037C /* Foundation.framework */; }; + 8887A3CB179224EE0097037C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8887A3CA179224EE0097037C /* CoreGraphics.framework */; }; + 8887A3CD179224EE0097037C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8887A3CC179224EE0097037C /* UIKit.framework */; }; + 8887A3D3179224EE0097037C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8887A3D1179224EE0097037C /* InfoPlist.strings */; }; + 8887A3D5179224EE0097037C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A3D4179224EE0097037C /* main.m */; }; + 8887A3D9179224EE0097037C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A3D8179224EE0097037C /* AppDelegate.m */; }; + 8887A3DC179224EE0097037C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8887A3DA179224EE0097037C /* Main.storyboard */; }; + 8887A3DF179224EE0097037C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A3DE179224EE0097037C /* ViewController.m */; }; + 8887A3E1179224EE0097037C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8887A3E0179224EE0097037C /* Images.xcassets */; }; + 8887A3E8179224EE0097037C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8887A3E7179224EE0097037C /* XCTest.framework */; }; + 8887A3E9179224EE0097037C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8887A3C8179224EE0097037C /* Foundation.framework */; }; + 8887A3EA179224EE0097037C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8887A3CC179224EE0097037C /* UIKit.framework */; }; + 8887A3F2179224EE0097037C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8887A3F0179224EE0097037C /* InfoPlist.strings */; }; + 8887A3F4179224EE0097037C /* Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A3F3179224EE0097037C /* Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m */; }; + 8887A41B179225370097037C /* Argentina.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A3FD179225370097037C /* Argentina.png */; }; + 8887A41C179225370097037C /* Australia.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A3FE179225370097037C /* Australia.png */; }; + 8887A41D179225370097037C /* Brazil.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A3FF179225370097037C /* Brazil.png */; }; + 8887A41E179225370097037C /* Canada.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A400179225370097037C /* Canada.png */; }; + 8887A41F179225370097037C /* Chile.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A401179225370097037C /* Chile.png */; }; + 8887A420179225370097037C /* China.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A402179225370097037C /* China.png */; }; + 8887A421179225370097037C /* France.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A403179225370097037C /* France.png */; }; + 8887A422179225370097037C /* Germany.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A404179225370097037C /* Germany.png */; }; + 8887A423179225370097037C /* Ghana.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A405179225370097037C /* Ghana.png */; }; + 8887A424179225370097037C /* Iceland.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A406179225370097037C /* Iceland.png */; }; + 8887A425179225370097037C /* India.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A407179225370097037C /* India.png */; }; + 8887A426179225370097037C /* Ireland.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A408179225370097037C /* Ireland.png */; }; + 8887A427179225370097037C /* Italy.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A409179225370097037C /* Italy.png */; }; + 8887A428179225370097037C /* Japan.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A40A179225370097037C /* Japan.png */; }; + 8887A429179225370097037C /* Kenya.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A40B179225370097037C /* Kenya.png */; }; + 8887A42A179225370097037C /* Malta.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A40C179225370097037C /* Malta.png */; }; + 8887A42B179225370097037C /* Mexico.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A40D179225370097037C /* Mexico.png */; }; + 8887A42C179225370097037C /* Mongolia.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A40E179225370097037C /* Mongolia.png */; }; + 8887A42D179225370097037C /* Morocco.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A40F179225370097037C /* Morocco.png */; }; + 8887A42E179225370097037C /* Mozambique.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A410179225370097037C /* Mozambique.png */; }; + 8887A42F179225370097037C /* New_Zealand.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A411179225370097037C /* New_Zealand.png */; }; + 8887A430179225370097037C /* Poland.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A412179225370097037C /* Poland.png */; }; + 8887A431179225370097037C /* Russia.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A413179225370097037C /* Russia.png */; }; + 8887A432179225370097037C /* Rwanda.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A414179225370097037C /* Rwanda.png */; }; + 8887A433179225370097037C /* South_Africa.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A415179225370097037C /* South_Africa.png */; }; + 8887A434179225370097037C /* Spain.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A416179225370097037C /* Spain.png */; }; + 8887A435179225370097037C /* Sweden.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A417179225370097037C /* Sweden.png */; }; + 8887A436179225370097037C /* Turkey.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A418179225370097037C /* Turkey.png */; }; + 8887A437179225370097037C /* United_Kingdom.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A419179225370097037C /* United_Kingdom.png */; }; + 8887A438179225370097037C /* United_States.png in Resources */ = {isa = PBXBuildFile; fileRef = 8887A41A179225370097037C /* United_States.png */; }; + 8887A43C179227DA0097037C /* Flag.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A43B179227DA0097037C /* Flag.m */; }; + 8887A43D179227DA0097037C /* Flag.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A43B179227DA0097037C /* Flag.m */; }; + 8887A440179228F40097037C /* FlagPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A43F179228F40097037C /* FlagPickerViewController.m */; }; + 8887A441179228F40097037C /* FlagPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A43F179228F40097037C /* FlagPickerViewController.m */; }; + 8887A44417922EB90097037C /* FlagCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A44317922EB90097037C /* FlagCell.m */; }; + 8887A44517922EB90097037C /* FlagCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887A44317922EB90097037C /* FlagCell.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8887A3EB179224EE0097037C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8887A3BD179224EE0097037C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8887A3C4179224EE0097037C; + remoteInfo = "Recipe 4-6 :Creating a flag picker collection view"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 884A48CD1794C65E0098E250 /* ContinentHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContinentHeader.h; sourceTree = ""; }; + 884A48CE1794C65E0098E250 /* ContinentHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContinentHeader.m; sourceTree = ""; }; + 8887A3C5179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 4-6 :Creating a flag picker collection view.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8887A3C8179224EE0097037C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8887A3CA179224EE0097037C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8887A3CC179224EE0097037C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8887A3D0179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 4-6 :Creating a flag picker collection view-Info.plist"; sourceTree = ""; }; + 8887A3D2179224EE0097037C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8887A3D4179224EE0097037C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8887A3D6179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 4-6 :Creating a flag picker collection view-Prefix.pch"; sourceTree = ""; }; + 8887A3D7179224EE0097037C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8887A3D8179224EE0097037C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8887A3DB179224EE0097037C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8887A3DD179224EE0097037C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8887A3DE179224EE0097037C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8887A3E0179224EE0097037C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8887A3E6179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 4-6 :Creating a flag picker collection viewTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8887A3E7179224EE0097037C /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8887A3EF179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 4-6 :Creating a flag picker collection viewTests-Info.plist"; sourceTree = ""; }; + 8887A3F1179224EE0097037C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8887A3F3179224EE0097037C /* Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m; sourceTree = ""; }; + 8887A3FD179225370097037C /* Argentina.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Argentina.png; sourceTree = ""; }; + 8887A3FE179225370097037C /* Australia.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Australia.png; sourceTree = ""; }; + 8887A3FF179225370097037C /* Brazil.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Brazil.png; sourceTree = ""; }; + 8887A400179225370097037C /* Canada.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Canada.png; sourceTree = ""; }; + 8887A401179225370097037C /* Chile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Chile.png; sourceTree = ""; }; + 8887A402179225370097037C /* China.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = China.png; sourceTree = ""; }; + 8887A403179225370097037C /* France.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = France.png; sourceTree = ""; }; + 8887A404179225370097037C /* Germany.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Germany.png; sourceTree = ""; }; + 8887A405179225370097037C /* Ghana.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ghana.png; sourceTree = ""; }; + 8887A406179225370097037C /* Iceland.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Iceland.png; sourceTree = ""; }; + 8887A407179225370097037C /* India.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = India.png; sourceTree = ""; }; + 8887A408179225370097037C /* Ireland.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ireland.png; sourceTree = ""; }; + 8887A409179225370097037C /* Italy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Italy.png; sourceTree = ""; }; + 8887A40A179225370097037C /* Japan.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Japan.png; sourceTree = ""; }; + 8887A40B179225370097037C /* Kenya.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Kenya.png; sourceTree = ""; }; + 8887A40C179225370097037C /* Malta.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Malta.png; sourceTree = ""; }; + 8887A40D179225370097037C /* Mexico.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Mexico.png; sourceTree = ""; }; + 8887A40E179225370097037C /* Mongolia.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Mongolia.png; sourceTree = ""; }; + 8887A40F179225370097037C /* Morocco.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Morocco.png; sourceTree = ""; }; + 8887A410179225370097037C /* Mozambique.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Mozambique.png; sourceTree = ""; }; + 8887A411179225370097037C /* New_Zealand.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = New_Zealand.png; sourceTree = ""; }; + 8887A412179225370097037C /* Poland.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Poland.png; sourceTree = ""; }; + 8887A413179225370097037C /* Russia.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Russia.png; sourceTree = ""; }; + 8887A414179225370097037C /* Rwanda.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Rwanda.png; sourceTree = ""; }; + 8887A415179225370097037C /* South_Africa.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = South_Africa.png; sourceTree = ""; }; + 8887A416179225370097037C /* Spain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Spain.png; sourceTree = ""; }; + 8887A417179225370097037C /* Sweden.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Sweden.png; sourceTree = ""; }; + 8887A418179225370097037C /* Turkey.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Turkey.png; sourceTree = ""; }; + 8887A419179225370097037C /* United_Kingdom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = United_Kingdom.png; sourceTree = ""; }; + 8887A41A179225370097037C /* United_States.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = United_States.png; sourceTree = ""; }; + 8887A43A179227DA0097037C /* Flag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Flag.h; sourceTree = ""; }; + 8887A43B179227DA0097037C /* Flag.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Flag.m; sourceTree = ""; }; + 8887A43E179228F40097037C /* FlagPickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlagPickerViewController.h; sourceTree = ""; }; + 8887A43F179228F40097037C /* FlagPickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlagPickerViewController.m; sourceTree = ""; }; + 8887A44217922EB90097037C /* FlagCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlagCell.h; sourceTree = ""; }; + 8887A44317922EB90097037C /* FlagCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlagCell.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8887A3C2179224EE0097037C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8887A3CB179224EE0097037C /* CoreGraphics.framework in Frameworks */, + 8887A3CD179224EE0097037C /* UIKit.framework in Frameworks */, + 8887A3C9179224EE0097037C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8887A3E3179224EE0097037C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8887A3E8179224EE0097037C /* XCTest.framework in Frameworks */, + 8887A3EA179224EE0097037C /* UIKit.framework in Frameworks */, + 8887A3E9179224EE0097037C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8887A3BC179224EE0097037C = { + isa = PBXGroup; + children = ( + 8887A3CE179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view */, + 8887A3ED179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests */, + 8887A3C7179224EE0097037C /* Frameworks */, + 8887A3C6179224EE0097037C /* Products */, + ); + sourceTree = ""; + }; + 8887A3C6179224EE0097037C /* Products */ = { + isa = PBXGroup; + children = ( + 8887A3C5179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view.app */, + 8887A3E6179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8887A3C7179224EE0097037C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8887A3C8179224EE0097037C /* Foundation.framework */, + 8887A3CA179224EE0097037C /* CoreGraphics.framework */, + 8887A3CC179224EE0097037C /* UIKit.framework */, + 8887A3E7179224EE0097037C /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8887A3CE179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view */ = { + isa = PBXGroup; + children = ( + 8887A3D7179224EE0097037C /* AppDelegate.h */, + 8887A3D8179224EE0097037C /* AppDelegate.m */, + 8887A3DA179224EE0097037C /* Main.storyboard */, + 8887A43A179227DA0097037C /* Flag.h */, + 8887A43B179227DA0097037C /* Flag.m */, + 8887A43E179228F40097037C /* FlagPickerViewController.h */, + 8887A43F179228F40097037C /* FlagPickerViewController.m */, + 8887A44217922EB90097037C /* FlagCell.h */, + 8887A44317922EB90097037C /* FlagCell.m */, + 884A48CD1794C65E0098E250 /* ContinentHeader.h */, + 884A48CE1794C65E0098E250 /* ContinentHeader.m */, + 8887A3DD179224EE0097037C /* ViewController.h */, + 8887A3DE179224EE0097037C /* ViewController.m */, + 8887A3E0179224EE0097037C /* Images.xcassets */, + 8887A3CF179224EE0097037C /* Supporting Files */, + ); + path = "Recipe 4-6 :Creating a flag picker collection view"; + sourceTree = ""; + }; + 8887A3CF179224EE0097037C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8887A4391792253D0097037C /* flag images */, + 8887A3D0179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view-Info.plist */, + 8887A3D1179224EE0097037C /* InfoPlist.strings */, + 8887A3D4179224EE0097037C /* main.m */, + 8887A3D6179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8887A3ED179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests */ = { + isa = PBXGroup; + children = ( + 8887A3F3179224EE0097037C /* Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m */, + 8887A3EE179224EE0097037C /* Supporting Files */, + ); + path = "Recipe 4-6 :Creating a flag picker collection viewTests"; + sourceTree = ""; + }; + 8887A3EE179224EE0097037C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8887A3EF179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests-Info.plist */, + 8887A3F0179224EE0097037C /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8887A4391792253D0097037C /* flag images */ = { + isa = PBXGroup; + children = ( + 8887A3FD179225370097037C /* Argentina.png */, + 8887A3FE179225370097037C /* Australia.png */, + 8887A3FF179225370097037C /* Brazil.png */, + 8887A400179225370097037C /* Canada.png */, + 8887A401179225370097037C /* Chile.png */, + 8887A402179225370097037C /* China.png */, + 8887A403179225370097037C /* France.png */, + 8887A404179225370097037C /* Germany.png */, + 8887A405179225370097037C /* Ghana.png */, + 8887A406179225370097037C /* Iceland.png */, + 8887A407179225370097037C /* India.png */, + 8887A408179225370097037C /* Ireland.png */, + 8887A409179225370097037C /* Italy.png */, + 8887A40A179225370097037C /* Japan.png */, + 8887A40B179225370097037C /* Kenya.png */, + 8887A40C179225370097037C /* Malta.png */, + 8887A40D179225370097037C /* Mexico.png */, + 8887A40E179225370097037C /* Mongolia.png */, + 8887A40F179225370097037C /* Morocco.png */, + 8887A410179225370097037C /* Mozambique.png */, + 8887A411179225370097037C /* New_Zealand.png */, + 8887A412179225370097037C /* Poland.png */, + 8887A413179225370097037C /* Russia.png */, + 8887A414179225370097037C /* Rwanda.png */, + 8887A415179225370097037C /* South_Africa.png */, + 8887A416179225370097037C /* Spain.png */, + 8887A417179225370097037C /* Sweden.png */, + 8887A418179225370097037C /* Turkey.png */, + 8887A419179225370097037C /* United_Kingdom.png */, + 8887A41A179225370097037C /* United_States.png */, + ); + name = "flag images"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8887A3C4179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8887A3F7179224EE0097037C /* Build configuration list for PBXNativeTarget "Recipe 4-6 :Creating a flag picker collection view" */; + buildPhases = ( + 8887A3C1179224EE0097037C /* Sources */, + 8887A3C2179224EE0097037C /* Frameworks */, + 8887A3C3179224EE0097037C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 4-6 :Creating a flag picker collection view"; + productName = "Recipe 4-6 :Creating a flag picker collection view"; + productReference = 8887A3C5179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view.app */; + productType = "com.apple.product-type.application"; + }; + 8887A3E5179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8887A3FA179224EE0097037C /* Build configuration list for PBXNativeTarget "Recipe 4-6 :Creating a flag picker collection viewTests" */; + buildPhases = ( + 8887A3E2179224EE0097037C /* Sources */, + 8887A3E3179224EE0097037C /* Frameworks */, + 8887A3E4179224EE0097037C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8887A3EC179224EE0097037C /* PBXTargetDependency */, + ); + name = "Recipe 4-6 :Creating a flag picker collection viewTests"; + productName = "Recipe 4-6 :Creating a flag picker collection viewTests"; + productReference = 8887A3E6179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8887A3BD179224EE0097037C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8887A3E5179224EE0097037C = { + TestTargetID = 8887A3C4179224EE0097037C; + }; + }; + }; + buildConfigurationList = 8887A3C0179224EE0097037C /* Build configuration list for PBXProject "Recipe 4-6 :Creating a flag picker collection view" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8887A3BC179224EE0097037C; + productRefGroup = 8887A3C6179224EE0097037C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8887A3C4179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view */, + 8887A3E5179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection viewTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8887A3C3179224EE0097037C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8887A438179225370097037C /* United_States.png in Resources */, + 8887A430179225370097037C /* Poland.png in Resources */, + 8887A42D179225370097037C /* Morocco.png in Resources */, + 8887A431179225370097037C /* Russia.png in Resources */, + 8887A41E179225370097037C /* Canada.png in Resources */, + 8887A41F179225370097037C /* Chile.png in Resources */, + 8887A429179225370097037C /* Kenya.png in Resources */, + 8887A41C179225370097037C /* Australia.png in Resources */, + 8887A433179225370097037C /* South_Africa.png in Resources */, + 8887A3E1179224EE0097037C /* Images.xcassets in Resources */, + 8887A421179225370097037C /* France.png in Resources */, + 8887A425179225370097037C /* India.png in Resources */, + 8887A434179225370097037C /* Spain.png in Resources */, + 8887A41B179225370097037C /* Argentina.png in Resources */, + 8887A42E179225370097037C /* Mozambique.png in Resources */, + 8887A42F179225370097037C /* New_Zealand.png in Resources */, + 8887A41D179225370097037C /* Brazil.png in Resources */, + 8887A42A179225370097037C /* Malta.png in Resources */, + 8887A3D3179224EE0097037C /* InfoPlist.strings in Resources */, + 8887A422179225370097037C /* Germany.png in Resources */, + 8887A432179225370097037C /* Rwanda.png in Resources */, + 8887A420179225370097037C /* China.png in Resources */, + 8887A424179225370097037C /* Iceland.png in Resources */, + 8887A437179225370097037C /* United_Kingdom.png in Resources */, + 8887A426179225370097037C /* Ireland.png in Resources */, + 8887A435179225370097037C /* Sweden.png in Resources */, + 8887A3DC179224EE0097037C /* Main.storyboard in Resources */, + 8887A436179225370097037C /* Turkey.png in Resources */, + 8887A42C179225370097037C /* Mongolia.png in Resources */, + 8887A423179225370097037C /* Ghana.png in Resources */, + 8887A428179225370097037C /* Japan.png in Resources */, + 8887A42B179225370097037C /* Mexico.png in Resources */, + 8887A427179225370097037C /* Italy.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8887A3E4179224EE0097037C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8887A3F2179224EE0097037C /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8887A3C1179224EE0097037C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8887A440179228F40097037C /* FlagPickerViewController.m in Sources */, + 8887A3DF179224EE0097037C /* ViewController.m in Sources */, + 884A48CF1794C65E0098E250 /* ContinentHeader.m in Sources */, + 8887A3D9179224EE0097037C /* AppDelegate.m in Sources */, + 8887A44417922EB90097037C /* FlagCell.m in Sources */, + 8887A3D5179224EE0097037C /* main.m in Sources */, + 8887A43C179227DA0097037C /* Flag.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8887A3E2179224EE0097037C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8887A3F4179224EE0097037C /* Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m in Sources */, + 8887A441179228F40097037C /* FlagPickerViewController.m in Sources */, + 884A48D01794C65E0098E250 /* ContinentHeader.m in Sources */, + 8887A43D179227DA0097037C /* Flag.m in Sources */, + 8887A44517922EB90097037C /* FlagCell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8887A3EC179224EE0097037C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8887A3C4179224EE0097037C /* Recipe 4-6 :Creating a flag picker collection view */; + targetProxy = 8887A3EB179224EE0097037C /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8887A3D1179224EE0097037C /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8887A3D2179224EE0097037C /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8887A3DA179224EE0097037C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8887A3DB179224EE0097037C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8887A3F0179224EE0097037C /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8887A3F1179224EE0097037C /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8887A3F5179224EE0097037C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8887A3F6179224EE0097037C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8887A3F8179224EE0097037C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-6 :Creating a flag picker collection view/Recipe 4-6 :Creating a flag picker collection view-Prefix.pch"; + INFOPLIST_FILE = "Recipe 4-6 :Creating a flag picker collection view/Recipe 4-6 :Creating a flag picker collection view-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8887A3F9179224EE0097037C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-6 :Creating a flag picker collection view/Recipe 4-6 :Creating a flag picker collection view-Prefix.pch"; + INFOPLIST_FILE = "Recipe 4-6 :Creating a flag picker collection view/Recipe 4-6 :Creating a flag picker collection view-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8887A3FB179224EE0097037C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 4-6 :Creating a flag picker collection view.app/Recipe 4-6 :Creating a flag picker collection view"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-6 :Creating a flag picker collection view/Recipe 4-6 :Creating a flag picker collection view-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 4-6 :Creating a flag picker collection viewTests/Recipe 4-6 :Creating a flag picker collection viewTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8887A3FC179224EE0097037C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 4-6 :Creating a flag picker collection view.app/Recipe 4-6 :Creating a flag picker collection view"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 4-6 :Creating a flag picker collection view/Recipe 4-6 :Creating a flag picker collection view-Prefix.pch"; + INFOPLIST_FILE = "Recipe 4-6 :Creating a flag picker collection viewTests/Recipe 4-6 :Creating a flag picker collection viewTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8887A3C0179224EE0097037C /* Build configuration list for PBXProject "Recipe 4-6 :Creating a flag picker collection view" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8887A3F5179224EE0097037C /* Debug */, + 8887A3F6179224EE0097037C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8887A3F7179224EE0097037C /* Build configuration list for PBXNativeTarget "Recipe 4-6 :Creating a flag picker collection view" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8887A3F8179224EE0097037C /* Debug */, + 8887A3F9179224EE0097037C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8887A3FA179224EE0097037C /* Build configuration list for PBXNativeTarget "Recipe 4-6 :Creating a flag picker collection viewTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8887A3FB179224EE0097037C /* Debug */, + 8887A3FC179224EE0097037C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8887A3BD179224EE0097037C /* Project object */; +} diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9c6ab5f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/AppDelegate.h b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/AppDelegate.h new file mode 100644 index 0000000..06b5e92 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/AppDelegate.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/AppDelegate.m new file mode 100644 index 0000000..e73a65f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Argentina.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Argentina.png new file mode 100644 index 0000000..3c908d6 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Argentina.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Australia.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Australia.png new file mode 100644 index 0000000..4d97b2a Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Australia.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Base.lproj/Main.storyboard b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bec9851 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Base.lproj/Main.storyboard @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Brazil.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Brazil.png new file mode 100644 index 0000000..3ea0ac4 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Brazil.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Canada.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Canada.png new file mode 100644 index 0000000..6e3f34d Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Canada.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Chile.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Chile.png new file mode 100644 index 0000000..5e5e00c Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Chile.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/China.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/China.png new file mode 100644 index 0000000..79502fe Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/China.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ContinentHeader.h b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ContinentHeader.h new file mode 100644 index 0000000..855e479 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ContinentHeader.h @@ -0,0 +1,15 @@ +// +// ContinentHeader.h +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ContinentHeader : UICollectionReusableView + +@property (strong, nonatomic) UILabel *label; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ContinentHeader.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ContinentHeader.m new file mode 100644 index 0000000..b3fdc6e --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ContinentHeader.m @@ -0,0 +1,39 @@ +// +// ContinentHeader.m +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ContinentHeader.h" + +@implementation ContinentHeader + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + self.label = [[UILabel alloc] initWithFrame: + CGRectMake(0, 0, frame.size.width, frame.size.height)]; + self.label.font = [UIFont systemFontOfSize:20]; + self.label.textColor = [UIColor whiteColor]; + self.label.backgroundColor = [UIColor clearColor]; + self.label.textAlignment = NSTextAlignmentCenter; + [self addSubview:self.label]; + + self.label.translatesAutoresizingMaskIntoConstraints = NO; + + NSDictionary *viewsDictionary = + [[NSDictionary alloc] initWithObjectsAndKeys: + self.label, @"label", nil]; + [self addConstraints: + [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[label]|" + options:0 metrics:nil views:viewsDictionary]]; + + } + return self; +} + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Flag.h b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Flag.h new file mode 100644 index 0000000..88762ca --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Flag.h @@ -0,0 +1,18 @@ +// +// Flag.h +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Flag : NSObject + +@property (strong, nonatomic)NSString *name; +@property (strong, nonatomic)UIImage *image; + +- (id)initWithName:(NSString *)name imageName:(NSString *)imageName; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Flag.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Flag.m new file mode 100644 index 0000000..952df60 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Flag.m @@ -0,0 +1,24 @@ +// +// Flag.m +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "Flag.h" + +@implementation Flag + +- (id)initWithName:(NSString *)name imageName:(NSString *)imageName +{ + self = [super init]; + if (self) { + self.name = name; + NSString *imageFile = [[NSBundle mainBundle] pathForResource:imageName ofType:@"png"]; + self.image = [[UIImage alloc] initWithContentsOfFile:imageFile]; + } + return self; +} + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagCell.h b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagCell.h new file mode 100644 index 0000000..bde13ee --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagCell.h @@ -0,0 +1,16 @@ +// +// FlagCell.h +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface FlagCell : UICollectionViewCell + +@property (strong, nonatomic) UILabel *nameLabel; +@property (strong, nonatomic) UIImageView *flagImageView; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagCell.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagCell.m new file mode 100644 index 0000000..2b498fa --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagCell.m @@ -0,0 +1,36 @@ +// +// FlagCell.m +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "FlagCell.h" + +@implementation FlagCell + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + self.nameLabel = + [[UILabel alloc] initWithFrame:CGRectMake(0, 56, 100, 19)]; + self.nameLabel.textAlignment = NSTextAlignmentCenter; + self.nameLabel.backgroundColor = [UIColor clearColor]; + self.nameLabel.textColor = [UIColor whiteColor]; + self.nameLabel.font = [UIFont systemFontOfSize:12.0]; + [self.contentView addSubview:self.nameLabel]; + + self.flagImageView = + [[UIImageView alloc] initWithFrame:CGRectMake(6, 6, 88, 49)]; + [self.contentView addSubview:self.flagImageView]; + + self.selectedBackgroundView = [[UIView alloc] initWithFrame:frame]; + self.selectedBackgroundView.backgroundColor = [UIColor grayColor]; + } + return self; +} + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagPickerViewController.h b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagPickerViewController.h new file mode 100644 index 0000000..9a9fe28 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagPickerViewController.h @@ -0,0 +1,36 @@ +// +// FlagPickerViewController.h +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "Flag.h" + +@class FlagPickerViewController; + +@protocol FlagPickerViewControllerDelegate + +-(void)flagPicker:(FlagPickerViewController *)flagPicker didPickFlag:(Flag *)flag; + +@end + +@interface FlagPickerViewController : UICollectionViewController +{ +@private +NSArray *africanFlags; +NSArray *asianFlags; +NSArray *australasianFlags; +NSArray *europeanFlags; +NSArray *northAmericanFlags; +NSArray *southAmericanFlags; +} + +- (id)initWithDelegate:(id)delegate; + +@property (weak, nonatomic)iddelegate; + + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagPickerViewController.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagPickerViewController.m new file mode 100644 index 0000000..3ea083a --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/FlagPickerViewController.m @@ -0,0 +1,225 @@ +// +// FlagPickerViewController.m +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "FlagPickerViewController.h" +#import "FlagCell.h" +#import "ContinentHeader.h" + +@interface FlagPickerViewController () + +@end + +@implementation FlagPickerViewController + +- (id)initWithDelegate:(id)delegate +{ + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + self = [super initWithCollectionViewLayout:layout]; + if (self) + { + self.delegate = delegate; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + + africanFlags = [NSArray arrayWithObjects: + [[Flag alloc] initWithName:@"Ghana" imageName:@"Ghana"], + [[Flag alloc] initWithName:@"Kenya" imageName:@"Kenya"], + [[Flag alloc] initWithName:@"Morocco" imageName:@"Morocco"], + [[Flag alloc] initWithName:@"Mozambique" imageName:@"Mozambique"], + [[Flag alloc] initWithName:@"Rwanda" imageName:@"Rwanda"], + [[Flag alloc] initWithName:@"South Africa" imageName:@"South_Africa"], + nil]; + + asianFlags = [NSArray arrayWithObjects: + [[Flag alloc] initWithName:@"China" imageName:@"China"], + [[Flag alloc] initWithName:@"India" imageName:@"India"], + [[Flag alloc] initWithName:@"Japan" imageName:@"Japan"], + [[Flag alloc] initWithName:@"Mongolia" imageName:@"Mongolia"], + [[Flag alloc] initWithName:@"Russia" imageName:@"Russia"], + [[Flag alloc] initWithName:@"Turkey" imageName:@"Turkey"], + nil]; + + australasianFlags = [NSArray arrayWithObjects: + [[Flag alloc] initWithName:@"Australia" imageName:@"Australia"], + [[Flag alloc] initWithName:@"New Zealand" imageName:@"New_Zealand"], + nil]; + + europeanFlags = [NSArray arrayWithObjects: + [[Flag alloc] initWithName:@"France" imageName:@"France"], + [[Flag alloc] initWithName:@"Germany" imageName:@"Germany"], + [[Flag alloc] initWithName:@"Iceland" imageName:@"Iceland"], + [[Flag alloc] initWithName:@"Ireland" imageName:@"Ireland"], + [[Flag alloc] initWithName:@"Italy" imageName:@"Italy"], + [[Flag alloc] initWithName:@"Poland" imageName:@"Poland"], + [[Flag alloc] initWithName:@"Russia" imageName:@"Russia"], + [[Flag alloc] initWithName:@"Spain" imageName:@"Spain"], + [[Flag alloc] initWithName:@"Sweden" imageName:@"Sweden"], + [[Flag alloc] initWithName:@"Turkey" imageName:@"Turkey"], + [[Flag alloc] initWithName:@"United Kingdom" imageName:@"United_Kingdom"], + nil]; + + northAmericanFlags = [NSArray arrayWithObjects: + [[Flag alloc] initWithName:@"Canada" imageName:@"Canada"], + [[Flag alloc] initWithName:@"Mexico" imageName:@"Mexico"], + [[Flag alloc] initWithName:@"United States" imageName:@"United_States"], + nil]; + + southAmericanFlags = [NSArray arrayWithObjects: + [[Flag alloc] initWithName:@"Argentina" imageName:@"Argentina"], + [[Flag alloc] initWithName:@"Brazil" imageName:@"Brazil"], + [[Flag alloc] initWithName:@"Chile" imageName:@"Chile"], + nil]; + + [self.collectionView registerClass:FlagCell.class forCellWithReuseIdentifier:@"FlagCell"]; + [self.collectionView registerClass:ContinentHeader.class forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"ContinentHeader"]; + +} + +/* + -(void)viewWillAppear:(BOOL)animated + { + NSDictionary *viewsDictionary = + [[NSDictionary alloc] initWithObjectsAndKeys: + self.collectionView, @"collectionView", nil]; + [self.collectionView.superview addConstraints: + [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[collectionView]|" options:0 metrics:nil views:viewsDictionary]]; + [self.collectionView.superview addConstraints: + [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[collectionView]|" options:0 metrics:nil views:viewsDictionary]]; + } + */ + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - private methods + +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section +{ + switch (section) { + case 0: + return africanFlags.count; + case 1: + return asianFlags.count; + case 2: + return australasianFlags.count; + case 3: + return europeanFlags.count; + case 4: + return northAmericanFlags.count; + case 5: + return southAmericanFlags.count; + + default: + return 0; + } +} + +-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView +{ + return 6; +} + +-(Flag *)flagForIndexPath:(NSIndexPath *)indexPath +{ + switch (indexPath.section) { + case 0: + return [africanFlags objectAtIndex:indexPath.row]; + case 1: + return [asianFlags objectAtIndex:indexPath.row]; + case 2: + return [australasianFlags objectAtIndex:indexPath.row]; + case 3: + return [europeanFlags objectAtIndex:indexPath.row]; + case 4: + return [northAmericanFlags objectAtIndex:indexPath.row]; + case 5: + return [southAmericanFlags objectAtIndex:indexPath.row]; + + default: + return nil; + } +} + +- (NSString *)nameForSection:(NSInteger)index +{ + switch (index) + { + case 0: + return @"African Flags"; + case 1: + return @"Asian Flags"; + case 2: + return @"Australasian Flags"; + case 3: + return @"European Flags"; + case 4: + return @"North American Flags"; + case 5: + return @"South American Flags"; + default: + return @"Unknown"; + } +} + +#pragma mark - data source methods + +-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"FlagCell"; + FlagCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath]; + Flag *flag = [self flagForIndexPath:indexPath]; + cell.nameLabel.text = flag.name; + cell.flagImageView.image = flag.image; + return cell; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath +{ + return CGSizeMake(100, 75); +} + +/*- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section; + - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section; + - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section; + - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section; + */ + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section +{ + return CGSizeMake(50, 50); +} + +- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath +{ + ContinentHeader *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"ContinentHeader" forIndexPath:indexPath]; + + headerView.label.text = [self nameForSection:indexPath.section]; + + return headerView; +} + +#pragma mark - Delegate methods + +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath +{ + Flag *selectedFlag = [self flagForIndexPath:indexPath]; + [self.delegate flagPicker:self didPickFlag:selectedFlag]; +} + +@end + + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/France.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/France.png new file mode 100644 index 0000000..0f4122a Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/France.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Germany.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Germany.png new file mode 100644 index 0000000..a4733d3 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Germany.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Ghana.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Ghana.png new file mode 100644 index 0000000..940c7dc Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Ghana.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Iceland.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Iceland.png new file mode 100644 index 0000000..1348269 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Iceland.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Images.xcassets/AppIcon.appiconset/Contents.json b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/India.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/India.png new file mode 100644 index 0000000..891f930 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/India.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Ireland.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Ireland.png new file mode 100644 index 0000000..8acfb23 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Ireland.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Italy.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Italy.png new file mode 100644 index 0000000..2599b4b Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Italy.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Japan.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Japan.png new file mode 100644 index 0000000..d372c2a Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Japan.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Kenya.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Kenya.png new file mode 100644 index 0000000..93007d1 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Kenya.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Malta.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Malta.png new file mode 100644 index 0000000..b1a0b68 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Malta.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mexico.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mexico.png new file mode 100644 index 0000000..dc27cea Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mexico.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mongolia.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mongolia.png new file mode 100644 index 0000000..0a4a5d1 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mongolia.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Morocco.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Morocco.png new file mode 100644 index 0000000..a8fed6f Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Morocco.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mozambique.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mozambique.png new file mode 100644 index 0000000..8c1a084 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Mozambique.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/New_Zealand.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/New_Zealand.png new file mode 100644 index 0000000..9435042 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/New_Zealand.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Poland.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Poland.png new file mode 100644 index 0000000..66a887a Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Poland.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view-Info.plist b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view-Prefix.pch b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Russia.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Russia.png new file mode 100644 index 0000000..282a0c3 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Russia.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Rwanda.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Rwanda.png new file mode 100644 index 0000000..37de953 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Rwanda.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/South_Africa.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/South_Africa.png new file mode 100644 index 0000000..13e1064 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/South_Africa.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Spain.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Spain.png new file mode 100644 index 0000000..1a038b8 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Spain.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Sweden.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Sweden.png new file mode 100644 index 0000000..30f0877 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Sweden.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Turkey.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Turkey.png new file mode 100644 index 0000000..51c554c Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/Turkey.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/United_Kingdom.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/United_Kingdom.png new file mode 100644 index 0000000..1e0d8f3 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/United_Kingdom.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/United_States.png b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/United_States.png new file mode 100644 index 0000000..48ee7b8 Binary files /dev/null and b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/United_States.png differ diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ViewController.h b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ViewController.h new file mode 100644 index 0000000..33549fd --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "FlagPickerViewController.h" + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *countryLabel; +@property (weak, nonatomic) IBOutlet UIImageView *flagImageView; + +- (IBAction)pickFlag:(id)sender; + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ViewController.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ViewController.m new file mode 100644 index 0000000..7227aa7 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/ViewController.m @@ -0,0 +1,41 @@ +// +// ViewController.m +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)pickFlag:(id)sender { + UICollectionViewController *flagPicker = + [[FlagPickerViewController alloc] initWithDelegate:self]; + + [self presentViewController:flagPicker animated:YES completion:NULL]; +} +-(void)flagPicker:(FlagPickerViewController *)flagPicker didPickFlag:(Flag *)flag +{ + self.flagImageView.image = flag.image; + self.countryLabel.text = flag.name; + [self dismissViewControllerAnimated:YES completion:NULL]; +} +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/en.lproj/InfoPlist.strings b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/main.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/main.m new file mode 100644 index 0000000..0d873ae --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection view/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 4-6 :Creating a flag picker collection view +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection viewTests/Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection viewTests/Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m new file mode 100644 index 0000000..9275710 --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection viewTests/Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m @@ -0,0 +1,36 @@ +// +// Recipe_4_6__Creating_a_flag_picker_collection_viewTests.m +// Recipe 4-6 :Creating a flag picker collection viewTests +// +// Created by joseph hoffman on 7/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_4_6__Creating_a_flag_picker_collection_viewTests : XCTestCase + +@end + +@implementation Recipe_4_6__Creating_a_flag_picker_collection_viewTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection viewTests/en.lproj/InfoPlist.strings b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection viewTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH4 - Table and Collection View Recipes/Recipe 4-6 _Creating a flag picker collection view/Recipe 4-6 _Creating a flag picker collection viewTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.pbxproj b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e2a6766 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 881386E717AB59C40091C193 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881386E617AB59C40091C193 /* Foundation.framework */; }; + 881386E917AB59C40091C193 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881386E817AB59C40091C193 /* CoreGraphics.framework */; }; + 881386EB17AB59C40091C193 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881386EA17AB59C40091C193 /* UIKit.framework */; }; + 881386F117AB59C40091C193 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881386EF17AB59C40091C193 /* InfoPlist.strings */; }; + 881386F317AB59C40091C193 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 881386F217AB59C40091C193 /* main.m */; }; + 881386F717AB59C40091C193 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 881386F617AB59C40091C193 /* AppDelegate.m */; }; + 881386FA17AB59C40091C193 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881386F817AB59C40091C193 /* Main.storyboard */; }; + 881386FD17AB59C40091C193 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881386FC17AB59C40091C193 /* ViewController.m */; }; + 881386FF17AB59C40091C193 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 881386FE17AB59C40091C193 /* Images.xcassets */; }; + 8813870617AB59C40091C193 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813870517AB59C40091C193 /* XCTest.framework */; }; + 8813870717AB59C40091C193 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881386E617AB59C40091C193 /* Foundation.framework */; }; + 8813870817AB59C40091C193 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881386EA17AB59C40091C193 /* UIKit.framework */; }; + 8813871017AB59C40091C193 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8813870E17AB59C40091C193 /* InfoPlist.strings */; }; + 8813871217AB59C40091C193 /* Recipe_5_1__Getting_Basic_Location_InfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8813871117AB59C40091C193 /* Recipe_5_1__Getting_Basic_Location_InfoTests.m */; }; + 8813871C17AB59F30091C193 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813871B17AB59F30091C193 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8813870917AB59C40091C193 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 881386DB17AB59C40091C193 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 881386E217AB59C40091C193; + remoteInfo = "Recipe 5-1: Getting Basic Location Info"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 881386E317AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 5-1 Getting Basic Location Info.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881386E617AB59C40091C193 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 881386E817AB59C40091C193 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 881386EA17AB59C40091C193 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 881386EE17AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-1 Getting Basic Location Info-Info.plist"; sourceTree = ""; }; + 881386F017AB59C40091C193 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881386F217AB59C40091C193 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 881386F417AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 5-1 Getting Basic Location Info-Prefix.pch"; sourceTree = ""; }; + 881386F517AB59C40091C193 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 881386F617AB59C40091C193 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 881386F917AB59C40091C193 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 881386FB17AB59C40091C193 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 881386FC17AB59C40091C193 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 881386FE17AB59C40091C193 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8813870417AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 5-1 Getting Basic Location InfoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8813870517AB59C40091C193 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8813870D17AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-1 Getting Basic Location InfoTests-Info.plist"; sourceTree = ""; }; + 8813870F17AB59C40091C193 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8813871117AB59C40091C193 /* Recipe_5_1__Getting_Basic_Location_InfoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_5_1__Getting_Basic_Location_InfoTests.m; sourceTree = ""; }; + 8813871B17AB59F30091C193 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 881386E017AB59C40091C193 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813871C17AB59F30091C193 /* CoreLocation.framework in Frameworks */, + 881386E917AB59C40091C193 /* CoreGraphics.framework in Frameworks */, + 881386EB17AB59C40091C193 /* UIKit.framework in Frameworks */, + 881386E717AB59C40091C193 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8813870117AB59C40091C193 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813870617AB59C40091C193 /* XCTest.framework in Frameworks */, + 8813870817AB59C40091C193 /* UIKit.framework in Frameworks */, + 8813870717AB59C40091C193 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 881386DA17AB59C40091C193 = { + isa = PBXGroup; + children = ( + 881386EC17AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info */, + 8813870B17AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests */, + 881386E517AB59C40091C193 /* Frameworks */, + 881386E417AB59C40091C193 /* Products */, + ); + sourceTree = ""; + }; + 881386E417AB59C40091C193 /* Products */ = { + isa = PBXGroup; + children = ( + 881386E317AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info.app */, + 8813870417AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 881386E517AB59C40091C193 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8813871B17AB59F30091C193 /* CoreLocation.framework */, + 881386E617AB59C40091C193 /* Foundation.framework */, + 881386E817AB59C40091C193 /* CoreGraphics.framework */, + 881386EA17AB59C40091C193 /* UIKit.framework */, + 8813870517AB59C40091C193 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 881386EC17AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info */ = { + isa = PBXGroup; + children = ( + 881386F517AB59C40091C193 /* AppDelegate.h */, + 881386F617AB59C40091C193 /* AppDelegate.m */, + 881386F817AB59C40091C193 /* Main.storyboard */, + 881386FB17AB59C40091C193 /* ViewController.h */, + 881386FC17AB59C40091C193 /* ViewController.m */, + 881386FE17AB59C40091C193 /* Images.xcassets */, + 881386ED17AB59C40091C193 /* Supporting Files */, + ); + name = "Recipe 5-1 Getting Basic Location Info"; + path = "Recipe 5-1: Getting Basic Location Info"; + sourceTree = ""; + }; + 881386ED17AB59C40091C193 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881386EE17AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info-Info.plist */, + 881386EF17AB59C40091C193 /* InfoPlist.strings */, + 881386F217AB59C40091C193 /* main.m */, + 881386F417AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8813870B17AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests */ = { + isa = PBXGroup; + children = ( + 8813871117AB59C40091C193 /* Recipe_5_1__Getting_Basic_Location_InfoTests.m */, + 8813870C17AB59C40091C193 /* Supporting Files */, + ); + name = "Recipe 5-1 Getting Basic Location InfoTests"; + path = "Recipe 5-1: Getting Basic Location InfoTests"; + sourceTree = ""; + }; + 8813870C17AB59C40091C193 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8813870D17AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests-Info.plist */, + 8813870E17AB59C40091C193 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 881386E217AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8813871517AB59C40091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-1 Getting Basic Location Info" */; + buildPhases = ( + 881386DF17AB59C40091C193 /* Sources */, + 881386E017AB59C40091C193 /* Frameworks */, + 881386E117AB59C40091C193 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 5-1 Getting Basic Location Info"; + productName = "Recipe 5-1: Getting Basic Location Info"; + productReference = 881386E317AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info.app */; + productType = "com.apple.product-type.application"; + }; + 8813870317AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8813871817AB59C40091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-1 Getting Basic Location InfoTests" */; + buildPhases = ( + 8813870017AB59C40091C193 /* Sources */, + 8813870117AB59C40091C193 /* Frameworks */, + 8813870217AB59C40091C193 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8813870A17AB59C40091C193 /* PBXTargetDependency */, + ); + name = "Recipe 5-1 Getting Basic Location InfoTests"; + productName = "Recipe 5-1: Getting Basic Location InfoTests"; + productReference = 8813870417AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 881386DB17AB59C40091C193 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8813870317AB59C40091C193 = { + TestTargetID = 881386E217AB59C40091C193; + }; + }; + }; + buildConfigurationList = 881386DE17AB59C40091C193 /* Build configuration list for PBXProject "Recipe 5-1 Getting Basic Location Info" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 881386DA17AB59C40091C193; + productRefGroup = 881386E417AB59C40091C193 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 881386E217AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info */, + 8813870317AB59C40091C193 /* Recipe 5-1 Getting Basic Location InfoTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 881386E117AB59C40091C193 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881386FF17AB59C40091C193 /* Images.xcassets in Resources */, + 881386F117AB59C40091C193 /* InfoPlist.strings in Resources */, + 881386FA17AB59C40091C193 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8813870217AB59C40091C193 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813871017AB59C40091C193 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 881386DF17AB59C40091C193 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881386FD17AB59C40091C193 /* ViewController.m in Sources */, + 881386F717AB59C40091C193 /* AppDelegate.m in Sources */, + 881386F317AB59C40091C193 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8813870017AB59C40091C193 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813871217AB59C40091C193 /* Recipe_5_1__Getting_Basic_Location_InfoTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8813870A17AB59C40091C193 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 881386E217AB59C40091C193 /* Recipe 5-1 Getting Basic Location Info */; + targetProxy = 8813870917AB59C40091C193 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 881386EF17AB59C40091C193 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881386F017AB59C40091C193 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 881386F817AB59C40091C193 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 881386F917AB59C40091C193 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8813870E17AB59C40091C193 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8813870F17AB59C40091C193 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8813871317AB59C40091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8813871417AB59C40091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8813871617AB59C40091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-1: Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-1: Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Info.plist"; + PRODUCT_NAME = "Recipe 5-1 Getting Basic Location Info"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8813871717AB59C40091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-1: Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-1: Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Info.plist"; + PRODUCT_NAME = "Recipe 5-1 Getting Basic Location Info"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8813871917AB59C40091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-1: Getting Basic Location Info.app/Recipe 5-1: Getting Basic Location Info"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-1: Getting Basic Location Info/Recipe 5-1: Getting Basic Location Info-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 5-1: Getting Basic Location InfoTests/Recipe 5-1 Getting Basic Location InfoTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-1 Getting Basic Location InfoTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8813871A17AB59C40091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-1: Getting Basic Location Info.app/Recipe 5-1: Getting Basic Location Info"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-1: Getting Basic Location Info/Recipe 5-1: Getting Basic Location Info-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-1: Getting Basic Location InfoTests/Recipe 5-1 Getting Basic Location InfoTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-1 Getting Basic Location InfoTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 881386DE17AB59C40091C193 /* Build configuration list for PBXProject "Recipe 5-1 Getting Basic Location Info" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8813871317AB59C40091C193 /* Debug */, + 8813871417AB59C40091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8813871517AB59C40091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-1 Getting Basic Location Info" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8813871617AB59C40091C193 /* Debug */, + 8813871717AB59C40091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8813871817AB59C40091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-1 Getting Basic Location InfoTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8813871917AB59C40091C193 /* Debug */, + 8813871A17AB59C40091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 881386DB17AB59C40091C193 /* Project object */; +} diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..5fcd678 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..f8292e0 Binary files /dev/null and b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..6ea37d3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-1_ Getting Basic Location Info.xcscheme b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-1_ Getting Basic Location Info.xcscheme new file mode 100644 index 0000000..07dd91a --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-1_ Getting Basic Location Info.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6e0da3a --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 5-1: Getting Basic Location Info.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 881386E217AB59C40091C193 + + primary + + + 8813870317AB59C40091C193 + + primary + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/AppDelegate.h b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/AppDelegate.h new file mode 100644 index 0000000..d33a15d --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 5-1: Getting Basic Location Info +// +// Created by joseph hoffman on 8/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/AppDelegate.m b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/AppDelegate.m new file mode 100644 index 0000000..c50afd5 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 5-1: Getting Basic Location Info +// +// Created by joseph hoffman on 8/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Base.lproj/Main.storyboard b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bc9599e --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Base.lproj/Main.storyboard @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Images.xcassets/AppIcon.appiconset/Contents.json b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Info.plist b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Info.plist new file mode 100644 index 0000000..602c186 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Info.plist @@ -0,0 +1,54 @@ + + + + + NSLocationUsageDescription + We're Testing standard location services + CFBundleGetInfoString + + LSApplicationCategoryType + + CFBundleDevelopmentRegion + en + NSHumanReadableCopyright + + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + UIBackgroundModes + + location + + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Prefix.pch b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1 Getting Basic Location Info-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/ViewController.h b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/ViewController.h new file mode 100644 index 0000000..6f107e6 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/ViewController.h @@ -0,0 +1,23 @@ +// +// ViewController.h +// Recipe 5-1: Getting Basic Location Info +// +// Created by joseph hoffman on 8/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + + CLLocationManager *_locationManager; +} + +@property (weak, nonatomic) IBOutlet UITextView *locationInformationView; +@property (weak, nonatomic) IBOutlet UISwitch *locationUpdatesSwitch; + +- (IBAction)toggleLocationUpdates:(id)sender; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/ViewController.m b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/ViewController.m new file mode 100644 index 0000000..b3e1c80 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/ViewController.m @@ -0,0 +1,103 @@ +// +// ViewController.m +// Recipe 5-1: Getting Basic Location Info +// +// Created by joseph hoffman on 8/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} + +- (IBAction)toggleLocationUpdates:(id)sender +{ + if (self.locationUpdatesSwitch.on == YES) + { + if ([CLLocationManager locationServicesEnabled] == NO) + { + UIAlertView *locationServicesDisabledAlert = [[UIAlertView alloc] initWithTitle:@"Location Services Disabled" + message:@"This feature requires location services. Enable it in the privacy settings on your device" + delegate:nil cancelButtonTitle:@"Dismiss" + otherButtonTitles:nil]; + [locationServicesDisabledAlert show]; + self.locationUpdatesSwitch.on = NO; + return; + } + + if (_locationManager == nil) + { + _locationManager = [[CLLocationManager alloc] init]; + _locationManager.desiredAccuracy = kCLLocationAccuracyBest; + _locationManager.distanceFilter = 1; // meter + _locationManager.activityType = CLActivityTypeOther; + _locationManager.delegate = self; + + } + [_locationManager startUpdatingLocation]; + } + else + { + // Switch was turned Off + // Stop updates if they have been started + if (_locationManager != nil) + { + [_locationManager stopUpdatingLocation]; + } + } +} + +#pragma mark - delegate methods + +- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +{ + if (error.code == kCLErrorDenied) + { + // Turning the switch to off will trigger the toggleLocationServices action, + // which in turn will stop further updates from coming + self.locationUpdatesSwitch.on = NO; + } + else + { + NSLog(@"%@", error); + } +} + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + + CLLocation *lastLocation = [locations lastObject]; + // Make sure this is a recent location event + NSTimeInterval eventInterval = [lastLocation.timestamp timeIntervalSinceNow]; + if(abs(eventInterval) < 30.0) + { + // Make sure the event is accurate enough + if (lastLocation.horizontalAccuracy >= 0 && lastLocation.horizontalAccuracy < 20) + { + self.locationInformationView.text = lastLocation.description; + } + } +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/main.m b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/main.m new file mode 100644 index 0000000..4a3f490 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location Info/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 5-1: Getting Basic Location Info +// +// Created by joseph hoffman on 8/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/Recipe 5-1 Getting Basic Location InfoTests-Info.plist b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/Recipe 5-1 Getting Basic Location InfoTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/Recipe 5-1 Getting Basic Location InfoTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/Recipe_5_1__Getting_Basic_Location_InfoTests.m b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/Recipe_5_1__Getting_Basic_Location_InfoTests.m new file mode 100644 index 0000000..8d2a517 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/Recipe_5_1__Getting_Basic_Location_InfoTests.m @@ -0,0 +1,36 @@ +// +// Recipe_5_1__Getting_Basic_Location_InfoTests.m +// Recipe 5-1: Getting Basic Location InfoTests +// +// Created by joseph hoffman on 8/1/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_5_1__Getting_Basic_Location_InfoTests : XCTestCase + +@end + +@implementation Recipe_5_1__Getting_Basic_Location_InfoTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-1_ Getting Basic Location Info/Recipe 5-1_ Getting Basic Location InfoTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.pbxproj b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0bb0840 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8813872A17AEE9750091C193 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813872917AEE9750091C193 /* Foundation.framework */; }; + 8813872C17AEE9750091C193 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813872B17AEE9750091C193 /* CoreGraphics.framework */; }; + 8813872E17AEE9750091C193 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813872D17AEE9750091C193 /* UIKit.framework */; }; + 8813873417AEE9750091C193 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8813873217AEE9750091C193 /* InfoPlist.strings */; }; + 8813873617AEE9750091C193 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8813873517AEE9750091C193 /* main.m */; }; + 8813873A17AEE9750091C193 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8813873917AEE9750091C193 /* AppDelegate.m */; }; + 8813873D17AEE9750091C193 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8813873B17AEE9750091C193 /* Main.storyboard */; }; + 8813874017AEE9750091C193 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8813873F17AEE9750091C193 /* ViewController.m */; }; + 8813874217AEE9750091C193 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8813874117AEE9750091C193 /* Images.xcassets */; }; + 8813874917AEE9760091C193 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813874817AEE9760091C193 /* XCTest.framework */; }; + 8813874A17AEE9760091C193 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813872917AEE9750091C193 /* Foundation.framework */; }; + 8813874B17AEE9760091C193 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813872D17AEE9750091C193 /* UIKit.framework */; }; + 8813875317AEE9760091C193 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8813875117AEE9760091C193 /* InfoPlist.strings */; }; + 8813875517AEE9760091C193 /* Recipe_5_2__Significant_Location_ChangesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8813875417AEE9760091C193 /* Recipe_5_2__Significant_Location_ChangesTests.m */; }; + 8813875F17AEEB6A0091C193 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8813875E17AEEB690091C193 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8813874C17AEE9760091C193 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8813871E17AEE9750091C193 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8813872517AEE9750091C193; + remoteInfo = "Recipe 5-2: Significant Location Changes"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8813872617AEE9750091C193 /* Recipe 5-2 Significant Location Changes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 5-2 Significant Location Changes.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8813872917AEE9750091C193 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8813872B17AEE9750091C193 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8813872D17AEE9750091C193 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8813873117AEE9750091C193 /* Recipe 5-2 Significant Location Changes-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-2 Significant Location Changes-Info.plist"; sourceTree = ""; }; + 8813873317AEE9750091C193 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8813873517AEE9750091C193 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8813873717AEE9750091C193 /* Recipe 5-2 Significant Location Changes-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 5-2 Significant Location Changes-Prefix.pch"; sourceTree = ""; }; + 8813873817AEE9750091C193 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8813873917AEE9750091C193 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8813873C17AEE9750091C193 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8813873E17AEE9750091C193 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8813873F17AEE9750091C193 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8813874117AEE9750091C193 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8813874717AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 5-2 Significant Location ChangesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8813874817AEE9760091C193 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8813875017AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-2 Significant Location ChangesTests-Info.plist"; sourceTree = ""; }; + 8813875217AEE9760091C193 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8813875417AEE9760091C193 /* Recipe_5_2__Significant_Location_ChangesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_5_2__Significant_Location_ChangesTests.m; sourceTree = ""; }; + 8813875E17AEEB690091C193 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8813872317AEE9750091C193 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813875F17AEEB6A0091C193 /* CoreLocation.framework in Frameworks */, + 8813872C17AEE9750091C193 /* CoreGraphics.framework in Frameworks */, + 8813872E17AEE9750091C193 /* UIKit.framework in Frameworks */, + 8813872A17AEE9750091C193 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8813874417AEE9760091C193 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813874917AEE9760091C193 /* XCTest.framework in Frameworks */, + 8813874B17AEE9760091C193 /* UIKit.framework in Frameworks */, + 8813874A17AEE9760091C193 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8813871D17AEE9750091C193 = { + isa = PBXGroup; + children = ( + 8813872F17AEE9750091C193 /* Recipe 5-2 Significant Location Changes */, + 8813874E17AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests */, + 8813872817AEE9750091C193 /* Frameworks */, + 8813872717AEE9750091C193 /* Products */, + ); + sourceTree = ""; + }; + 8813872717AEE9750091C193 /* Products */ = { + isa = PBXGroup; + children = ( + 8813872617AEE9750091C193 /* Recipe 5-2 Significant Location Changes.app */, + 8813874717AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8813872817AEE9750091C193 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8813875E17AEEB690091C193 /* CoreLocation.framework */, + 8813872917AEE9750091C193 /* Foundation.framework */, + 8813872B17AEE9750091C193 /* CoreGraphics.framework */, + 8813872D17AEE9750091C193 /* UIKit.framework */, + 8813874817AEE9760091C193 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8813872F17AEE9750091C193 /* Recipe 5-2 Significant Location Changes */ = { + isa = PBXGroup; + children = ( + 8813873817AEE9750091C193 /* AppDelegate.h */, + 8813873917AEE9750091C193 /* AppDelegate.m */, + 8813873B17AEE9750091C193 /* Main.storyboard */, + 8813873E17AEE9750091C193 /* ViewController.h */, + 8813873F17AEE9750091C193 /* ViewController.m */, + 8813874117AEE9750091C193 /* Images.xcassets */, + 8813873017AEE9750091C193 /* Supporting Files */, + ); + name = "Recipe 5-2 Significant Location Changes"; + path = "Recipe 5-2: Significant Location Changes"; + sourceTree = ""; + }; + 8813873017AEE9750091C193 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8813873117AEE9750091C193 /* Recipe 5-2 Significant Location Changes-Info.plist */, + 8813873217AEE9750091C193 /* InfoPlist.strings */, + 8813873517AEE9750091C193 /* main.m */, + 8813873717AEE9750091C193 /* Recipe 5-2 Significant Location Changes-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8813874E17AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests */ = { + isa = PBXGroup; + children = ( + 8813875417AEE9760091C193 /* Recipe_5_2__Significant_Location_ChangesTests.m */, + 8813874F17AEE9760091C193 /* Supporting Files */, + ); + name = "Recipe 5-2 Significant Location ChangesTests"; + path = "Recipe 5-2: Significant Location ChangesTests"; + sourceTree = ""; + }; + 8813874F17AEE9760091C193 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8813875017AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests-Info.plist */, + 8813875117AEE9760091C193 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8813872517AEE9750091C193 /* Recipe 5-2 Significant Location Changes */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8813875817AEE9760091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-2 Significant Location Changes" */; + buildPhases = ( + 8813872217AEE9750091C193 /* Sources */, + 8813872317AEE9750091C193 /* Frameworks */, + 8813872417AEE9750091C193 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 5-2 Significant Location Changes"; + productName = "Recipe 5-2: Significant Location Changes"; + productReference = 8813872617AEE9750091C193 /* Recipe 5-2 Significant Location Changes.app */; + productType = "com.apple.product-type.application"; + }; + 8813874617AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8813875B17AEE9760091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-2 Significant Location ChangesTests" */; + buildPhases = ( + 8813874317AEE9760091C193 /* Sources */, + 8813874417AEE9760091C193 /* Frameworks */, + 8813874517AEE9760091C193 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8813874D17AEE9760091C193 /* PBXTargetDependency */, + ); + name = "Recipe 5-2 Significant Location ChangesTests"; + productName = "Recipe 5-2: Significant Location ChangesTests"; + productReference = 8813874717AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8813871E17AEE9750091C193 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8813874617AEE9760091C193 = { + TestTargetID = 8813872517AEE9750091C193; + }; + }; + }; + buildConfigurationList = 8813872117AEE9750091C193 /* Build configuration list for PBXProject "Recipe 5-2 Significant Location Changes" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8813871D17AEE9750091C193; + productRefGroup = 8813872717AEE9750091C193 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8813872517AEE9750091C193 /* Recipe 5-2 Significant Location Changes */, + 8813874617AEE9760091C193 /* Recipe 5-2 Significant Location ChangesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8813872417AEE9750091C193 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813874217AEE9750091C193 /* Images.xcassets in Resources */, + 8813873417AEE9750091C193 /* InfoPlist.strings in Resources */, + 8813873D17AEE9750091C193 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8813874517AEE9760091C193 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813875317AEE9760091C193 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8813872217AEE9750091C193 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813874017AEE9750091C193 /* ViewController.m in Sources */, + 8813873A17AEE9750091C193 /* AppDelegate.m in Sources */, + 8813873617AEE9750091C193 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8813874317AEE9760091C193 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8813875517AEE9760091C193 /* Recipe_5_2__Significant_Location_ChangesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8813874D17AEE9760091C193 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8813872517AEE9750091C193 /* Recipe 5-2 Significant Location Changes */; + targetProxy = 8813874C17AEE9760091C193 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8813873217AEE9750091C193 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8813873317AEE9750091C193 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8813873B17AEE9750091C193 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8813873C17AEE9750091C193 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8813875117AEE9760091C193 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8813875217AEE9760091C193 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8813875617AEE9760091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8813875717AEE9760091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8813875917AEE9760091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-2: Significant Location Changes/Recipe 5-2 Significant Location Changes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-2: Significant Location Changes/Recipe 5-2 Significant Location Changes-Info.plist"; + PRODUCT_NAME = "Recipe 5-2 Significant Location Changes"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8813875A17AEE9760091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-2: Significant Location Changes/Recipe 5-2 Significant Location Changes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-2: Significant Location Changes/Recipe 5-2 Significant Location Changes-Info.plist"; + PRODUCT_NAME = "Recipe 5-2 Significant Location Changes"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8813875C17AEE9760091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-2: Significant Location Changes.app/Recipe 5-2: Significant Location Changes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-2: Significant Location Changes/Recipe 5-2: Significant Location Changes-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 5-2: Significant Location ChangesTests/Recipe 5-2 Significant Location ChangesTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-2 Significant Location ChangesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8813875D17AEE9760091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-2: Significant Location Changes.app/Recipe 5-2: Significant Location Changes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-2: Significant Location Changes/Recipe 5-2: Significant Location Changes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-2: Significant Location ChangesTests/Recipe 5-2 Significant Location ChangesTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-2 Significant Location ChangesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8813872117AEE9750091C193 /* Build configuration list for PBXProject "Recipe 5-2 Significant Location Changes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8813875617AEE9760091C193 /* Debug */, + 8813875717AEE9760091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8813875817AEE9760091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-2 Significant Location Changes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8813875917AEE9760091C193 /* Debug */, + 8813875A17AEE9760091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8813875B17AEE9760091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-2 Significant Location ChangesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8813875C17AEE9760091C193 /* Debug */, + 8813875D17AEE9760091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8813871E17AEE9750091C193 /* Project object */; +} diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..184cd56 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman (1).xcuserdatad/UserInterfaceState.xcuserstate b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman (1).xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..b1c20cc Binary files /dev/null and b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman (1).xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..98b6a9e Binary files /dev/null and b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-2_ Significant Location Changes.xcscheme b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-2_ Significant Location Changes.xcscheme new file mode 100644 index 0000000..9a4b7e2 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-2_ Significant Location Changes.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ac535d2 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 5-2: Significant Location Changes.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8813872517AEE9750091C193 + + primary + + + 8813874617AEE9760091C193 + + primary + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/AppDelegate.h b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/AppDelegate.h new file mode 100644 index 0000000..35ad5bb --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 5-2: Significant Location Changes +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/AppDelegate.m b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/AppDelegate.m new file mode 100644 index 0000000..8522944 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 5-2: Significant Location Changes +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Base.lproj/Main.storyboard b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bb61049 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Base.lproj/Main.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes-Info.plist b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes-Info.plist new file mode 100644 index 0000000..45f7d49 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes-Info.plist @@ -0,0 +1,44 @@ + + + + + UIBackgroundModes + + location + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes-Prefix.pch b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/Recipe 5-2 Significant Location Changes-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/ViewController.h b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/ViewController.h new file mode 100644 index 0000000..606a84a --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/ViewController.h @@ -0,0 +1,23 @@ +// +// ViewController.h +// Recipe 5-2: Significant Location Changes +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + + CLLocationManager *_locationManager; +} + +@property (weak, nonatomic) IBOutlet UITextView *locationInformationView; +@property (weak, nonatomic) IBOutlet UISwitch *locationUpdatesSwitch; + +- (IBAction)toggleLocationUpdates:(id)sender; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/ViewController.m b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/ViewController.m new file mode 100644 index 0000000..6f3959e --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/ViewController.m @@ -0,0 +1,115 @@ +// +// ViewController.m +// Recipe 5-2: Significant Location Changes +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} + +- (IBAction)toggleLocationUpdates:(id)sender +{ + if (self.locationUpdatesSwitch.on == YES) + { + if ([CLLocationManager locationServicesEnabled] == NO) + { + UIAlertView *locationServicesDisabledAlert = [[UIAlertView alloc] initWithTitle:@"Location Services Disabled" message:@"This feature requires location services. Enable it in the privacy settings on your device" delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; + [locationServicesDisabledAlert show]; + self.locationUpdatesSwitch.on = NO; + return; + } + + if (_locationManager == nil) + { + _locationManager = [[CLLocationManager alloc] init]; + // Significant location change service does not use accuracy, distance filter + // or activity type properties + //_locationManager.desiredAccuracy = kCLLocationAccuracyBest; + //_locationManager.distanceFilter = 1; // meter + //_locationManager.activityType = CLActivityTypeOther; + _locationManager.delegate = self; + + + } + [_locationManager startMonitoringSignificantLocationChanges]; + } + else + { + // Switch was turned Off + // Stop updates if they have been started + if (_locationManager != nil) + { + [_locationManager stopMonitoringSignificantLocationChanges]; + } + } +} + +- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +{ + if (error.code == kCLErrorDenied) + { + // Turning the switch to off will trigger the toggleLocationServices action, + // which in turn will stop further updates from coming + self.locationUpdatesSwitch.on = NO; + } + else + { + NSLog(@"%@", error); + } +} + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + // Make sure this is a recent location event + CLLocation *lastLocation = [locations lastObject]; + NSTimeInterval eventInterval = [lastLocation.timestamp timeIntervalSinceNow]; + if(abs(eventInterval) < 30.0) + { + // Make sure the event is accurate enough + if (lastLocation.horizontalAccuracy >= 0 && lastLocation.horizontalAccuracy < 20) + { + self.locationInformationView.text = lastLocation.description; + + UIApplication *myApp = [UIApplication sharedApplication]; + if ([myApp applicationState] == UIApplicationStateBackground) + { + UILocalNotification *notification = [[UILocalNotification alloc] init]; + notification.alertBody = [NSString stringWithFormat:@"New Location: %.3f, %.3f", + lastLocation.coordinate.latitude, lastLocation.coordinate.longitude]; + notification.alertAction = @"Ok"; + notification.soundName = UILocalNotificationDefaultSoundName; + //Increment the applicationIconBadgeNumber + notification.applicationIconBadgeNumber = + [myApp applicationIconBadgeNumber] + 1; + [myApp presentLocalNotificationNow: notification]; + + } + } + } +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/main.m b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/main.m new file mode 100644 index 0000000..9195c11 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location Changes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 5-2: Significant Location Changes +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/Recipe 5-2 Significant Location ChangesTests-Info.plist b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/Recipe 5-2 Significant Location ChangesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/Recipe 5-2 Significant Location ChangesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/Recipe_5_2__Significant_Location_ChangesTests.m b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/Recipe_5_2__Significant_Location_ChangesTests.m new file mode 100644 index 0000000..c4ab4d0 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/Recipe_5_2__Significant_Location_ChangesTests.m @@ -0,0 +1,36 @@ +// +// Recipe_5_2__Significant_Location_ChangesTests.m +// Recipe 5-2: Significant Location ChangesTests +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_5_2__Significant_Location_ChangesTests : XCTestCase + +@end + +@implementation Recipe_5_2__Significant_Location_ChangesTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-2_ Significant Location Changes/Recipe 5-2_ Significant Location ChangesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.pbxproj b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.pbxproj new file mode 100644 index 0000000..80d9e23 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 881387B017AF3A380091C193 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881387AF17AF3A380091C193 /* Foundation.framework */; }; + 881387B217AF3A380091C193 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881387B117AF3A380091C193 /* CoreGraphics.framework */; }; + 881387B417AF3A380091C193 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881387B317AF3A380091C193 /* UIKit.framework */; }; + 881387BA17AF3A380091C193 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881387B817AF3A380091C193 /* InfoPlist.strings */; }; + 881387BC17AF3A380091C193 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 881387BB17AF3A380091C193 /* main.m */; }; + 881387C017AF3A380091C193 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 881387BF17AF3A380091C193 /* AppDelegate.m */; }; + 881387C317AF3A390091C193 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881387C117AF3A390091C193 /* Main.storyboard */; }; + 881387C617AF3A390091C193 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881387C517AF3A390091C193 /* ViewController.m */; }; + 881387C817AF3A390091C193 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 881387C717AF3A390091C193 /* Images.xcassets */; }; + 881387CF17AF3A390091C193 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881387CE17AF3A390091C193 /* XCTest.framework */; }; + 881387D017AF3A390091C193 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881387AF17AF3A380091C193 /* Foundation.framework */; }; + 881387D117AF3A390091C193 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 881387B317AF3A380091C193 /* UIKit.framework */; }; + 881387D917AF3A390091C193 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 881387D717AF3A390091C193 /* InfoPlist.strings */; }; + 881387DB17AF3A390091C193 /* Recipe_5_3_Tracking_Magnetic_BearingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 881387DA17AF3A390091C193 /* Recipe_5_3_Tracking_Magnetic_BearingTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 881387D217AF3A390091C193 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 881387A417AF3A380091C193 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 881387AB17AF3A380091C193; + remoteInfo = "Recipe 5-3:Tracking Magnetic Bearing"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 881387AC17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 5-3 Tracking Magnetic Bearing.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881387AF17AF3A380091C193 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 881387B117AF3A380091C193 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 881387B317AF3A380091C193 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 881387B717AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-3 Tracking Magnetic Bearing-Info.plist"; sourceTree = ""; }; + 881387B917AF3A380091C193 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881387BB17AF3A380091C193 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 881387BD17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch"; sourceTree = ""; }; + 881387BE17AF3A380091C193 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 881387BF17AF3A380091C193 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 881387C217AF3A390091C193 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 881387C417AF3A390091C193 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 881387C517AF3A390091C193 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 881387C717AF3A390091C193 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 881387CD17AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 5-3 Tracking Magnetic BearingTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 881387CE17AF3A390091C193 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 881387D617AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-3 Tracking Magnetic BearingTests-Info.plist"; sourceTree = ""; }; + 881387D817AF3A390091C193 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 881387DA17AF3A390091C193 /* Recipe_5_3_Tracking_Magnetic_BearingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_5_3_Tracking_Magnetic_BearingTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 881387A917AF3A380091C193 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881387B217AF3A380091C193 /* CoreGraphics.framework in Frameworks */, + 881387B417AF3A380091C193 /* UIKit.framework in Frameworks */, + 881387B017AF3A380091C193 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881387CA17AF3A390091C193 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 881387CF17AF3A390091C193 /* XCTest.framework in Frameworks */, + 881387D117AF3A390091C193 /* UIKit.framework in Frameworks */, + 881387D017AF3A390091C193 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 881387A317AF3A380091C193 = { + isa = PBXGroup; + children = ( + 881387B517AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing */, + 881387D417AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests */, + 881387AE17AF3A380091C193 /* Frameworks */, + 881387AD17AF3A380091C193 /* Products */, + ); + sourceTree = ""; + }; + 881387AD17AF3A380091C193 /* Products */ = { + isa = PBXGroup; + children = ( + 881387AC17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing.app */, + 881387CD17AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 881387AE17AF3A380091C193 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 881387AF17AF3A380091C193 /* Foundation.framework */, + 881387B117AF3A380091C193 /* CoreGraphics.framework */, + 881387B317AF3A380091C193 /* UIKit.framework */, + 881387CE17AF3A390091C193 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 881387B517AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing */ = { + isa = PBXGroup; + children = ( + 881387BE17AF3A380091C193 /* AppDelegate.h */, + 881387BF17AF3A380091C193 /* AppDelegate.m */, + 881387C117AF3A390091C193 /* Main.storyboard */, + 881387C417AF3A390091C193 /* ViewController.h */, + 881387C517AF3A390091C193 /* ViewController.m */, + 881387C717AF3A390091C193 /* Images.xcassets */, + 881387B617AF3A380091C193 /* Supporting Files */, + ); + name = "Recipe 5-3 Tracking Magnetic Bearing"; + path = "Recipe 5-3:Tracking Magnetic Bearing"; + sourceTree = ""; + }; + 881387B617AF3A380091C193 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881387B717AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing-Info.plist */, + 881387B817AF3A380091C193 /* InfoPlist.strings */, + 881387BB17AF3A380091C193 /* main.m */, + 881387BD17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 881387D417AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests */ = { + isa = PBXGroup; + children = ( + 881387DA17AF3A390091C193 /* Recipe_5_3_Tracking_Magnetic_BearingTests.m */, + 881387D517AF3A390091C193 /* Supporting Files */, + ); + name = "Recipe 5-3 Tracking Magnetic BearingTests"; + path = "Recipe 5-3:Tracking Magnetic BearingTests"; + sourceTree = ""; + }; + 881387D517AF3A390091C193 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 881387D617AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests-Info.plist */, + 881387D717AF3A390091C193 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 881387AB17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881387DE17AF3A390091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-3 Tracking Magnetic Bearing" */; + buildPhases = ( + 881387A817AF3A380091C193 /* Sources */, + 881387A917AF3A380091C193 /* Frameworks */, + 881387AA17AF3A380091C193 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 5-3 Tracking Magnetic Bearing"; + productName = "Recipe 5-3:Tracking Magnetic Bearing"; + productReference = 881387AC17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing.app */; + productType = "com.apple.product-type.application"; + }; + 881387CC17AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 881387E117AF3A390091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-3 Tracking Magnetic BearingTests" */; + buildPhases = ( + 881387C917AF3A390091C193 /* Sources */, + 881387CA17AF3A390091C193 /* Frameworks */, + 881387CB17AF3A390091C193 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 881387D317AF3A390091C193 /* PBXTargetDependency */, + ); + name = "Recipe 5-3 Tracking Magnetic BearingTests"; + productName = "Recipe 5-3:Tracking Magnetic BearingTests"; + productReference = 881387CD17AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 881387A417AF3A380091C193 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 881387CC17AF3A390091C193 = { + TestTargetID = 881387AB17AF3A380091C193; + }; + }; + }; + buildConfigurationList = 881387A717AF3A380091C193 /* Build configuration list for PBXProject "Recipe 5-3 Tracking Magnetic Bearing" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 881387A317AF3A380091C193; + productRefGroup = 881387AD17AF3A380091C193 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 881387AB17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing */, + 881387CC17AF3A390091C193 /* Recipe 5-3 Tracking Magnetic BearingTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 881387AA17AF3A380091C193 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881387C817AF3A390091C193 /* Images.xcassets in Resources */, + 881387BA17AF3A380091C193 /* InfoPlist.strings in Resources */, + 881387C317AF3A390091C193 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881387CB17AF3A390091C193 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881387D917AF3A390091C193 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 881387A817AF3A380091C193 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881387C617AF3A390091C193 /* ViewController.m in Sources */, + 881387C017AF3A380091C193 /* AppDelegate.m in Sources */, + 881387BC17AF3A380091C193 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881387C917AF3A390091C193 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 881387DB17AF3A390091C193 /* Recipe_5_3_Tracking_Magnetic_BearingTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 881387D317AF3A390091C193 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 881387AB17AF3A380091C193 /* Recipe 5-3 Tracking Magnetic Bearing */; + targetProxy = 881387D217AF3A390091C193 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 881387B817AF3A380091C193 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881387B917AF3A380091C193 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 881387C117AF3A390091C193 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 881387C217AF3A390091C193 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 881387D717AF3A390091C193 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 881387D817AF3A390091C193 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 881387DC17AF3A390091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 881387DD17AF3A390091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 881387DF17AF3A390091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-3:Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-3:Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Info.plist"; + PRODUCT_NAME = "Recipe 5-3 Tracking Magnetic Bearing"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 881387E017AF3A390091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-3:Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-3:Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Info.plist"; + PRODUCT_NAME = "Recipe 5-3 Tracking Magnetic Bearing"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 881387E217AF3A390091C193 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-3:Tracking Magnetic Bearing.app/Recipe 5-3:Tracking Magnetic Bearing"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-3:Tracking Magnetic Bearing/Recipe 5-3:Tracking Magnetic Bearing-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 5-3:Tracking Magnetic BearingTests/Recipe 5-3 Tracking Magnetic BearingTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-3 Tracking Magnetic BearingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 881387E317AF3A390091C193 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-3:Tracking Magnetic Bearing.app/Recipe 5-3:Tracking Magnetic Bearing"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-3:Tracking Magnetic Bearing/Recipe 5-3:Tracking Magnetic Bearing-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-3:Tracking Magnetic BearingTests/Recipe 5-3 Tracking Magnetic BearingTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-3 Tracking Magnetic BearingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 881387A717AF3A380091C193 /* Build configuration list for PBXProject "Recipe 5-3 Tracking Magnetic Bearing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881387DC17AF3A390091C193 /* Debug */, + 881387DD17AF3A390091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881387DE17AF3A390091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-3 Tracking Magnetic Bearing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881387DF17AF3A390091C193 /* Debug */, + 881387E017AF3A390091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 881387E117AF3A390091C193 /* Build configuration list for PBXNativeTarget "Recipe 5-3 Tracking Magnetic BearingTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 881387E217AF3A390091C193 /* Debug */, + 881387E317AF3A390091C193 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 881387A417AF3A380091C193 /* Project object */; +} diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..efee9b0 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..d72245e Binary files /dev/null and b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..8f94031 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-3_Tracking Magnetic Bearing.xcscheme b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-3_Tracking Magnetic Bearing.xcscheme new file mode 100644 index 0000000..0aa537f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-3_Tracking Magnetic Bearing.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..70b06ab --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 5-3:Tracking Magnetic Bearing.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 881387AB17AF3A380091C193 + + primary + + + 881387CC17AF3A390091C193 + + primary + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/AppDelegate.h b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/AppDelegate.h new file mode 100644 index 0000000..3b3588a --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 5-3:Tracking Magnetic Bearing +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/AppDelegate.m b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/AppDelegate.m new file mode 100644 index 0000000..cb7d8d9 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 5-3:Tracking Magnetic Bearing +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Base.lproj/Main.storyboard b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Base.lproj/Main.storyboard new file mode 100644 index 0000000..52555dc --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Base.lproj/Main.storyboard @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Images.xcassets/AppIcon.appiconset/Contents.json b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Info.plist b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Info.plist new file mode 100644 index 0000000..b5ee487 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationUsageDescription + We're Testing standard location services + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3 Tracking Magnetic Bearing-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/ViewController.h b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/ViewController.h new file mode 100644 index 0000000..07e1d39 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/ViewController.h @@ -0,0 +1,24 @@ +// +// ViewController.h +// Recipe 5-3:Tracking Magnetic Bearing +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + + CLLocationManager *_locationManager; +} + +@property (weak, nonatomic) IBOutlet UITextView *headingInformationView; +@property (weak, nonatomic) IBOutlet UISwitch *headingUpdatesSwitch; + +- (IBAction)toggleHeadingUpdates:(id)sender; + +@end + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/ViewController.m b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/ViewController.m new file mode 100644 index 0000000..5d8d850 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/ViewController.m @@ -0,0 +1,98 @@ +// +// ViewController.m +// Recipe 5-3:Tracking Magnetic Bearing +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} + +- (IBAction)toggleHeadingUpdates:(id)sender +{ + if (self.headingUpdatesSwitch.on == YES) + { + + // Heading data is not available on all devices + if ([CLLocationManager headingAvailable] == NO) + { + self.headingInformationView.text = @"Heading services unavailable"; + self.headingUpdatesSwitch.on = NO; + return; + } + + if (_locationManager == nil) + { + _locationManager = [[CLLocationManager alloc] init]; + _locationManager.headingFilter = 5; // degrees + _locationManager.delegate = self; + + + } + [_locationManager startUpdatingHeading]; + self.headingInformationView.text = @"Starting heading tracking..."; + } + else + { + // Switch was turned Off + self.headingInformationView.text = @"Stopped heading tracking..."; + // Stop updates if they have been started + if (_locationManager != nil) + { + [_locationManager stopUpdatingHeading]; + } + } +} + +- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +{ + NSLog(@"Error while tracking heading: %@", error); +} + +-(void)locationManager:(CLLocationManager *)manager + didUpdateHeading:(CLHeading *)newHeading +{ + NSTimeInterval headingInterval = [newHeading.timestamp timeIntervalSinceNow]; + // Check if reading is recent + if(abs(headingInterval) < 30) + { + // Check if reading is valid + if(newHeading.headingAccuracy < 0) + return; + + self.headingInformationView.text = + [NSString stringWithFormat:@"%.1f°", newHeading.magneticHeading]; + } +} + +-(BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager +{ + return YES; +} + + + +@end diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/main.m b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/main.m new file mode 100644 index 0000000..9adbd41 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic Bearing/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 5-3:Tracking Magnetic Bearing +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/Recipe 5-3 Tracking Magnetic BearingTests-Info.plist b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/Recipe 5-3 Tracking Magnetic BearingTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/Recipe 5-3 Tracking Magnetic BearingTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/Recipe_5_3_Tracking_Magnetic_BearingTests.m b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/Recipe_5_3_Tracking_Magnetic_BearingTests.m new file mode 100644 index 0000000..f213f1c --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/Recipe_5_3_Tracking_Magnetic_BearingTests.m @@ -0,0 +1,36 @@ +// +// Recipe_5_3_Tracking_Magnetic_BearingTests.m +// Recipe 5-3:Tracking Magnetic BearingTests +// +// Created by joseph hoffman on 8/4/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_5_3_Tracking_Magnetic_BearingTests : XCTestCase + +@end + +@implementation Recipe_5_3_Tracking_Magnetic_BearingTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-3_Tracking Magnetic Bearing/Recipe 5-3_Tracking Magnetic BearingTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.pbxproj b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.pbxproj new file mode 100644 index 0000000..bf620f5 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 886B9D9417B179E500204701 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9D9317B179E500204701 /* Foundation.framework */; }; + 886B9D9617B179E500204701 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9D9517B179E500204701 /* CoreGraphics.framework */; }; + 886B9D9817B179E500204701 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9D9717B179E500204701 /* UIKit.framework */; }; + 886B9D9E17B179E600204701 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886B9D9C17B179E600204701 /* InfoPlist.strings */; }; + 886B9DA017B179E600204701 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9D9F17B179E600204701 /* main.m */; }; + 886B9DA417B179E600204701 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9DA317B179E600204701 /* AppDelegate.m */; }; + 886B9DA717B179E600204701 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 886B9DA517B179E600204701 /* Main.storyboard */; }; + 886B9DAA17B179E600204701 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9DA917B179E600204701 /* ViewController.m */; }; + 886B9DAC17B179E600204701 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 886B9DAB17B179E600204701 /* Images.xcassets */; }; + 886B9DB317B179E600204701 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9DB217B179E600204701 /* XCTest.framework */; }; + 886B9DB417B179E600204701 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9D9317B179E500204701 /* Foundation.framework */; }; + 886B9DB517B179E600204701 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9D9717B179E500204701 /* UIKit.framework */; }; + 886B9DBD17B179E600204701 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886B9DBB17B179E600204701 /* InfoPlist.strings */; }; + 886B9DBF17B179E600204701 /* Recipe_5_4__Tracking_True_BearingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9DBE17B179E600204701 /* Recipe_5_4__Tracking_True_BearingTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 886B9DB617B179E600204701 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 886B9D8817B179E500204701 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 886B9D8F17B179E500204701; + remoteInfo = "Recipe 5-4: Tracking True Bearing"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 886B9D9017B179E500204701 /* Recipe 5-4 Tracking True Bearing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 5-4 Tracking True Bearing.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886B9D9317B179E500204701 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 886B9D9517B179E500204701 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 886B9D9717B179E500204701 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 886B9D9B17B179E600204701 /* Recipe 5-4 Tracking True Bearing-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-4 Tracking True Bearing-Info.plist"; sourceTree = ""; }; + 886B9D9D17B179E600204701 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886B9D9F17B179E600204701 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 886B9DA117B179E600204701 /* Recipe 5-4 Tracking True Bearing-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 5-4 Tracking True Bearing-Prefix.pch"; sourceTree = ""; }; + 886B9DA217B179E600204701 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 886B9DA317B179E600204701 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 886B9DA617B179E600204701 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 886B9DA817B179E600204701 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 886B9DA917B179E600204701 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 886B9DAB17B179E600204701 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 886B9DB117B179E600204701 /* Recipe 5-4 Tracking True BearingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 5-4 Tracking True BearingTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886B9DB217B179E600204701 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 886B9DBA17B179E600204701 /* Recipe 5-4 Tracking True BearingTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-4 Tracking True BearingTests-Info.plist"; sourceTree = ""; }; + 886B9DBC17B179E600204701 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886B9DBE17B179E600204701 /* Recipe_5_4__Tracking_True_BearingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_5_4__Tracking_True_BearingTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 886B9D8D17B179E500204701 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9D9617B179E500204701 /* CoreGraphics.framework in Frameworks */, + 886B9D9817B179E500204701 /* UIKit.framework in Frameworks */, + 886B9D9417B179E500204701 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886B9DAE17B179E600204701 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DB317B179E600204701 /* XCTest.framework in Frameworks */, + 886B9DB517B179E600204701 /* UIKit.framework in Frameworks */, + 886B9DB417B179E600204701 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 886B9D8717B179E500204701 = { + isa = PBXGroup; + children = ( + 886B9D9917B179E500204701 /* Recipe 5-4 Tracking True Bearing */, + 886B9DB817B179E600204701 /* Recipe 5-4 Tracking True BearingTests */, + 886B9D9217B179E500204701 /* Frameworks */, + 886B9D9117B179E500204701 /* Products */, + ); + sourceTree = ""; + }; + 886B9D9117B179E500204701 /* Products */ = { + isa = PBXGroup; + children = ( + 886B9D9017B179E500204701 /* Recipe 5-4 Tracking True Bearing.app */, + 886B9DB117B179E600204701 /* Recipe 5-4 Tracking True BearingTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 886B9D9217B179E500204701 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 886B9D9317B179E500204701 /* Foundation.framework */, + 886B9D9517B179E500204701 /* CoreGraphics.framework */, + 886B9D9717B179E500204701 /* UIKit.framework */, + 886B9DB217B179E600204701 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 886B9D9917B179E500204701 /* Recipe 5-4 Tracking True Bearing */ = { + isa = PBXGroup; + children = ( + 886B9DA217B179E600204701 /* AppDelegate.h */, + 886B9DA317B179E600204701 /* AppDelegate.m */, + 886B9DA517B179E600204701 /* Main.storyboard */, + 886B9DA817B179E600204701 /* ViewController.h */, + 886B9DA917B179E600204701 /* ViewController.m */, + 886B9DAB17B179E600204701 /* Images.xcassets */, + 886B9D9A17B179E600204701 /* Supporting Files */, + ); + name = "Recipe 5-4 Tracking True Bearing"; + path = "Recipe 5-4: Tracking True Bearing"; + sourceTree = ""; + }; + 886B9D9A17B179E600204701 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886B9D9B17B179E600204701 /* Recipe 5-4 Tracking True Bearing-Info.plist */, + 886B9D9C17B179E600204701 /* InfoPlist.strings */, + 886B9D9F17B179E600204701 /* main.m */, + 886B9DA117B179E600204701 /* Recipe 5-4 Tracking True Bearing-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 886B9DB817B179E600204701 /* Recipe 5-4 Tracking True BearingTests */ = { + isa = PBXGroup; + children = ( + 886B9DBE17B179E600204701 /* Recipe_5_4__Tracking_True_BearingTests.m */, + 886B9DB917B179E600204701 /* Supporting Files */, + ); + name = "Recipe 5-4 Tracking True BearingTests"; + path = "Recipe 5-4: Tracking True BearingTests"; + sourceTree = ""; + }; + 886B9DB917B179E600204701 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886B9DBA17B179E600204701 /* Recipe 5-4 Tracking True BearingTests-Info.plist */, + 886B9DBB17B179E600204701 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 886B9D8F17B179E500204701 /* Recipe 5-4 Tracking True Bearing */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886B9DC217B179E600204701 /* Build configuration list for PBXNativeTarget "Recipe 5-4 Tracking True Bearing" */; + buildPhases = ( + 886B9D8C17B179E500204701 /* Sources */, + 886B9D8D17B179E500204701 /* Frameworks */, + 886B9D8E17B179E500204701 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 5-4 Tracking True Bearing"; + productName = "Recipe 5-4: Tracking True Bearing"; + productReference = 886B9D9017B179E500204701 /* Recipe 5-4 Tracking True Bearing.app */; + productType = "com.apple.product-type.application"; + }; + 886B9DB017B179E600204701 /* Recipe 5-4 Tracking True BearingTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886B9DC517B179E600204701 /* Build configuration list for PBXNativeTarget "Recipe 5-4 Tracking True BearingTests" */; + buildPhases = ( + 886B9DAD17B179E600204701 /* Sources */, + 886B9DAE17B179E600204701 /* Frameworks */, + 886B9DAF17B179E600204701 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 886B9DB717B179E600204701 /* PBXTargetDependency */, + ); + name = "Recipe 5-4 Tracking True BearingTests"; + productName = "Recipe 5-4: Tracking True BearingTests"; + productReference = 886B9DB117B179E600204701 /* Recipe 5-4 Tracking True BearingTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 886B9D8817B179E500204701 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 886B9DB017B179E600204701 = { + TestTargetID = 886B9D8F17B179E500204701; + }; + }; + }; + buildConfigurationList = 886B9D8B17B179E500204701 /* Build configuration list for PBXProject "Recipe 5-4 Tracking True Bearing" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 886B9D8717B179E500204701; + productRefGroup = 886B9D9117B179E500204701 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 886B9D8F17B179E500204701 /* Recipe 5-4 Tracking True Bearing */, + 886B9DB017B179E600204701 /* Recipe 5-4 Tracking True BearingTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 886B9D8E17B179E500204701 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DAC17B179E600204701 /* Images.xcassets in Resources */, + 886B9D9E17B179E600204701 /* InfoPlist.strings in Resources */, + 886B9DA717B179E600204701 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886B9DAF17B179E600204701 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DBD17B179E600204701 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 886B9D8C17B179E500204701 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DAA17B179E600204701 /* ViewController.m in Sources */, + 886B9DA417B179E600204701 /* AppDelegate.m in Sources */, + 886B9DA017B179E600204701 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886B9DAD17B179E600204701 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DBF17B179E600204701 /* Recipe_5_4__Tracking_True_BearingTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 886B9DB717B179E600204701 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 886B9D8F17B179E500204701 /* Recipe 5-4 Tracking True Bearing */; + targetProxy = 886B9DB617B179E600204701 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 886B9D9C17B179E600204701 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886B9D9D17B179E600204701 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 886B9DA517B179E600204701 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 886B9DA617B179E600204701 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 886B9DBB17B179E600204701 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886B9DBC17B179E600204701 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 886B9DC017B179E600204701 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 886B9DC117B179E600204701 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 886B9DC317B179E600204701 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-4: Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-4: Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Info.plist"; + PRODUCT_NAME = "Recipe 5-4 Tracking True Bearing"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 886B9DC417B179E600204701 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-4: Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-4: Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Info.plist"; + PRODUCT_NAME = "Recipe 5-4 Tracking True Bearing"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 886B9DC617B179E600204701 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-4: Tracking True Bearing.app/Recipe 5-4: Tracking True Bearing"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-4: Tracking True Bearing/Recipe 5-4: Tracking True Bearing-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 5-4: Tracking True BearingTests/Recipe 5-4 Tracking True BearingTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-4 Tracking True BearingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 886B9DC717B179E600204701 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-4: Tracking True Bearing.app/Recipe 5-4: Tracking True Bearing"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-4: Tracking True Bearing/Recipe 5-4: Tracking True Bearing-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-4: Tracking True BearingTests/Recipe 5-4 Tracking True BearingTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-4 Tracking True BearingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 886B9D8B17B179E500204701 /* Build configuration list for PBXProject "Recipe 5-4 Tracking True Bearing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886B9DC017B179E600204701 /* Debug */, + 886B9DC117B179E600204701 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886B9DC217B179E600204701 /* Build configuration list for PBXNativeTarget "Recipe 5-4 Tracking True Bearing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886B9DC317B179E600204701 /* Debug */, + 886B9DC417B179E600204701 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886B9DC517B179E600204701 /* Build configuration list for PBXNativeTarget "Recipe 5-4 Tracking True BearingTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886B9DC617B179E600204701 /* Debug */, + 886B9DC717B179E600204701 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 886B9D8817B179E500204701 /* Project object */; +} diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..845d63a --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..e02872f Binary files /dev/null and b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-4_ Tracking True Bearing.xcscheme b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-4_ Tracking True Bearing.xcscheme new file mode 100644 index 0000000..2d58a35 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-4_ Tracking True Bearing.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..7e49628 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 5-4: Tracking True Bearing.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 886B9D8F17B179E500204701 + + primary + + + 886B9DB017B179E600204701 + + primary + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/AppDelegate.h b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/AppDelegate.h new file mode 100644 index 0000000..9d012d4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 5-4: Tracking True Bearing +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/AppDelegate.m b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/AppDelegate.m new file mode 100644 index 0000000..9e2fc78 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 5-4: Tracking True Bearing +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Base.lproj/Main.storyboard b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Base.lproj/Main.storyboard new file mode 100644 index 0000000..0aa6343 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Base.lproj/Main.storyboard @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Images.xcassets/AppIcon.appiconset/Contents.json b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Info.plist b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Info.plist new file mode 100644 index 0000000..5f1c653 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationUsageDescription + Testing True Bearing + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Prefix.pch b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/Recipe 5-4 Tracking True Bearing-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/ViewController.h b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/ViewController.h new file mode 100644 index 0000000..82b51da --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/ViewController.h @@ -0,0 +1,25 @@ +// +// ViewController.h +// Recipe 5-4: Tracking True Bearing +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + + CLLocationManager *_locationManager; +} + +@property (weak, nonatomic) IBOutlet UITextView *headingInformationView; +@property (weak, nonatomic) IBOutlet UITextView *trueHeadingInformationView; +@property (weak, nonatomic) IBOutlet UISwitch *headingUpdatesSwitch; + +- (IBAction)toggleHeadingUpdates:(id)sender; + +@end + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/ViewController.m b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/ViewController.m new file mode 100644 index 0000000..3e41b88 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/ViewController.m @@ -0,0 +1,129 @@ +// +// ViewController.m +// Recipe 5-4: Tracking True Bearing +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} + +- (IBAction)toggleHeadingUpdates:(id)sender +{ + if (self.headingUpdatesSwitch.on == YES) + { + // Heading data is not available on all devices + if ([CLLocationManager headingAvailable] == NO) + { + self.headingInformationView.text = @"Heading services unavailable"; + self.headingUpdatesSwitch.on = NO; + return; + } + + if ([CLLocationManager locationServicesEnabled] == NO) + { + UIAlertView *locationServicesDisabledAlert = + [[UIAlertView alloc] initWithTitle:@"Location Services Disabled" + message:@"This feature requires location services. Enable it in the privacy settings on your device" + delegate:nil + cancelButtonTitle:@"Dismiss" + otherButtonTitles:nil]; + + [locationServicesDisabledAlert show]; + self.headingUpdatesSwitch.on = NO; + return; + } + + if (_locationManager == nil) + { + _locationManager = [[CLLocationManager alloc] init]; + _locationManager.headingFilter = 5; // degrees + _locationManager.delegate = self; + + // For backward compatibility, set the deprecated purpose property + // to the same as NSLocationUsageDescription in the Info.plist + _locationManager.purpose = [[NSBundle mainBundle] + objectForInfoDictionaryKey:@"NSLocationUsageDescription"]; + } + [_locationManager startUpdatingHeading]; + // Start location service in order to get true heading + [_locationManager startUpdatingLocation]; + self.headingInformationView.text = @"Starting heading tracking..."; + } + else + { + // Switch was turned Off + self.headingInformationView.text = @"Stopped heading tracking"; + // Stop updates if they have been started + if (_locationManager != nil) + { + [_locationManager stopUpdatingHeading]; + [_locationManager stopUpdatingLocation]; + } + } +} + +- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +{ + if (error.code == kCLErrorDenied) + { + // Turning the switch to off will indirectly stop + // further updates from coming + self.headingUpdatesSwitch.on = NO; + } + else + { + NSLog(@"%@", error); + } +} + +-(void)locationManager:(CLLocationManager *)manager + didUpdateHeading:(CLHeading *)newHeading +{ + NSTimeInterval headingInterval = [newHeading.timestamp timeIntervalSinceNow]; + // Check if reading is recent + if(abs(headingInterval) < 30) + { + // Check if reading is valid + if(newHeading.headingAccuracy < 0) + return; + + self.headingInformationView.text = + [NSString stringWithFormat:@"Magnetic Heading: %.1f°", newHeading.magneticHeading]; + + if(newHeading.trueHeading >= 0) + self.trueHeadingInformationView.text = [NSString stringWithFormat: @"True Heading: %.1f°", newHeading.trueHeading]; + } +} + +-(BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager +{ + return YES; +} + + + +@end \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/main.m b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/main.m new file mode 100644 index 0000000..95f2be2 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True Bearing/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 5-4: Tracking True Bearing +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/Recipe 5-4 Tracking True BearingTests-Info.plist b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/Recipe 5-4 Tracking True BearingTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/Recipe 5-4 Tracking True BearingTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/Recipe_5_4__Tracking_True_BearingTests.m b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/Recipe_5_4__Tracking_True_BearingTests.m new file mode 100644 index 0000000..0c6beb3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/Recipe_5_4__Tracking_True_BearingTests.m @@ -0,0 +1,36 @@ +// +// Recipe_5_4__Tracking_True_BearingTests.m +// Recipe 5-4: Tracking True BearingTests +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_5_4__Tracking_True_BearingTests : XCTestCase + +@end + +@implementation Recipe_5_4__Tracking_True_BearingTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-4_ Tracking True Bearing/Recipe 5-4_ Tracking True BearingTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.pbxproj b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.pbxproj new file mode 100644 index 0000000..82015c8 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 886B9DD517B1CE8800204701 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9DD417B1CE8800204701 /* Foundation.framework */; }; + 886B9DD717B1CE8800204701 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9DD617B1CE8800204701 /* CoreGraphics.framework */; }; + 886B9DD917B1CE8800204701 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9DD817B1CE8800204701 /* UIKit.framework */; }; + 886B9DDF17B1CE8800204701 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886B9DDD17B1CE8800204701 /* InfoPlist.strings */; }; + 886B9DE117B1CE8800204701 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9DE017B1CE8800204701 /* main.m */; }; + 886B9DE517B1CE8800204701 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9DE417B1CE8800204701 /* AppDelegate.m */; }; + 886B9DE817B1CE8800204701 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 886B9DE617B1CE8800204701 /* Main.storyboard */; }; + 886B9DEB17B1CE8800204701 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9DEA17B1CE8800204701 /* ViewController.m */; }; + 886B9DED17B1CE8800204701 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 886B9DEC17B1CE8800204701 /* Images.xcassets */; }; + 886B9DF417B1CE8800204701 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9DF317B1CE8800204701 /* XCTest.framework */; }; + 886B9DF517B1CE8800204701 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9DD417B1CE8800204701 /* Foundation.framework */; }; + 886B9DF617B1CE8800204701 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9DD817B1CE8800204701 /* UIKit.framework */; }; + 886B9DFE17B1CE8800204701 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 886B9DFC17B1CE8800204701 /* InfoPlist.strings */; }; + 886B9E0017B1CE8800204701 /* Recipe_5_5__Region_MonitoringTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 886B9DFF17B1CE8800204701 /* Recipe_5_5__Region_MonitoringTests.m */; }; + 886B9E0A17B1CECE00204701 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 886B9E0917B1CECD00204701 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 886B9DF717B1CE8800204701 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 886B9DC917B1CE8700204701 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 886B9DD017B1CE8800204701; + remoteInfo = "Recipe 5-5: Region Monitoring"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 886B9DD117B1CE8800204701 /* Recipe 5-5 Region Monitoring.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 5-5 Region Monitoring.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886B9DD417B1CE8800204701 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 886B9DD617B1CE8800204701 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 886B9DD817B1CE8800204701 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 886B9DDC17B1CE8800204701 /* Recipe 5-5: Region Monitoring-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-5: Region Monitoring-Info.plist"; sourceTree = ""; }; + 886B9DDE17B1CE8800204701 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886B9DE017B1CE8800204701 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 886B9DE217B1CE8800204701 /* Recipe 5-5 Region Monitoring-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 5-5 Region Monitoring-Prefix.pch"; sourceTree = ""; }; + 886B9DE317B1CE8800204701 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 886B9DE417B1CE8800204701 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 886B9DE717B1CE8800204701 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 886B9DE917B1CE8800204701 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 886B9DEA17B1CE8800204701 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 886B9DEC17B1CE8800204701 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 886B9DF217B1CE8800204701 /* Recipe 5-5 Region MonitoringTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 5-5 Region MonitoringTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 886B9DF317B1CE8800204701 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 886B9DFB17B1CE8800204701 /* Recipe 5-5 Region MonitoringTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-5 Region MonitoringTests-Info.plist"; sourceTree = ""; }; + 886B9DFD17B1CE8800204701 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 886B9DFF17B1CE8800204701 /* Recipe_5_5__Region_MonitoringTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_5_5__Region_MonitoringTests.m; sourceTree = ""; }; + 886B9E0917B1CECD00204701 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 886B9DCE17B1CE8800204701 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9E0A17B1CECE00204701 /* CoreLocation.framework in Frameworks */, + 886B9DD717B1CE8800204701 /* CoreGraphics.framework in Frameworks */, + 886B9DD917B1CE8800204701 /* UIKit.framework in Frameworks */, + 886B9DD517B1CE8800204701 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886B9DEF17B1CE8800204701 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DF417B1CE8800204701 /* XCTest.framework in Frameworks */, + 886B9DF617B1CE8800204701 /* UIKit.framework in Frameworks */, + 886B9DF517B1CE8800204701 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 886B9DC817B1CE8700204701 = { + isa = PBXGroup; + children = ( + 886B9DDA17B1CE8800204701 /* Recipe 5-5 Region Monitoring */, + 886B9DF917B1CE8800204701 /* Recipe 5-5 Region MonitoringTests */, + 886B9DD317B1CE8800204701 /* Frameworks */, + 886B9DD217B1CE8800204701 /* Products */, + ); + sourceTree = ""; + }; + 886B9DD217B1CE8800204701 /* Products */ = { + isa = PBXGroup; + children = ( + 886B9DD117B1CE8800204701 /* Recipe 5-5 Region Monitoring.app */, + 886B9DF217B1CE8800204701 /* Recipe 5-5 Region MonitoringTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 886B9DD317B1CE8800204701 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 886B9E0917B1CECD00204701 /* CoreLocation.framework */, + 886B9DD417B1CE8800204701 /* Foundation.framework */, + 886B9DD617B1CE8800204701 /* CoreGraphics.framework */, + 886B9DD817B1CE8800204701 /* UIKit.framework */, + 886B9DF317B1CE8800204701 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 886B9DDA17B1CE8800204701 /* Recipe 5-5 Region Monitoring */ = { + isa = PBXGroup; + children = ( + 886B9DE317B1CE8800204701 /* AppDelegate.h */, + 886B9DE417B1CE8800204701 /* AppDelegate.m */, + 886B9DE617B1CE8800204701 /* Main.storyboard */, + 886B9DE917B1CE8800204701 /* ViewController.h */, + 886B9DEA17B1CE8800204701 /* ViewController.m */, + 886B9DEC17B1CE8800204701 /* Images.xcassets */, + 886B9DDB17B1CE8800204701 /* Supporting Files */, + ); + name = "Recipe 5-5 Region Monitoring"; + path = "Recipe 5-5: Region Monitoring"; + sourceTree = ""; + }; + 886B9DDB17B1CE8800204701 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886B9DDC17B1CE8800204701 /* Recipe 5-5: Region Monitoring-Info.plist */, + 886B9DDD17B1CE8800204701 /* InfoPlist.strings */, + 886B9DE017B1CE8800204701 /* main.m */, + 886B9DE217B1CE8800204701 /* Recipe 5-5 Region Monitoring-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 886B9DF917B1CE8800204701 /* Recipe 5-5 Region MonitoringTests */ = { + isa = PBXGroup; + children = ( + 886B9DFF17B1CE8800204701 /* Recipe_5_5__Region_MonitoringTests.m */, + 886B9DFA17B1CE8800204701 /* Supporting Files */, + ); + name = "Recipe 5-5 Region MonitoringTests"; + path = "Recipe 5-5: Region MonitoringTests"; + sourceTree = ""; + }; + 886B9DFA17B1CE8800204701 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 886B9DFB17B1CE8800204701 /* Recipe 5-5 Region MonitoringTests-Info.plist */, + 886B9DFC17B1CE8800204701 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 886B9DD017B1CE8800204701 /* Recipe 5-5 Region Monitoring */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886B9E0317B1CE8800204701 /* Build configuration list for PBXNativeTarget "Recipe 5-5 Region Monitoring" */; + buildPhases = ( + 886B9DCD17B1CE8800204701 /* Sources */, + 886B9DCE17B1CE8800204701 /* Frameworks */, + 886B9DCF17B1CE8800204701 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 5-5 Region Monitoring"; + productName = "Recipe 5-5: Region Monitoring"; + productReference = 886B9DD117B1CE8800204701 /* Recipe 5-5 Region Monitoring.app */; + productType = "com.apple.product-type.application"; + }; + 886B9DF117B1CE8800204701 /* Recipe 5-5 Region MonitoringTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 886B9E0617B1CE8800204701 /* Build configuration list for PBXNativeTarget "Recipe 5-5 Region MonitoringTests" */; + buildPhases = ( + 886B9DEE17B1CE8800204701 /* Sources */, + 886B9DEF17B1CE8800204701 /* Frameworks */, + 886B9DF017B1CE8800204701 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 886B9DF817B1CE8800204701 /* PBXTargetDependency */, + ); + name = "Recipe 5-5 Region MonitoringTests"; + productName = "Recipe 5-5: Region MonitoringTests"; + productReference = 886B9DF217B1CE8800204701 /* Recipe 5-5 Region MonitoringTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 886B9DC917B1CE8700204701 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 886B9DF117B1CE8800204701 = { + TestTargetID = 886B9DD017B1CE8800204701; + }; + }; + }; + buildConfigurationList = 886B9DCC17B1CE8700204701 /* Build configuration list for PBXProject "Recipe 5-5 Region Monitoring" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 886B9DC817B1CE8700204701; + productRefGroup = 886B9DD217B1CE8800204701 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 886B9DD017B1CE8800204701 /* Recipe 5-5 Region Monitoring */, + 886B9DF117B1CE8800204701 /* Recipe 5-5 Region MonitoringTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 886B9DCF17B1CE8800204701 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DED17B1CE8800204701 /* Images.xcassets in Resources */, + 886B9DDF17B1CE8800204701 /* InfoPlist.strings in Resources */, + 886B9DE817B1CE8800204701 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886B9DF017B1CE8800204701 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DFE17B1CE8800204701 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 886B9DCD17B1CE8800204701 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9DEB17B1CE8800204701 /* ViewController.m in Sources */, + 886B9DE517B1CE8800204701 /* AppDelegate.m in Sources */, + 886B9DE117B1CE8800204701 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 886B9DEE17B1CE8800204701 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 886B9E0017B1CE8800204701 /* Recipe_5_5__Region_MonitoringTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 886B9DF817B1CE8800204701 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 886B9DD017B1CE8800204701 /* Recipe 5-5 Region Monitoring */; + targetProxy = 886B9DF717B1CE8800204701 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 886B9DDD17B1CE8800204701 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886B9DDE17B1CE8800204701 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 886B9DE617B1CE8800204701 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 886B9DE717B1CE8800204701 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 886B9DFC17B1CE8800204701 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 886B9DFD17B1CE8800204701 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 886B9E0117B1CE8800204701 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 886B9E0217B1CE8800204701 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 886B9E0417B1CE8800204701 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-5: Region Monitoring/Recipe 5-5 Region Monitoring-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-5: Region Monitoring/Recipe 5-5: Region Monitoring-Info.plist"; + PRODUCT_NAME = "Recipe 5-5 Region Monitoring"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 886B9E0517B1CE8800204701 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-5: Region Monitoring/Recipe 5-5 Region Monitoring-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-5: Region Monitoring/Recipe 5-5: Region Monitoring-Info.plist"; + PRODUCT_NAME = "Recipe 5-5 Region Monitoring"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 886B9E0717B1CE8800204701 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-5: Region Monitoring.app/Recipe 5-5: Region Monitoring"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-5: Region Monitoring/Recipe 5-5: Region Monitoring-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 5-5: Region MonitoringTests/Recipe 5-5 Region MonitoringTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-5 Region MonitoringTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 886B9E0817B1CE8800204701 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-5: Region Monitoring.app/Recipe 5-5: Region Monitoring"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-5: Region Monitoring/Recipe 5-5: Region Monitoring-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-5: Region MonitoringTests/Recipe 5-5 Region MonitoringTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-5 Region MonitoringTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 886B9DCC17B1CE8700204701 /* Build configuration list for PBXProject "Recipe 5-5 Region Monitoring" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886B9E0117B1CE8800204701 /* Debug */, + 886B9E0217B1CE8800204701 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886B9E0317B1CE8800204701 /* Build configuration list for PBXNativeTarget "Recipe 5-5 Region Monitoring" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886B9E0417B1CE8800204701 /* Debug */, + 886B9E0517B1CE8800204701 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 886B9E0617B1CE8800204701 /* Build configuration list for PBXNativeTarget "Recipe 5-5 Region MonitoringTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 886B9E0717B1CE8800204701 /* Debug */, + 886B9E0817B1CE8800204701 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 886B9DC917B1CE8700204701 /* Project object */; +} diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0453cf9 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..931166a Binary files /dev/null and b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..068a984 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-5_ Region Monitoring.xcscheme b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-5_ Region Monitoring.xcscheme new file mode 100644 index 0000000..bca9e07 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-5_ Region Monitoring.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d657134 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 5-5: Region Monitoring.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 886B9DD017B1CE8800204701 + + primary + + + 886B9DF117B1CE8800204701 + + primary + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/AppDelegate.h b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/AppDelegate.h new file mode 100644 index 0000000..8d7b4fe --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 5-5: Region Monitoring +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/AppDelegate.m b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/AppDelegate.m new file mode 100644 index 0000000..c91fd68 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 5-5: Region Monitoring +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Base.lproj/Main.storyboard b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c84b442 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Base.lproj/Main.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Images.xcassets/AppIcon.appiconset/Contents.json b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2f35679 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring-Info.plist b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring-Info.plist new file mode 100644 index 0000000..5b1356f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring-Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationUsageDescription + "Testing Region Monitoring" + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring-Prefix.pch b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/Recipe 5-5 Region Monitoring-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/ViewController.h b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/ViewController.h new file mode 100644 index 0000000..5ccc48e --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Recipe 5-5: Region Monitoring +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + CLLocationManager *_locationManager; +} + +@property (strong, nonatomic) IBOutlet UITextView *regionInformationView; +@property (strong, nonatomic) IBOutlet UISwitch *regionMonitoringSwitch; + +- (IBAction)toggleRegionMonitoring:(id)sender; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/ViewController.m b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/ViewController.m new file mode 100644 index 0000000..dd00cea --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/ViewController.m @@ -0,0 +1,136 @@ +// +// ViewController.m +// Recipe 5-5: Region Monitoring +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (IBAction)toggleRegionMonitoring:(id)sender +{ + if (self.regionMonitoringSwitch.on == YES) + { + + CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; + + if (status == kCLAuthorizationStatusAuthorized || + status == kCLAuthorizationStatusNotDetermined) + { + if(_locationManager == nil) + { + _locationManager = [[CLLocationManager alloc] init]; + _locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; + _locationManager.delegate = self; + } + + CLLocationCoordinate2D denverCoordinate = + CLLocationCoordinate2DMake(39.7392, -104.9847); + int regionRadius = 3000; // meters + if (regionRadius > _locationManager.maximumRegionMonitoringDistance) + { + regionRadius = _locationManager.maximumRegionMonitoringDistance; + } + + + CLCircularRegion *denverRegion = [[CLCircularRegion alloc] initWithCenter:denverCoordinate + radius:regionRadius + identifier:@"denverRegion"]; + + + [_locationManager startMonitoringForRegion: denverRegion]; + } + else + { + self.regionInformationView.text = @"Region monitoring disabled"; + self.regionMonitoringSwitch.on = NO; + } + + + } + else + { + if (_locationManager!=nil) + { + for (CLCircularRegion *monitoredRegion in [_locationManager monitoredRegions]) + { + [_locationManager stopMonitoringForRegion:monitoredRegion]; + self.regionInformationView.text = + [NSString stringWithFormat:@"Turned off region monitoring for: %@", + monitoredRegion.identifier]; + } + } + } + +} + +-(void)locationManager:(CLLocationManager *)manager +monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error +{ + switch (error.code) + { + case kCLErrorRegionMonitoringDenied: + { + self.regionInformationView.text = + @"Region monitoring is denied on this device"; + break; + } + case kCLErrorRegionMonitoringFailure: + { + self.regionInformationView.text = + [NSString stringWithFormat:@"Region monitoring failed for region: %@", + region.identifier]; + break; + } + default: + { + self.regionInformationView.text = + [NSString stringWithFormat:@"An unhandled error occured: %@", + error.description]; + break; + } + } +} + +-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region +{ + self.regionInformationView.text = @"Welcome to Denver!"; + + UILocalNotification *entranceNotification = [[UILocalNotification alloc] init]; + entranceNotification.alertBody = @"Welcome to Denver!"; + entranceNotification.alertAction = @"Ok"; + entranceNotification.soundName = UILocalNotificationDefaultSoundName; + [[UIApplication sharedApplication] presentLocalNotificationNow: entranceNotification]; +} + +-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region +{ + self.regionInformationView.text = @"Thanks for visiting Denver! Come back soon!"; + + UILocalNotification *exitNotification = [[UILocalNotification alloc] init]; + exitNotification.alertBody = @"Thanks for visiting Denver! Come back soon!"; + exitNotification.alertAction = @"Ok"; + exitNotification.soundName = UILocalNotificationDefaultSoundName; + [[UIApplication sharedApplication] presentLocalNotificationNow: exitNotification]; +} + + +@end diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/main.m b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/main.m new file mode 100644 index 0000000..3c1a8f0 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region Monitoring/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 5-5: Region Monitoring +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/Recipe 5-5 Region MonitoringTests-Info.plist b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/Recipe 5-5 Region MonitoringTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/Recipe 5-5 Region MonitoringTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/Recipe_5_5__Region_MonitoringTests.m b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/Recipe_5_5__Region_MonitoringTests.m new file mode 100644 index 0000000..4d75a9a --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/Recipe_5_5__Region_MonitoringTests.m @@ -0,0 +1,36 @@ +// +// Recipe_5_5__Region_MonitoringTests.m +// Recipe 5-5: Region MonitoringTests +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_5_5__Region_MonitoringTests : XCTestCase + +@end + +@implementation Recipe_5_5__Region_MonitoringTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-5_ Region Monitoring/Recipe 5-5_ Region MonitoringTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.pbxproj b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d460171 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.pbxproj @@ -0,0 +1,486 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8841622C17B1E9AA007E266C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841622B17B1E9AA007E266C /* Foundation.framework */; }; + 8841622E17B1E9AA007E266C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841622D17B1E9AA007E266C /* CoreGraphics.framework */; }; + 8841623017B1E9AA007E266C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841622F17B1E9AA007E266C /* UIKit.framework */; }; + 8841623617B1E9AA007E266C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8841623417B1E9AA007E266C /* InfoPlist.strings */; }; + 8841623817B1E9AA007E266C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8841623717B1E9AA007E266C /* main.m */; }; + 8841623C17B1E9AA007E266C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8841623B17B1E9AA007E266C /* AppDelegate.m */; }; + 8841623F17B1E9AA007E266C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8841623D17B1E9AA007E266C /* Main.storyboard */; }; + 8841624217B1E9AA007E266C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8841624117B1E9AA007E266C /* ViewController.m */; }; + 8841624417B1E9AA007E266C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8841624317B1E9AA007E266C /* Images.xcassets */; }; + 8841624B17B1E9AA007E266C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841624A17B1E9AA007E266C /* XCTest.framework */; }; + 8841624C17B1E9AA007E266C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841622B17B1E9AA007E266C /* Foundation.framework */; }; + 8841624D17B1E9AA007E266C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841622F17B1E9AA007E266C /* UIKit.framework */; }; + 8841625517B1E9AA007E266C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8841625317B1E9AA007E266C /* InfoPlist.strings */; }; + 8841625717B1E9AA007E266C /* Recipe_5_6__Implementing_GeocodingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8841625617B1E9AA007E266C /* Recipe_5_6__Implementing_GeocodingTests.m */; }; + 8841626117B1EA06007E266C /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841626017B1EA06007E266C /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8841624E17B1E9AA007E266C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8841622017B1E9A9007E266C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8841622717B1E9A9007E266C; + remoteInfo = "Recipe 5-6: Implementing Geocoding"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8841622817B1E9A9007E266C /* Recipe 5-6 Implementing Geocoding.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 5-6 Implementing Geocoding.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8841622B17B1E9AA007E266C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 8841622D17B1E9AA007E266C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 8841622F17B1E9AA007E266C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8841623317B1E9AA007E266C /* Recipe 5-6 Implementing Geocoding-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-6 Implementing Geocoding-Info.plist"; sourceTree = ""; }; + 8841623517B1E9AA007E266C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8841623717B1E9AA007E266C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8841623917B1E9AA007E266C /* Recipe 5-6 Implementing Geocoding-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 5-6 Implementing Geocoding-Prefix.pch"; sourceTree = ""; }; + 8841623A17B1E9AA007E266C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8841623B17B1E9AA007E266C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8841623E17B1E9AA007E266C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8841624017B1E9AA007E266C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8841624117B1E9AA007E266C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8841624317B1E9AA007E266C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8841624917B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 5-6 Implementing GeocodingTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8841624A17B1E9AA007E266C /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 8841625217B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 5-6 Implementing GeocodingTests-Info.plist"; sourceTree = ""; }; + 8841625417B1E9AA007E266C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8841625617B1E9AA007E266C /* Recipe_5_6__Implementing_GeocodingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_5_6__Implementing_GeocodingTests.m; sourceTree = ""; }; + 8841626017B1EA06007E266C /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8841622517B1E9A9007E266C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8841626117B1EA06007E266C /* CoreLocation.framework in Frameworks */, + 8841622E17B1E9AA007E266C /* CoreGraphics.framework in Frameworks */, + 8841623017B1E9AA007E266C /* UIKit.framework in Frameworks */, + 8841622C17B1E9AA007E266C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8841624617B1E9AA007E266C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8841624B17B1E9AA007E266C /* XCTest.framework in Frameworks */, + 8841624D17B1E9AA007E266C /* UIKit.framework in Frameworks */, + 8841624C17B1E9AA007E266C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8841621F17B1E9A9007E266C = { + isa = PBXGroup; + children = ( + 8841623117B1E9AA007E266C /* Recipe 5-6 Implementing Geocoding */, + 8841625017B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests */, + 8841622A17B1E9A9007E266C /* Frameworks */, + 8841622917B1E9A9007E266C /* Products */, + ); + sourceTree = ""; + }; + 8841622917B1E9A9007E266C /* Products */ = { + isa = PBXGroup; + children = ( + 8841622817B1E9A9007E266C /* Recipe 5-6 Implementing Geocoding.app */, + 8841624917B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8841622A17B1E9A9007E266C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8841626017B1EA06007E266C /* CoreLocation.framework */, + 8841622B17B1E9AA007E266C /* Foundation.framework */, + 8841622D17B1E9AA007E266C /* CoreGraphics.framework */, + 8841622F17B1E9AA007E266C /* UIKit.framework */, + 8841624A17B1E9AA007E266C /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8841623117B1E9AA007E266C /* Recipe 5-6 Implementing Geocoding */ = { + isa = PBXGroup; + children = ( + 8841623A17B1E9AA007E266C /* AppDelegate.h */, + 8841623B17B1E9AA007E266C /* AppDelegate.m */, + 8841623D17B1E9AA007E266C /* Main.storyboard */, + 8841624017B1E9AA007E266C /* ViewController.h */, + 8841624117B1E9AA007E266C /* ViewController.m */, + 8841624317B1E9AA007E266C /* Images.xcassets */, + 8841623217B1E9AA007E266C /* Supporting Files */, + ); + name = "Recipe 5-6 Implementing Geocoding"; + path = "Recipe 5-6: Implementing Geocoding"; + sourceTree = ""; + }; + 8841623217B1E9AA007E266C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8841623317B1E9AA007E266C /* Recipe 5-6 Implementing Geocoding-Info.plist */, + 8841623417B1E9AA007E266C /* InfoPlist.strings */, + 8841623717B1E9AA007E266C /* main.m */, + 8841623917B1E9AA007E266C /* Recipe 5-6 Implementing Geocoding-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8841625017B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests */ = { + isa = PBXGroup; + children = ( + 8841625617B1E9AA007E266C /* Recipe_5_6__Implementing_GeocodingTests.m */, + 8841625117B1E9AA007E266C /* Supporting Files */, + ); + name = "Recipe 5-6 Implementing GeocodingTests"; + path = "Recipe 5-6: Implementing GeocodingTests"; + sourceTree = ""; + }; + 8841625117B1E9AA007E266C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8841625217B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests-Info.plist */, + 8841625317B1E9AA007E266C /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8841622717B1E9A9007E266C /* Recipe 5-6 Implementing Geocoding */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8841625A17B1E9AA007E266C /* Build configuration list for PBXNativeTarget "Recipe 5-6 Implementing Geocoding" */; + buildPhases = ( + 8841622417B1E9A9007E266C /* Sources */, + 8841622517B1E9A9007E266C /* Frameworks */, + 8841622617B1E9A9007E266C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 5-6 Implementing Geocoding"; + productName = "Recipe 5-6: Implementing Geocoding"; + productReference = 8841622817B1E9A9007E266C /* Recipe 5-6 Implementing Geocoding.app */; + productType = "com.apple.product-type.application"; + }; + 8841624817B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8841625D17B1E9AA007E266C /* Build configuration list for PBXNativeTarget "Recipe 5-6 Implementing GeocodingTests" */; + buildPhases = ( + 8841624517B1E9AA007E266C /* Sources */, + 8841624617B1E9AA007E266C /* Frameworks */, + 8841624717B1E9AA007E266C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8841624F17B1E9AA007E266C /* PBXTargetDependency */, + ); + name = "Recipe 5-6 Implementing GeocodingTests"; + productName = "Recipe 5-6: Implementing GeocodingTests"; + productReference = 8841624917B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8841622017B1E9A9007E266C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 8841622717B1E9A9007E266C = { + DevelopmentTeam = H7ALWBN8YV; + }; + 8841624817B1E9AA007E266C = { + TestTargetID = 8841622717B1E9A9007E266C; + }; + }; + }; + buildConfigurationList = 8841622317B1E9A9007E266C /* Build configuration list for PBXProject "Recipe 5-6 Implementing Geocoding" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8841621F17B1E9A9007E266C; + productRefGroup = 8841622917B1E9A9007E266C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8841622717B1E9A9007E266C /* Recipe 5-6 Implementing Geocoding */, + 8841624817B1E9AA007E266C /* Recipe 5-6 Implementing GeocodingTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8841622617B1E9A9007E266C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8841624417B1E9AA007E266C /* Images.xcassets in Resources */, + 8841623617B1E9AA007E266C /* InfoPlist.strings in Resources */, + 8841623F17B1E9AA007E266C /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8841624717B1E9AA007E266C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8841625517B1E9AA007E266C /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8841622417B1E9A9007E266C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8841624217B1E9AA007E266C /* ViewController.m in Sources */, + 8841623C17B1E9AA007E266C /* AppDelegate.m in Sources */, + 8841623817B1E9AA007E266C /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8841624517B1E9AA007E266C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8841625717B1E9AA007E266C /* Recipe_5_6__Implementing_GeocodingTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8841624F17B1E9AA007E266C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8841622717B1E9A9007E266C /* Recipe 5-6 Implementing Geocoding */; + targetProxy = 8841624E17B1E9AA007E266C /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8841623417B1E9AA007E266C /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8841623517B1E9AA007E266C /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 8841623D17B1E9AA007E266C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8841623E17B1E9AA007E266C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8841625317B1E9AA007E266C /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 8841625417B1E9AA007E266C /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8841625817B1E9AA007E266C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8841625917B1E9AA007E266C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8841625B17B1E9AA007E266C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-6: Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-6: Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Info.plist"; + PRODUCT_NAME = "Recipe 5-6 Implementing Geocoding"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 8841625C17B1E9AA007E266C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-6: Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-6: Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Info.plist"; + PRODUCT_NAME = "Recipe 5-6 Implementing Geocoding"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 8841625E17B1E9AA007E266C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-6: Implementing Geocoding.app/Recipe 5-6: Implementing Geocoding"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-6: Implementing Geocoding/Recipe 5-6: Implementing Geocoding-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 5-6: Implementing GeocodingTests/Recipe 5-6 Implementing GeocodingTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-6 Implementing GeocodingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 8841625F17B1E9AA007E266C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 5-6: Implementing Geocoding.app/Recipe 5-6: Implementing Geocoding"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 5-6: Implementing Geocoding/Recipe 5-6: Implementing Geocoding-Prefix.pch"; + INFOPLIST_FILE = "Recipe 5-6: Implementing GeocodingTests/Recipe 5-6 Implementing GeocodingTests-Info.plist"; + PRODUCT_NAME = "Recipe 5-6 Implementing GeocodingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8841622317B1E9A9007E266C /* Build configuration list for PBXProject "Recipe 5-6 Implementing Geocoding" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8841625817B1E9AA007E266C /* Debug */, + 8841625917B1E9AA007E266C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8841625A17B1E9AA007E266C /* Build configuration list for PBXNativeTarget "Recipe 5-6 Implementing Geocoding" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8841625B17B1E9AA007E266C /* Debug */, + 8841625C17B1E9AA007E266C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8841625D17B1E9AA007E266C /* Build configuration list for PBXNativeTarget "Recipe 5-6 Implementing GeocodingTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8841625E17B1E9AA007E266C /* Debug */, + 8841625F17B1E9AA007E266C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8841622017B1E9A9007E266C /* Project object */; +} diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..4f50dd9 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..3336da8 Binary files /dev/null and b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..bb7264f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-6 Implementing Geocoding.xcscheme b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-6 Implementing Geocoding.xcscheme new file mode 100644 index 0000000..87004f2 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 5-6 Implementing Geocoding.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..7eeeb80 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 5-6 Implementing Geocoding.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8841622717B1E9A9007E266C + + primary + + + 8841624817B1E9AA007E266C + + primary + + + + + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/AppDelegate.h b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/AppDelegate.h new file mode 100644 index 0000000..ebf8bdd --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 5-6: Implementing Geocoding +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/AppDelegate.m b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/AppDelegate.m new file mode 100644 index 0000000..207a037 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 5-6: Implementing Geocoding +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Base.lproj/Main.storyboard b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Base.lproj/Main.storyboard new file mode 100644 index 0000000..54a5c03 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Base.lproj/Main.storyboard @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Images.xcassets/AppIcon.appiconset/Contents.json b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Info.plist b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Info.plist new file mode 100644 index 0000000..73c4dd4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationUsageDescription + Testing Geocoding + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Prefix.pch b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/Recipe 5-6 Implementing Geocoding-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/ViewController.h b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/ViewController.h new file mode 100644 index 0000000..ccdd895 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/ViewController.h @@ -0,0 +1,25 @@ +// +// ViewController.h +// Recipe 5-6: Implementing Geocoding +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + CLLocationManager *_locationManager; + CLGeocoder *_geocoder; +} + +@property (weak, nonatomic) IBOutlet UITextField *addressTextField; +@property (strong, nonatomic) IBOutlet UITextView *geocodingResultsView; +@property (strong, nonatomic) IBOutlet UIButton *reverseGeocodingButton; + +- (IBAction)findCurrentAddress:(id)sender; +- (IBAction)findCoordinateOfAddress:(id)sender; + +@end diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/ViewController.m b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/ViewController.m new file mode 100644 index 0000000..d380ca0 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/ViewController.m @@ -0,0 +1,161 @@ +// +// ViewController.m +// Recipe 5-6: Implementing Geocoding +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)findCurrentAddress:(id)sender +{ + if([CLLocationManager locationServicesEnabled]) + { + if(_locationManager==nil) + { + _locationManager=[[CLLocationManager alloc] init]; + _locationManager.distanceFilter = 500; + _locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; + _locationManager.delegate = self; + + } + + [_locationManager startUpdatingLocation]; + self.geocodingResultsView.text = @"Getting location..."; + } + else + { + self.geocodingResultsView.text=@"Location services are unavailable"; + } +} + +- (IBAction)findCoordinateOfAddress:(id)sender +{ + // Instantiate _geocoder if it has not been already + if (_geocoder == nil) + _geocoder = [[CLGeocoder alloc] init]; + + NSString *address = self.addressTextField.text; + [_geocoder geocodeAddressString:address + completionHandler:^(NSArray *placemarks, NSError *error) + { + if ([placemarks count] > 0) + { + CLPlacemark *placemark = [placemarks objectAtIndex:0]; + + self.geocodingResultsView.text = placemark.location.description; + } + else if (error.domain == kCLErrorDomain) + { + switch (error.code) + { + case kCLErrorDenied: + self.geocodingResultsView.text + = @"Location Services Denied by User"; + break; + case kCLErrorNetwork: + self.geocodingResultsView.text = @"No Network"; + break; + case kCLErrorGeocodeFoundNoResult: + self.geocodingResultsView.text = @"No Result Found"; + break; + default: + self.geocodingResultsView.text = error.localizedDescription; + break; + } + } + else + { + self.geocodingResultsView.text = error.localizedDescription; + } + } + ]; +} +#pragma mark - delegate methods + +-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +{ + if(error.code == kCLErrorDenied) + { + self.geocodingResultsView.text = @"Location information denied"; + } +} + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + // Make sure this is a recent location event + CLLocation *newLocation = [locations lastObject]; + NSTimeInterval eventInterval = [newLocation.timestamp timeIntervalSinceNow]; + if(abs(eventInterval) < 30.0) + { + // Make sure the event is valid + if (newLocation.horizontalAccuracy < 0) + return; + + // Instantiate _geoCoder if it has not been already + if (_geocoder == nil) + _geocoder = [[CLGeocoder alloc] init]; + + //Only one geocoding instance per action + //so stop any previous geocoding actions before starting this one + if([_geocoder isGeocoding]) + [_geocoder cancelGeocode]; + + [_geocoder reverseGeocodeLocation: newLocation + completionHandler: ^(NSArray* placemarks, NSError* error) + { + if([placemarks count] > 0) + { + CLPlacemark *foundPlacemark = [placemarks objectAtIndex:0]; + self.geocodingResultsView.text = + [NSString stringWithFormat:@"You are in: %@", + foundPlacemark.description]; + } + else if (error.code == kCLErrorGeocodeCanceled) + { + NSLog(@"Geocoding cancelled"); + } + else if (error.code == kCLErrorGeocodeFoundNoResult) + { + self.geocodingResultsView.text=@"No geocode result found"; + } + else if (error.code == kCLErrorGeocodeFoundPartialResult) + { + self.geocodingResultsView.text=@"Partial geocode result"; + } + else + { + self.geocodingResultsView.text = + [NSString stringWithFormat:@"Unknown error: %@", + error.description]; + } + } + ]; + + //Stop updating location until they click the button again + [manager stopUpdatingLocation]; + } +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/main.m b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/main.m new file mode 100644 index 0000000..0ad272d --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing Geocoding/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 5-6: Implementing Geocoding +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/Recipe 5-6 Implementing GeocodingTests-Info.plist b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/Recipe 5-6 Implementing GeocodingTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/Recipe 5-6 Implementing GeocodingTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/Recipe_5_6__Implementing_GeocodingTests.m b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/Recipe_5_6__Implementing_GeocodingTests.m new file mode 100644 index 0000000..b9243e0 --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/Recipe_5_6__Implementing_GeocodingTests.m @@ -0,0 +1,34 @@ +// +// Recipe_5_6__Implementing_GeocodingTests.m +// Recipe 5-6: Implementing GeocodingTests +// +// Created by joseph hoffman on 8/6/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_5_6__Implementing_GeocodingTests : XCTestCase + +@end + +@implementation Recipe_5_6__Implementing_GeocodingTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/en.lproj/InfoPlist.strings b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH5 - Location Recipes/Recipe 5-6_ Implementing Geocoding/Recipe 5-6_ Implementing GeocodingTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.pbxproj b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.pbxproj new file mode 100644 index 0000000..32efcd0 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.pbxproj @@ -0,0 +1,479 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B94C117B46167000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B94C017B46167000B5911 /* Foundation.framework */; }; + 888B94C317B46167000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B94C217B46167000B5911 /* CoreGraphics.framework */; }; + 888B94C517B46167000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B94C417B46167000B5911 /* UIKit.framework */; }; + 888B94CB17B46167000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B94C917B46167000B5911 /* InfoPlist.strings */; }; + 888B94CD17B46167000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B94CC17B46167000B5911 /* main.m */; }; + 888B94D117B46167000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B94D017B46167000B5911 /* AppDelegate.m */; }; + 888B94D417B46167000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B94D217B46167000B5911 /* Main.storyboard */; }; + 888B94D717B46167000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B94D617B46167000B5911 /* ViewController.m */; }; + 888B94D917B46167000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B94D817B46167000B5911 /* Images.xcassets */; }; + 888B94E017B46167000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B94DF17B46167000B5911 /* XCTest.framework */; }; + 888B94E117B46167000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B94C017B46167000B5911 /* Foundation.framework */; }; + 888B94E217B46167000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B94C417B46167000B5911 /* UIKit.framework */; }; + 888B94EA17B46167000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B94E817B46167000B5911 /* InfoPlist.strings */; }; + 888B94EC17B46167000B5911 /* Recipe_6_1__Recognizing_Shake_EventsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B94EB17B46167000B5911 /* Recipe_6_1__Recognizing_Shake_EventsTests.m */; }; + 888B94F717B4621C000B5911 /* MainWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B94F617B4621C000B5911 /* MainWindow.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B94E317B46167000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B94B517B46167000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B94BC17B46167000B5911; + remoteInfo = "Recipe 6-1: Recognizing Shake Events"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B94BD17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 6-1 Recognizing Shake Events.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B94C017B46167000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B94C217B46167000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B94C417B46167000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B94C817B46167000B5911 /* Recipe 6-1 Recognizing Shake Events-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-1 Recognizing Shake Events-Info.plist"; sourceTree = ""; }; + 888B94CA17B46167000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B94CC17B46167000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B94CE17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 6-1 Recognizing Shake Events-Prefix.pch"; sourceTree = ""; }; + 888B94CF17B46167000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B94D017B46167000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B94D317B46167000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B94D517B46167000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B94D617B46167000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B94D817B46167000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B94DE17B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 6-1 Recognizing Shake EventsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B94DF17B46167000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B94E717B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-1 Recognizing Shake EventsTests-Info.plist"; sourceTree = ""; }; + 888B94E917B46167000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B94EB17B46167000B5911 /* Recipe_6_1__Recognizing_Shake_EventsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_6_1__Recognizing_Shake_EventsTests.m; sourceTree = ""; }; + 888B94F517B4621C000B5911 /* MainWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainWindow.h; sourceTree = ""; }; + 888B94F617B4621C000B5911 /* MainWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainWindow.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B94BA17B46167000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B94C317B46167000B5911 /* CoreGraphics.framework in Frameworks */, + 888B94C517B46167000B5911 /* UIKit.framework in Frameworks */, + 888B94C117B46167000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B94DB17B46167000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B94E017B46167000B5911 /* XCTest.framework in Frameworks */, + 888B94E217B46167000B5911 /* UIKit.framework in Frameworks */, + 888B94E117B46167000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B94B417B46167000B5911 = { + isa = PBXGroup; + children = ( + 888B94C617B46167000B5911 /* Recipe 6-1 Recognizing Shake Events */, + 888B94E517B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests */, + 888B94BF17B46167000B5911 /* Frameworks */, + 888B94BE17B46167000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B94BE17B46167000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B94BD17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events.app */, + 888B94DE17B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B94BF17B46167000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B94C017B46167000B5911 /* Foundation.framework */, + 888B94C217B46167000B5911 /* CoreGraphics.framework */, + 888B94C417B46167000B5911 /* UIKit.framework */, + 888B94DF17B46167000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B94C617B46167000B5911 /* Recipe 6-1 Recognizing Shake Events */ = { + isa = PBXGroup; + children = ( + 888B94CF17B46167000B5911 /* AppDelegate.h */, + 888B94D017B46167000B5911 /* AppDelegate.m */, + 888B94D217B46167000B5911 /* Main.storyboard */, + 888B94F517B4621C000B5911 /* MainWindow.h */, + 888B94F617B4621C000B5911 /* MainWindow.m */, + 888B94D517B46167000B5911 /* ViewController.h */, + 888B94D617B46167000B5911 /* ViewController.m */, + 888B94D817B46167000B5911 /* Images.xcassets */, + 888B94C717B46167000B5911 /* Supporting Files */, + ); + name = "Recipe 6-1 Recognizing Shake Events"; + path = "Recipe 6-1: Recognizing Shake Events"; + sourceTree = ""; + }; + 888B94C717B46167000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B94C817B46167000B5911 /* Recipe 6-1 Recognizing Shake Events-Info.plist */, + 888B94C917B46167000B5911 /* InfoPlist.strings */, + 888B94CC17B46167000B5911 /* main.m */, + 888B94CE17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B94E517B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests */ = { + isa = PBXGroup; + children = ( + 888B94EB17B46167000B5911 /* Recipe_6_1__Recognizing_Shake_EventsTests.m */, + 888B94E617B46167000B5911 /* Supporting Files */, + ); + name = "Recipe 6-1 Recognizing Shake EventsTests"; + path = "Recipe 6-1: Recognizing Shake EventsTests"; + sourceTree = ""; + }; + 888B94E617B46167000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B94E717B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests-Info.plist */, + 888B94E817B46167000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B94BC17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B94EF17B46167000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-1 Recognizing Shake Events" */; + buildPhases = ( + 888B94B917B46167000B5911 /* Sources */, + 888B94BA17B46167000B5911 /* Frameworks */, + 888B94BB17B46167000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 6-1 Recognizing Shake Events"; + productName = "Recipe 6-1: Recognizing Shake Events"; + productReference = 888B94BD17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events.app */; + productType = "com.apple.product-type.application"; + }; + 888B94DD17B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B94F217B46167000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-1 Recognizing Shake EventsTests" */; + buildPhases = ( + 888B94DA17B46167000B5911 /* Sources */, + 888B94DB17B46167000B5911 /* Frameworks */, + 888B94DC17B46167000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B94E417B46167000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 6-1 Recognizing Shake EventsTests"; + productName = "Recipe 6-1: Recognizing Shake EventsTests"; + productReference = 888B94DE17B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B94B517B46167000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B94DD17B46167000B5911 = { + TestTargetID = 888B94BC17B46167000B5911; + }; + }; + }; + buildConfigurationList = 888B94B817B46167000B5911 /* Build configuration list for PBXProject "Recipe 6-1 Recognizing Shake Events" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B94B417B46167000B5911; + productRefGroup = 888B94BE17B46167000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B94BC17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events */, + 888B94DD17B46167000B5911 /* Recipe 6-1 Recognizing Shake EventsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B94BB17B46167000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B94D917B46167000B5911 /* Images.xcassets in Resources */, + 888B94CB17B46167000B5911 /* InfoPlist.strings in Resources */, + 888B94D417B46167000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B94DC17B46167000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B94EA17B46167000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B94B917B46167000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B94F717B4621C000B5911 /* MainWindow.m in Sources */, + 888B94D717B46167000B5911 /* ViewController.m in Sources */, + 888B94D117B46167000B5911 /* AppDelegate.m in Sources */, + 888B94CD17B46167000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B94DA17B46167000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B94EC17B46167000B5911 /* Recipe_6_1__Recognizing_Shake_EventsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B94E417B46167000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B94BC17B46167000B5911 /* Recipe 6-1 Recognizing Shake Events */; + targetProxy = 888B94E317B46167000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B94C917B46167000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B94CA17B46167000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B94D217B46167000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B94D317B46167000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B94E817B46167000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B94E917B46167000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B94ED17B46167000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B94EE17B46167000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B94F017B46167000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-1: Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-1: Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Info.plist"; + PRODUCT_NAME = "Recipe 6-1 Recognizing Shake Events"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B94F117B46167000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-1: Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-1: Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Info.plist"; + PRODUCT_NAME = "Recipe 6-1 Recognizing Shake Events"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B94F317B46167000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-1: Recognizing Shake Events.app/Recipe 6-1: Recognizing Shake Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-1: Recognizing Shake Events/Recipe 6-1: Recognizing Shake Events-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 6-1: Recognizing Shake EventsTests/Recipe 6-1 Recognizing Shake EventsTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-1 Recognizing Shake EventsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B94F417B46167000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-1: Recognizing Shake Events.app/Recipe 6-1: Recognizing Shake Events"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-1: Recognizing Shake Events/Recipe 6-1: Recognizing Shake Events-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-1: Recognizing Shake EventsTests/Recipe 6-1 Recognizing Shake EventsTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-1 Recognizing Shake EventsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B94B817B46167000B5911 /* Build configuration list for PBXProject "Recipe 6-1 Recognizing Shake Events" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B94ED17B46167000B5911 /* Debug */, + 888B94EE17B46167000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B94EF17B46167000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-1 Recognizing Shake Events" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B94F017B46167000B5911 /* Debug */, + 888B94F117B46167000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B94F217B46167000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-1 Recognizing Shake EventsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B94F317B46167000B5911 /* Debug */, + 888B94F417B46167000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B94B517B46167000B5911 /* Project object */; +} diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..2ea66e3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..7d174a5 Binary files /dev/null and b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..a525e99 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-1 Recognizing Shake Events.xcscheme b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-1 Recognizing Shake Events.xcscheme new file mode 100644 index 0000000..c771794 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-1 Recognizing Shake Events.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e837618 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 6-1 Recognizing Shake Events.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B94BC17B46167000B5911 + + primary + + + 888B94DD17B46167000B5911 + + primary + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/AppDelegate.h b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/AppDelegate.h new file mode 100644 index 0000000..31d4daf --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Recipe 6-1: Recognizing Shake Events +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "MainWindow.h" + + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) MainWindow *window; + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/AppDelegate.m b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/AppDelegate.m new file mode 100644 index 0000000..d952a21 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/AppDelegate.m @@ -0,0 +1,59 @@ +// +// AppDelegate.m +// Recipe 6-1: Recognizing Shake Events +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + + 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:. +} +- (MainWindow *)window +{ + if(!_window) + { + + _window=[[MainWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + + + } + return _window; + + +} + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Base.lproj/Main.storyboard b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b99208b --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Images.xcassets/AppIcon.appiconset/Contents.json b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/MainWindow.h b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/MainWindow.h new file mode 100644 index 0000000..ea1d45f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/MainWindow.h @@ -0,0 +1,15 @@ +// +// MainWindow.h +// Recipe 6-1: Recognizing Shake Events +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface MainWindow : UIWindow + + + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/MainWindow.m b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/MainWindow.m new file mode 100644 index 0000000..8b90ed1 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/MainWindow.m @@ -0,0 +1,33 @@ +// +// MainWindow.m +// Recipe 6-1: Recognizing Shake Events +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MainWindow.h" + +@implementation MainWindow + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + +#pragma mark - delegate + +- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event +{ + if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) + { + [[NSNotificationCenter defaultCenter] postNotificationName:@"NOTIFICATION_SHAKE" + object:self]; + } +} + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Info.plist b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Prefix.pch b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1 Recognizing Shake Events-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/ViewController.h b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/ViewController.h new file mode 100644 index 0000000..841a488 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// Recipe 6-1: Recognizing Shake Events +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/ViewController.m b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/ViewController.m new file mode 100644 index 0000000..be78c4f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/ViewController.m @@ -0,0 +1,48 @@ +// +// ViewController.m +// Recipe 6-1: Recognizing Shake Events +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void) viewWillAppear: (BOOL)animated +{ + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(shakeDetected:) + name:@"NOTIFICATION_SHAKE" object:nil]; + [super viewWillAppear:animated]; +} + +- (void) viewWillDisappear: (BOOL)animated +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super viewWillDisappear:animated]; +} + +-(void)shakeDetected:(NSNotification *)paramNotification +{ + NSLog(@"Shaken not stirred"); +} + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/main.m b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/main.m new file mode 100644 index 0000000..cb2dcc2 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake Events/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 6-1: Recognizing Shake Events +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/Recipe 6-1 Recognizing Shake EventsTests-Info.plist b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/Recipe 6-1 Recognizing Shake EventsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/Recipe 6-1 Recognizing Shake EventsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/Recipe_6_1__Recognizing_Shake_EventsTests.m b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/Recipe_6_1__Recognizing_Shake_EventsTests.m new file mode 100644 index 0000000..f8a2df5 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/Recipe_6_1__Recognizing_Shake_EventsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_6_1__Recognizing_Shake_EventsTests.m +// Recipe 6-1: Recognizing Shake EventsTests +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_6_1__Recognizing_Shake_EventsTests : XCTestCase + +@end + +@implementation Recipe_6_1__Recognizing_Shake_EventsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-1_ Recognizing Shake Events/Recipe 6-1_ Recognizing Shake EventsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.pbxproj b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9624777 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.pbxproj @@ -0,0 +1,486 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B950517B49BA9000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B950417B49BA9000B5911 /* Foundation.framework */; }; + 888B950717B49BA9000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B950617B49BA9000B5911 /* CoreGraphics.framework */; }; + 888B950917B49BA9000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B950817B49BA9000B5911 /* UIKit.framework */; }; + 888B950F17B49BA9000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B950D17B49BA9000B5911 /* InfoPlist.strings */; }; + 888B951117B49BA9000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B951017B49BA9000B5911 /* main.m */; }; + 888B951517B49BA9000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B951417B49BA9000B5911 /* AppDelegate.m */; }; + 888B951817B49BA9000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B951617B49BA9000B5911 /* Main.storyboard */; }; + 888B951B17B49BA9000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B951A17B49BA9000B5911 /* ViewController.m */; }; + 888B951D17B49BA9000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B951C17B49BA9000B5911 /* Images.xcassets */; }; + 888B952417B49BA9000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B952317B49BA9000B5911 /* XCTest.framework */; }; + 888B952517B49BA9000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B950417B49BA9000B5911 /* Foundation.framework */; }; + 888B952617B49BA9000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B950817B49BA9000B5911 /* UIKit.framework */; }; + 888B952E17B49BA9000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B952C17B49BA9000B5911 /* InfoPlist.strings */; }; + 888B953017B49BA9000B5911 /* Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B952F17B49BA9000B5911 /* Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m */; }; + 888B953A17B4ACB2000B5911 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B953917B4ACB2000B5911 /* CoreMotion.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B952717B49BA9000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B94F917B49BA9000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B950017B49BA9000B5911; + remoteInfo = "Recipe 6-2: Accessing Raw Core Motion Data"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B950117B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 6-2 Accessing Raw Core Motion Data.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B950417B49BA9000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B950617B49BA9000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B950817B49BA9000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B950C17B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-2 Accessing Raw Core Motion Data-Info.plist"; sourceTree = ""; }; + 888B950E17B49BA9000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B951017B49BA9000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B951217B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch"; sourceTree = ""; }; + 888B951317B49BA9000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B951417B49BA9000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B951717B49BA9000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B951917B49BA9000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B951A17B49BA9000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B951C17B49BA9000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B952217B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 6-2 Accessing Raw Core Motion DataTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B952317B49BA9000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B952B17B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist"; sourceTree = ""; }; + 888B952D17B49BA9000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B952F17B49BA9000B5911 /* Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m; sourceTree = ""; }; + 888B953917B4ACB2000B5911 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B94FE17B49BA9000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B953A17B4ACB2000B5911 /* CoreMotion.framework in Frameworks */, + 888B950717B49BA9000B5911 /* CoreGraphics.framework in Frameworks */, + 888B950917B49BA9000B5911 /* UIKit.framework in Frameworks */, + 888B950517B49BA9000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B951F17B49BA9000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B952417B49BA9000B5911 /* XCTest.framework in Frameworks */, + 888B952617B49BA9000B5911 /* UIKit.framework in Frameworks */, + 888B952517B49BA9000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B94F817B49BA9000B5911 = { + isa = PBXGroup; + children = ( + 888B950A17B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data */, + 888B952917B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests */, + 888B950317B49BA9000B5911 /* Frameworks */, + 888B950217B49BA9000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B950217B49BA9000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B950117B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data.app */, + 888B952217B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B950317B49BA9000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B953917B4ACB2000B5911 /* CoreMotion.framework */, + 888B950417B49BA9000B5911 /* Foundation.framework */, + 888B950617B49BA9000B5911 /* CoreGraphics.framework */, + 888B950817B49BA9000B5911 /* UIKit.framework */, + 888B952317B49BA9000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B950A17B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data */ = { + isa = PBXGroup; + children = ( + 888B951317B49BA9000B5911 /* AppDelegate.h */, + 888B951417B49BA9000B5911 /* AppDelegate.m */, + 888B951617B49BA9000B5911 /* Main.storyboard */, + 888B951917B49BA9000B5911 /* ViewController.h */, + 888B951A17B49BA9000B5911 /* ViewController.m */, + 888B951C17B49BA9000B5911 /* Images.xcassets */, + 888B950B17B49BA9000B5911 /* Supporting Files */, + ); + name = "Recipe 6-2 Accessing Raw Core Motion Data"; + path = "Recipe 6-2: Accessing Raw Core Motion Data"; + sourceTree = ""; + }; + 888B950B17B49BA9000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B950C17B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data-Info.plist */, + 888B950D17B49BA9000B5911 /* InfoPlist.strings */, + 888B951017B49BA9000B5911 /* main.m */, + 888B951217B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B952917B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests */ = { + isa = PBXGroup; + children = ( + 888B952F17B49BA9000B5911 /* Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m */, + 888B952A17B49BA9000B5911 /* Supporting Files */, + ); + name = "Recipe 6-2 Accessing Raw Core Motion DataTests"; + path = "Recipe 6-2: Accessing Raw Core Motion DataTests"; + sourceTree = ""; + }; + 888B952A17B49BA9000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B952B17B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist */, + 888B952C17B49BA9000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B950017B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B953317B49BA9000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-2 Accessing Raw Core Motion Data" */; + buildPhases = ( + 888B94FD17B49BA9000B5911 /* Sources */, + 888B94FE17B49BA9000B5911 /* Frameworks */, + 888B94FF17B49BA9000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 6-2 Accessing Raw Core Motion Data"; + productName = "Recipe 6-2: Accessing Raw Core Motion Data"; + productReference = 888B950117B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data.app */; + productType = "com.apple.product-type.application"; + }; + 888B952117B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B953617B49BA9000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-2 Accessing Raw Core Motion DataTests" */; + buildPhases = ( + 888B951E17B49BA9000B5911 /* Sources */, + 888B951F17B49BA9000B5911 /* Frameworks */, + 888B952017B49BA9000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B952817B49BA9000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 6-2 Accessing Raw Core Motion DataTests"; + productName = "Recipe 6-2: Accessing Raw Core Motion DataTests"; + productReference = 888B952217B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B94F917B49BA9000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B950017B49BA9000B5911 = { + DevelopmentTeam = H7ALWBN8YV; + }; + 888B952117B49BA9000B5911 = { + TestTargetID = 888B950017B49BA9000B5911; + }; + }; + }; + buildConfigurationList = 888B94FC17B49BA9000B5911 /* Build configuration list for PBXProject "Recipe 6-2 Accessing Raw Core Motion Data" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B94F817B49BA9000B5911; + productRefGroup = 888B950217B49BA9000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B950017B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data */, + 888B952117B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion DataTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B94FF17B49BA9000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B951D17B49BA9000B5911 /* Images.xcassets in Resources */, + 888B950F17B49BA9000B5911 /* InfoPlist.strings in Resources */, + 888B951817B49BA9000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B952017B49BA9000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B952E17B49BA9000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B94FD17B49BA9000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B951B17B49BA9000B5911 /* ViewController.m in Sources */, + 888B951517B49BA9000B5911 /* AppDelegate.m in Sources */, + 888B951117B49BA9000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B951E17B49BA9000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B953017B49BA9000B5911 /* Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B952817B49BA9000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B950017B49BA9000B5911 /* Recipe 6-2 Accessing Raw Core Motion Data */; + targetProxy = 888B952717B49BA9000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B950D17B49BA9000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B950E17B49BA9000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B951617B49BA9000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B951717B49BA9000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B952C17B49BA9000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B952D17B49BA9000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B953117B49BA9000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B953217B49BA9000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B953417B49BA9000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-2: Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-2: Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Info.plist"; + PRODUCT_NAME = "Recipe 6-2 Accessing Raw Core Motion Data"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B953517B49BA9000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-2: Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-2: Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Info.plist"; + PRODUCT_NAME = "Recipe 6-2 Accessing Raw Core Motion Data"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B953717B49BA9000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-2: Accessing Raw Core Motion Data.app/Recipe 6-2: Accessing Raw Core Motion Data"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-2: Accessing Raw Core Motion Data/Recipe 6-2: Accessing Raw Core Motion Data-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 6-2: Accessing Raw Core Motion DataTests/Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-2 Accessing Raw Core Motion DataTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B953817B49BA9000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-2: Accessing Raw Core Motion Data.app/Recipe 6-2: Accessing Raw Core Motion Data"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-2: Accessing Raw Core Motion Data/Recipe 6-2: Accessing Raw Core Motion Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-2: Accessing Raw Core Motion DataTests/Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-2 Accessing Raw Core Motion DataTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B94FC17B49BA9000B5911 /* Build configuration list for PBXProject "Recipe 6-2 Accessing Raw Core Motion Data" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B953117B49BA9000B5911 /* Debug */, + 888B953217B49BA9000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B953317B49BA9000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-2 Accessing Raw Core Motion Data" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B953417B49BA9000B5911 /* Debug */, + 888B953517B49BA9000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B953617B49BA9000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-2 Accessing Raw Core Motion DataTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B953717B49BA9000B5911 /* Debug */, + 888B953817B49BA9000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B94F917B49BA9000B5911 /* Project object */; +} diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c923588 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..1a1623f Binary files /dev/null and b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..9476639 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1bd7456 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 6-2: Accessing Raw Core Motion Data.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B950017B49BA9000B5911 + + primary + + + 888B952117B49BA9000B5911 + + primary + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/AppDelegate.h b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/AppDelegate.h new file mode 100644 index 0000000..aa590d4 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/AppDelegate.h @@ -0,0 +1,19 @@ +// +// AppDelegate.h +// Recipe 6-2: Accessing Raw Core Motion Data +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + + + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/AppDelegate.m b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/AppDelegate.m new file mode 100644 index 0000000..7acc87c --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/AppDelegate.m @@ -0,0 +1,54 @@ +// +// AppDelegate.m +// Recipe 6-2: Accessing Raw Core Motion Data +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + + + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + + + +} + +- (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 +{ + + + +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + + + + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Base.lproj/Main.storyboard b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c35184f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Base.lproj/Main.storyboard @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Images.xcassets/AppIcon.appiconset/Contents.json b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Info.plist b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Info.plist new file mode 100644 index 0000000..67948fe --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2 Accessing Raw Core Motion Data-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/ViewController.h b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/ViewController.h new file mode 100644 index 0000000..b9ac5dc --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/ViewController.h @@ -0,0 +1,35 @@ +// +// ViewController.h +// Recipe 6-2: Accessing Raw Core Motion Data +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) IBOutlet UILabel *xAccLabel; +@property (strong, nonatomic) IBOutlet UILabel *yAccLabel; +@property (strong, nonatomic) IBOutlet UILabel *zAccLabel; + +@property (strong, nonatomic) IBOutlet UILabel *xGyroLabel; +@property (strong, nonatomic) IBOutlet UILabel *yGyroLabel; +@property (strong, nonatomic) IBOutlet UILabel *zGyroLabel; + +@property (strong, nonatomic) IBOutlet UILabel *xMagLabel; +@property (strong, nonatomic) IBOutlet UILabel *yMagLabel; +@property (strong, nonatomic) IBOutlet UILabel *zMagLabel; + + +@property (weak, nonatomic) IBOutlet UIButton *startButton; + +@property (strong, nonatomic) CMMotionManager *motionManager; + +- (IBAction)toggleUpdates:(id)sender; + + + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/ViewController.m b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/ViewController.m new file mode 100644 index 0000000..c3e8bde --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/ViewController.m @@ -0,0 +1,144 @@ +// +// ViewController.m +// Recipe 6-2: Accessing Raw Core Motion Data +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + + [self.startButton setTitle:@"Stop" forState:UIControlStateSelected]; + [self.startButton setTitle:@"Start" forState:UIControlStateNormal]; + + + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. + +} + +-(CMMotionManager *)motionManager +{ + // Lazy initialization + if (_motionManager == nil) + { + _motionManager = [[CMMotionManager alloc] init]; + } + return _motionManager; +} + +- (IBAction)toggleUpdates:(id)sender { + + if(![self.startButton isSelected]) + { + [self startUpdates]; + [self.startButton setSelected:YES]; + } + else + { + [self stopUpdates]; + [self.startButton setSelected:NO]; + } + + +} + + +- (void)startUpdates +{ + // Start accelerometer if available + if ([self.motionManager isAccelerometerAvailable]) + { + [self.motionManager setAccelerometerUpdateInterval:1.0/2.0]; + [self.motionManager startAccelerometerUpdatesToQueue: + [NSOperationQueue mainQueue] + withHandler: + ^(CMAccelerometerData *data, NSError *error) + { + self.xAccLabel.text = [NSString stringWithFormat:@"%f", + data.acceleration.x]; + self.yAccLabel.text = [NSString stringWithFormat:@"%f", + data.acceleration.y]; + self.zAccLabel.text = [NSString stringWithFormat:@"%f", + data.acceleration.z]; + + }]; + + } + + // Start gyroscope if available + if ([self.motionManager isGyroAvailable]) + { + [self.motionManager setGyroUpdateInterval:1.0/2.0]; + [self.motionManager startGyroUpdatesToQueue: + [NSOperationQueue mainQueue] + withHandler: + ^(CMGyroData *data, NSError *error) + { + self.xGyroLabel.text = [NSString stringWithFormat:@"%f", + data.rotationRate.x]; + self.yGyroLabel.text = [NSString stringWithFormat:@"%f", + data.rotationRate.y]; + self.zGyroLabel.text = [NSString stringWithFormat:@"%f", + data.rotationRate.z]; + }]; + } + + // Start magnetometer if available + if ([self.motionManager isMagnetometerAvailable]) + { + [self.motionManager setMagnetometerUpdateInterval:1.0/2.0]; + [self.motionManager startMagnetometerUpdatesToQueue:[NSOperationQueue mainQueue] + withHandler: + ^(CMMagnetometerData *data, NSError *error) + { + self.xMagLabel.text = [NSString stringWithFormat:@"%f", + data.magneticField.x]; + self.yMagLabel.text = [NSString stringWithFormat:@"%f", + data.magneticField.y]; + self.zMagLabel.text = [NSString stringWithFormat:@"%f", + data.magneticField.z]; + }]; + } +} + +-(void)stopUpdates +{ + if ([self.motionManager isAccelerometerAvailable] && + [self.motionManager isAccelerometerActive]) + { + [self.motionManager stopAccelerometerUpdates]; + } + + if ([self.motionManager isGyroAvailable] && + [self.motionManager isGyroActive]) + { + [self.motionManager stopGyroUpdates]; + } + + if ([self.motionManager isMagnetometerAvailable] && + [self.motionManager isMagnetometerActive]) + { + [self.motionManager stopMagnetometerUpdates]; + } +} + + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/main.m b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/main.m new file mode 100644 index 0000000..92fdb53 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion Data/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 6-2: Accessing Raw Core Motion Data +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/Recipe 6-2 Accessing Raw Core Motion DataTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m new file mode 100644 index 0000000..658fa83 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m @@ -0,0 +1,34 @@ +// +// Recipe_6_2__Accessing_Raw_Core_Motion_DataTests.m +// Recipe 6-2: Accessing Raw Core Motion DataTests +// +// Created by joseph hoffman on 8/8/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_6_2__Accessing_Raw_Core_Motion_DataTests : XCTestCase + +@end + +@implementation Recipe_6_2__Accessing_Raw_Core_Motion_DataTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-2_ Accessing Raw Core Motion Data/Recipe 6-2_ Accessing Raw Core Motion DataTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.pbxproj b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.pbxproj new file mode 100644 index 0000000..39bf5ae --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B954817B5FE3C000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B954717B5FE3C000B5911 /* Foundation.framework */; }; + 888B954A17B5FE3C000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B954917B5FE3C000B5911 /* CoreGraphics.framework */; }; + 888B954C17B5FE3C000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B954B17B5FE3C000B5911 /* UIKit.framework */; }; + 888B955217B5FE3C000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B955017B5FE3C000B5911 /* InfoPlist.strings */; }; + 888B955417B5FE3C000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B955317B5FE3C000B5911 /* main.m */; }; + 888B955817B5FE3C000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B955717B5FE3C000B5911 /* AppDelegate.m */; }; + 888B955B17B5FE3C000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B955917B5FE3C000B5911 /* Main.storyboard */; }; + 888B955E17B5FE3C000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B955D17B5FE3C000B5911 /* ViewController.m */; }; + 888B956017B5FE3C000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B955F17B5FE3C000B5911 /* Images.xcassets */; }; + 888B956717B5FE3C000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B956617B5FE3C000B5911 /* XCTest.framework */; }; + 888B956817B5FE3C000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B954717B5FE3C000B5911 /* Foundation.framework */; }; + 888B956917B5FE3C000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B954B17B5FE3C000B5911 /* UIKit.framework */; }; + 888B957117B5FE3C000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B956F17B5FE3C000B5911 /* InfoPlist.strings */; }; + 888B957317B5FE3C000B5911 /* Recipe_6_3__Accessing_Device_Motion_DataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B957217B5FE3C000B5911 /* Recipe_6_3__Accessing_Device_Motion_DataTests.m */; }; + 888B957D17B5FE58000B5911 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B957C17B5FE57000B5911 /* CoreMotion.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B956A17B5FE3C000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B953C17B5FE3C000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B954317B5FE3C000B5911; + remoteInfo = "Recipe 6-3: Accessing Device Motion Data"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B954417B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 6-3 Accessing Device Motion Data.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B954717B5FE3C000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B954917B5FE3C000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B954B17B5FE3C000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B954F17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-3 Accessing Device Motion Data-Info.plist"; sourceTree = ""; }; + 888B955117B5FE3C000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B955317B5FE3C000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B955517B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 6-3 Accessing Device Motion Data-Prefix.pch"; sourceTree = ""; }; + 888B955617B5FE3C000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B955717B5FE3C000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B955A17B5FE3C000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B955C17B5FE3C000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B955D17B5FE3C000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B955F17B5FE3C000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B956517B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 6-3 Accessing Device Motion DataTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B956617B5FE3C000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B956E17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-3 Accessing Device Motion DataTests-Info.plist"; sourceTree = ""; }; + 888B957017B5FE3C000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B957217B5FE3C000B5911 /* Recipe_6_3__Accessing_Device_Motion_DataTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_6_3__Accessing_Device_Motion_DataTests.m; sourceTree = ""; }; + 888B957C17B5FE57000B5911 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B954117B5FE3C000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B957D17B5FE58000B5911 /* CoreMotion.framework in Frameworks */, + 888B954A17B5FE3C000B5911 /* CoreGraphics.framework in Frameworks */, + 888B954C17B5FE3C000B5911 /* UIKit.framework in Frameworks */, + 888B954817B5FE3C000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B956217B5FE3C000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B956717B5FE3C000B5911 /* XCTest.framework in Frameworks */, + 888B956917B5FE3C000B5911 /* UIKit.framework in Frameworks */, + 888B956817B5FE3C000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B953B17B5FE3C000B5911 = { + isa = PBXGroup; + children = ( + 888B954D17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data */, + 888B956C17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests */, + 888B954617B5FE3C000B5911 /* Frameworks */, + 888B954517B5FE3C000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B954517B5FE3C000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B954417B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data.app */, + 888B956517B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B954617B5FE3C000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B957C17B5FE57000B5911 /* CoreMotion.framework */, + 888B954717B5FE3C000B5911 /* Foundation.framework */, + 888B954917B5FE3C000B5911 /* CoreGraphics.framework */, + 888B954B17B5FE3C000B5911 /* UIKit.framework */, + 888B956617B5FE3C000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B954D17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data */ = { + isa = PBXGroup; + children = ( + 888B955617B5FE3C000B5911 /* AppDelegate.h */, + 888B955717B5FE3C000B5911 /* AppDelegate.m */, + 888B955917B5FE3C000B5911 /* Main.storyboard */, + 888B955C17B5FE3C000B5911 /* ViewController.h */, + 888B955D17B5FE3C000B5911 /* ViewController.m */, + 888B955F17B5FE3C000B5911 /* Images.xcassets */, + 888B954E17B5FE3C000B5911 /* Supporting Files */, + ); + name = "Recipe 6-3 Accessing Device Motion Data"; + path = "Recipe 6-3: Accessing Device Motion Data"; + sourceTree = ""; + }; + 888B954E17B5FE3C000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B954F17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data-Info.plist */, + 888B955017B5FE3C000B5911 /* InfoPlist.strings */, + 888B955317B5FE3C000B5911 /* main.m */, + 888B955517B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B956C17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests */ = { + isa = PBXGroup; + children = ( + 888B957217B5FE3C000B5911 /* Recipe_6_3__Accessing_Device_Motion_DataTests.m */, + 888B956D17B5FE3C000B5911 /* Supporting Files */, + ); + name = "Recipe 6-3 Accessing Device Motion DataTests"; + path = "Recipe 6-3: Accessing Device Motion DataTests"; + sourceTree = ""; + }; + 888B956D17B5FE3C000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B956E17B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests-Info.plist */, + 888B956F17B5FE3C000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B954317B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B957617B5FE3C000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-3 Accessing Device Motion Data" */; + buildPhases = ( + 888B954017B5FE3C000B5911 /* Sources */, + 888B954117B5FE3C000B5911 /* Frameworks */, + 888B954217B5FE3C000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 6-3 Accessing Device Motion Data"; + productName = "Recipe 6-3: Accessing Device Motion Data"; + productReference = 888B954417B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data.app */; + productType = "com.apple.product-type.application"; + }; + 888B956417B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B957917B5FE3C000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-3 Accessing Device Motion DataTests" */; + buildPhases = ( + 888B956117B5FE3C000B5911 /* Sources */, + 888B956217B5FE3C000B5911 /* Frameworks */, + 888B956317B5FE3C000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B956B17B5FE3C000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 6-3 Accessing Device Motion DataTests"; + productName = "Recipe 6-3: Accessing Device Motion DataTests"; + productReference = 888B956517B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B953C17B5FE3C000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B956417B5FE3C000B5911 = { + TestTargetID = 888B954317B5FE3C000B5911; + }; + }; + }; + buildConfigurationList = 888B953F17B5FE3C000B5911 /* Build configuration list for PBXProject "Recipe 6-3 Accessing Device Motion Data" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B953B17B5FE3C000B5911; + productRefGroup = 888B954517B5FE3C000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B954317B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data */, + 888B956417B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion DataTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B954217B5FE3C000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B956017B5FE3C000B5911 /* Images.xcassets in Resources */, + 888B955217B5FE3C000B5911 /* InfoPlist.strings in Resources */, + 888B955B17B5FE3C000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B956317B5FE3C000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B957117B5FE3C000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B954017B5FE3C000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B955E17B5FE3C000B5911 /* ViewController.m in Sources */, + 888B955817B5FE3C000B5911 /* AppDelegate.m in Sources */, + 888B955417B5FE3C000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B956117B5FE3C000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B957317B5FE3C000B5911 /* Recipe_6_3__Accessing_Device_Motion_DataTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B956B17B5FE3C000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B954317B5FE3C000B5911 /* Recipe 6-3 Accessing Device Motion Data */; + targetProxy = 888B956A17B5FE3C000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B955017B5FE3C000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B955117B5FE3C000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B955917B5FE3C000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B955A17B5FE3C000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B956F17B5FE3C000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B957017B5FE3C000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B957417B5FE3C000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B957517B5FE3C000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B957717B5FE3C000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-3: Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-3: Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Info.plist"; + PRODUCT_NAME = "Recipe 6-3 Accessing Device Motion Data"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B957817B5FE3C000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-3: Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-3: Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Info.plist"; + PRODUCT_NAME = "Recipe 6-3 Accessing Device Motion Data"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B957A17B5FE3C000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-3: Accessing Device Motion Data.app/Recipe 6-3: Accessing Device Motion Data"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-3: Accessing Device Motion Data/Recipe 6-3: Accessing Device Motion Data-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 6-3: Accessing Device Motion DataTests/Recipe 6-3 Accessing Device Motion DataTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-3 Accessing Device Motion DataTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B957B17B5FE3C000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-3: Accessing Device Motion Data.app/Recipe 6-3: Accessing Device Motion Data"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-3: Accessing Device Motion Data/Recipe 6-3: Accessing Device Motion Data-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-3: Accessing Device Motion DataTests/Recipe 6-3 Accessing Device Motion DataTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-3 Accessing Device Motion DataTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B953F17B5FE3C000B5911 /* Build configuration list for PBXProject "Recipe 6-3 Accessing Device Motion Data" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B957417B5FE3C000B5911 /* Debug */, + 888B957517B5FE3C000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B957617B5FE3C000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-3 Accessing Device Motion Data" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B957717B5FE3C000B5911 /* Debug */, + 888B957817B5FE3C000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B957917B5FE3C000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-3 Accessing Device Motion DataTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B957A17B5FE3C000B5911 /* Debug */, + 888B957B17B5FE3C000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B953C17B5FE3C000B5911 /* Project object */; +} diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..be869a7 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..9f97dfc Binary files /dev/null and b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..1c31eb9 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-3_ Accessing Device Motion Data.xcscheme b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-3_ Accessing Device Motion Data.xcscheme new file mode 100644 index 0000000..5867c2a --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-3_ Accessing Device Motion Data.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e56d1a6 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 6-3: Accessing Device Motion Data.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B954317B5FE3C000B5911 + + primary + + + 888B956417B5FE3C000B5911 + + primary + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/AppDelegate.h b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/AppDelegate.h new file mode 100644 index 0000000..0f56f00 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 6-3: Accessing Device Motion Data +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/AppDelegate.m b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/AppDelegate.m new file mode 100644 index 0000000..3bab51c --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 6-3: Accessing Device Motion Data +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Base.lproj/Main.storyboard b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Base.lproj/Main.storyboard new file mode 100644 index 0000000..036f2a2 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Base.lproj/Main.storyboard @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Images.xcassets/AppIcon.appiconset/Contents.json b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Info.plist b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Info.plist new file mode 100644 index 0000000..67948fe --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Prefix.pch b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3 Accessing Device Motion Data-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/ViewController.h b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/ViewController.h new file mode 100644 index 0000000..6f73cf8 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/ViewController.h @@ -0,0 +1,40 @@ +// +// ViewController.h +// Recipe 6-3: Accessing Device Motion Data +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *rollLabel; +@property (weak, nonatomic) IBOutlet UILabel *pitchLabel; +@property (weak, nonatomic) IBOutlet UILabel *yawLabel; + +@property (weak, nonatomic) IBOutlet UILabel *xRotLabel; +@property (weak, nonatomic) IBOutlet UILabel *yRotLabel; +@property (weak, nonatomic) IBOutlet UILabel *zRotLabel; + +@property (weak, nonatomic) IBOutlet UILabel *xGravLabel; +@property (weak, nonatomic) IBOutlet UILabel *yGravLabel; +@property (weak, nonatomic) IBOutlet UILabel *zGravLabel; + +@property (weak, nonatomic) IBOutlet UILabel *xAccLabel; +@property (weak, nonatomic) IBOutlet UILabel *yAccLabel; +@property (weak, nonatomic) IBOutlet UILabel *zAccLabel; + +@property (weak, nonatomic) IBOutlet UILabel *xMagLabel; +@property (weak, nonatomic) IBOutlet UILabel *yMagLabel; +@property (weak, nonatomic) IBOutlet UILabel *zMagLabel; + +@property (weak, nonatomic) IBOutlet UIButton *startButton; + +@property (strong,nonatomic) CMMotionManager *motionManager; + +- (IBAction)toggleUpdates:(id)sender; + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/ViewController.m b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/ViewController.m new file mode 100644 index 0000000..2aa2370 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/ViewController.m @@ -0,0 +1,121 @@ +// +// ViewController.m +// Recipe 6-3: Accessing Device Motion Data +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + + [self.startButton setTitle:@"Stop" forState:UIControlStateSelected]; + [self.startButton setTitle:@"Start" forState:UIControlStateNormal]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(CMMotionManager *)motionManager +{ + // Lazy initialization + if (_motionManager == nil) + { + _motionManager = [[CMMotionManager alloc] init]; + } + return _motionManager; +} +- (void)startUpdates +{ + // Start device motion updates + if ([self.motionManager isDeviceMotionAvailable]) + { + //Update twice per second + [self.motionManager setDeviceMotionUpdateInterval:1.0/2.0]; + [self.motionManager startDeviceMotionUpdatesUsingReferenceFrame: + CMAttitudeReferenceFrameXMagneticNorthZVertical + toQueue:[NSOperationQueue mainQueue] + withHandler: + ^(CMDeviceMotion *deviceMotion, NSError *error) + + { + // Update attitude labels + self.rollLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.attitude.roll]; + self.pitchLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.attitude.pitch]; + self.yawLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.attitude.yaw]; + + // Update rotation rate labels + self.xRotLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.rotationRate.x]; + self.yRotLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.rotationRate.y]; + self.zRotLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.rotationRate.z]; + + // Update user acceleration labels + self.xGravLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.gravity.x]; + self.yGravLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.gravity.y]; + self.zGravLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.gravity.z]; + + // Update user acceleration labels + self.xAccLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.userAcceleration.x]; + self.yAccLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.userAcceleration.y]; + self.zAccLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.userAcceleration.z]; + + // Update magnetic field labels + self.xMagLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.magneticField.field.x]; + self.yMagLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.magneticField.field.y]; + self.zMagLabel.text = [NSString stringWithFormat:@"%f", + deviceMotion.magneticField.field.z]; + }]; + } +} + +-(void)stopUpdates +{ + if ([self.motionManager isDeviceMotionAvailable] && + [self.motionManager isDeviceMotionActive]) + { + [self.motionManager stopDeviceMotionUpdates]; + } +} + +- (IBAction)toggleUpdates:(id)sender { + + if(![self.startButton isSelected]) + { + [self startUpdates]; + [self.startButton setSelected:YES]; + } + else + { + [self stopUpdates]; + [self.startButton setSelected:NO]; + } +} +@end diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/main.m b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/main.m new file mode 100644 index 0000000..01899bf --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion Data/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 6-3: Accessing Device Motion Data +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/Recipe 6-3 Accessing Device Motion DataTests-Info.plist b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/Recipe 6-3 Accessing Device Motion DataTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/Recipe 6-3 Accessing Device Motion DataTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/Recipe_6_3__Accessing_Device_Motion_DataTests.m b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/Recipe_6_3__Accessing_Device_Motion_DataTests.m new file mode 100644 index 0000000..1ccbf1c --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/Recipe_6_3__Accessing_Device_Motion_DataTests.m @@ -0,0 +1,34 @@ +// +// Recipe_6_3__Accessing_Device_Motion_DataTests.m +// Recipe 6-3: Accessing Device Motion DataTests +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_6_3__Accessing_Device_Motion_DataTests : XCTestCase + +@end + +@implementation Recipe_6_3__Accessing_Device_Motion_DataTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-3_ Accessing Device Motion Data/Recipe 6-3_ Accessing Device Motion DataTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.pbxproj b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.pbxproj new file mode 100644 index 0000000..edf3243 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B958B17B60C70000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B958A17B60C70000B5911 /* Foundation.framework */; }; + 888B958D17B60C70000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B958C17B60C70000B5911 /* CoreGraphics.framework */; }; + 888B958F17B60C70000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B958E17B60C70000B5911 /* UIKit.framework */; }; + 888B959517B60C70000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B959317B60C70000B5911 /* InfoPlist.strings */; }; + 888B959717B60C70000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B959617B60C70000B5911 /* main.m */; }; + 888B959B17B60C70000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B959A17B60C70000B5911 /* AppDelegate.m */; }; + 888B959E17B60C70000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B959C17B60C70000B5911 /* Main.storyboard */; }; + 888B95A117B60C70000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B95A017B60C70000B5911 /* ViewController.m */; }; + 888B95A317B60C70000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B95A217B60C70000B5911 /* Images.xcassets */; }; + 888B95AA17B60C70000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95A917B60C70000B5911 /* XCTest.framework */; }; + 888B95AB17B60C70000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B958A17B60C70000B5911 /* Foundation.framework */; }; + 888B95AC17B60C70000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B958E17B60C70000B5911 /* UIKit.framework */; }; + 888B95B417B60C70000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B95B217B60C70000B5911 /* InfoPlist.strings */; }; + 888B95B617B60C70000B5911 /* Recipe_6_4__Moving_a_Label_with_GravityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B95B517B60C70000B5911 /* Recipe_6_4__Moving_a_Label_with_GravityTests.m */; }; + 888B95C017B60C8A000B5911 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95BF17B60C8A000B5911 /* CoreMotion.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B95AD17B60C70000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B957F17B60C70000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B958617B60C70000B5911; + remoteInfo = "Recipe 6-4: Moving a Label with Gravity"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B958717B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 6-4 Moving a Label with Gravity.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B958A17B60C70000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B958C17B60C70000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B958E17B60C70000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B959217B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-4 Moving a Label with Gravity-Info.plist"; sourceTree = ""; }; + 888B959417B60C70000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B959617B60C70000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B959817B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 6-4 Moving a Label with Gravity-Prefix.pch"; sourceTree = ""; }; + 888B959917B60C70000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B959A17B60C70000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B959D17B60C70000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B959F17B60C70000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B95A017B60C70000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B95A217B60C70000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B95A817B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 6-4 Moving a Label with GravityTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B95A917B60C70000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B95B117B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 6-4 Moving a Label with GravityTests-Info.plist"; sourceTree = ""; }; + 888B95B317B60C70000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B95B517B60C70000B5911 /* Recipe_6_4__Moving_a_Label_with_GravityTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_6_4__Moving_a_Label_with_GravityTests.m; sourceTree = ""; }; + 888B95BF17B60C8A000B5911 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B958417B60C70000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95C017B60C8A000B5911 /* CoreMotion.framework in Frameworks */, + 888B958D17B60C70000B5911 /* CoreGraphics.framework in Frameworks */, + 888B958F17B60C70000B5911 /* UIKit.framework in Frameworks */, + 888B958B17B60C70000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B95A517B60C70000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95AA17B60C70000B5911 /* XCTest.framework in Frameworks */, + 888B95AC17B60C70000B5911 /* UIKit.framework in Frameworks */, + 888B95AB17B60C70000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B957E17B60C70000B5911 = { + isa = PBXGroup; + children = ( + 888B959017B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity */, + 888B95AF17B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests */, + 888B958917B60C70000B5911 /* Frameworks */, + 888B958817B60C70000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B958817B60C70000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B958717B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity.app */, + 888B95A817B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B958917B60C70000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B95BF17B60C8A000B5911 /* CoreMotion.framework */, + 888B958A17B60C70000B5911 /* Foundation.framework */, + 888B958C17B60C70000B5911 /* CoreGraphics.framework */, + 888B958E17B60C70000B5911 /* UIKit.framework */, + 888B95A917B60C70000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B959017B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity */ = { + isa = PBXGroup; + children = ( + 888B959917B60C70000B5911 /* AppDelegate.h */, + 888B959A17B60C70000B5911 /* AppDelegate.m */, + 888B959C17B60C70000B5911 /* Main.storyboard */, + 888B959F17B60C70000B5911 /* ViewController.h */, + 888B95A017B60C70000B5911 /* ViewController.m */, + 888B95A217B60C70000B5911 /* Images.xcassets */, + 888B959117B60C70000B5911 /* Supporting Files */, + ); + name = "Recipe 6-4 Moving a Label with Gravity"; + path = "Recipe 6-4: Moving a Label with Gravity"; + sourceTree = ""; + }; + 888B959117B60C70000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B959217B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity-Info.plist */, + 888B959317B60C70000B5911 /* InfoPlist.strings */, + 888B959617B60C70000B5911 /* main.m */, + 888B959817B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B95AF17B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests */ = { + isa = PBXGroup; + children = ( + 888B95B517B60C70000B5911 /* Recipe_6_4__Moving_a_Label_with_GravityTests.m */, + 888B95B017B60C70000B5911 /* Supporting Files */, + ); + name = "Recipe 6-4 Moving a Label with GravityTests"; + path = "Recipe 6-4: Moving a Label with GravityTests"; + sourceTree = ""; + }; + 888B95B017B60C70000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B95B117B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests-Info.plist */, + 888B95B217B60C70000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B958617B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B95B917B60C70000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-4 Moving a Label with Gravity" */; + buildPhases = ( + 888B958317B60C70000B5911 /* Sources */, + 888B958417B60C70000B5911 /* Frameworks */, + 888B958517B60C70000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 6-4 Moving a Label with Gravity"; + productName = "Recipe 6-4: Moving a Label with Gravity"; + productReference = 888B958717B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity.app */; + productType = "com.apple.product-type.application"; + }; + 888B95A717B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B95BC17B60C70000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-4 Moving a Label with GravityTests" */; + buildPhases = ( + 888B95A417B60C70000B5911 /* Sources */, + 888B95A517B60C70000B5911 /* Frameworks */, + 888B95A617B60C70000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B95AE17B60C70000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 6-4 Moving a Label with GravityTests"; + productName = "Recipe 6-4: Moving a Label with GravityTests"; + productReference = 888B95A817B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B957F17B60C70000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B95A717B60C70000B5911 = { + TestTargetID = 888B958617B60C70000B5911; + }; + }; + }; + buildConfigurationList = 888B958217B60C70000B5911 /* Build configuration list for PBXProject "Recipe 6-4 Moving a Label with Gravity" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B957E17B60C70000B5911; + productRefGroup = 888B958817B60C70000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B958617B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity */, + 888B95A717B60C70000B5911 /* Recipe 6-4 Moving a Label with GravityTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B958517B60C70000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95A317B60C70000B5911 /* Images.xcassets in Resources */, + 888B959517B60C70000B5911 /* InfoPlist.strings in Resources */, + 888B959E17B60C70000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B95A617B60C70000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95B417B60C70000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B958317B60C70000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95A117B60C70000B5911 /* ViewController.m in Sources */, + 888B959B17B60C70000B5911 /* AppDelegate.m in Sources */, + 888B959717B60C70000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B95A417B60C70000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95B617B60C70000B5911 /* Recipe_6_4__Moving_a_Label_with_GravityTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B95AE17B60C70000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B958617B60C70000B5911 /* Recipe 6-4 Moving a Label with Gravity */; + targetProxy = 888B95AD17B60C70000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B959317B60C70000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B959417B60C70000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B959C17B60C70000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B959D17B60C70000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B95B217B60C70000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B95B317B60C70000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B95B717B60C70000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B95B817B60C70000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B95BA17B60C70000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-4: Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-4: Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Info.plist"; + PRODUCT_NAME = "Recipe 6-4 Moving a Label with Gravity"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B95BB17B60C70000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-4: Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-4: Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Info.plist"; + PRODUCT_NAME = "Recipe 6-4 Moving a Label with Gravity"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B95BD17B60C70000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-4: Moving a Label with Gravity.app/Recipe 6-4: Moving a Label with Gravity"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-4: Moving a Label with Gravity/Recipe 6-4: Moving a Label with Gravity-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 6-4: Moving a Label with GravityTests/Recipe 6-4 Moving a Label with GravityTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-4 Moving a Label with GravityTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B95BE17B60C70000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 6-4: Moving a Label with Gravity.app/Recipe 6-4: Moving a Label with Gravity"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 6-4: Moving a Label with Gravity/Recipe 6-4: Moving a Label with Gravity-Prefix.pch"; + INFOPLIST_FILE = "Recipe 6-4: Moving a Label with GravityTests/Recipe 6-4 Moving a Label with GravityTests-Info.plist"; + PRODUCT_NAME = "Recipe 6-4 Moving a Label with GravityTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B958217B60C70000B5911 /* Build configuration list for PBXProject "Recipe 6-4 Moving a Label with Gravity" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B95B717B60C70000B5911 /* Debug */, + 888B95B817B60C70000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B95B917B60C70000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-4 Moving a Label with Gravity" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B95BA17B60C70000B5911 /* Debug */, + 888B95BB17B60C70000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B95BC17B60C70000B5911 /* Build configuration list for PBXNativeTarget "Recipe 6-4 Moving a Label with GravityTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B95BD17B60C70000B5911 /* Debug */, + 888B95BE17B60C70000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B957F17B60C70000B5911 /* Project object */; +} diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..181036f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..931b8d2 Binary files /dev/null and b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-4_ Moving a Label with Gravity.xcscheme b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-4_ Moving a Label with Gravity.xcscheme new file mode 100644 index 0000000..0c620ff --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 6-4_ Moving a Label with Gravity.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ea7519a --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 6-4: Moving a Label with Gravity.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B958617B60C70000B5911 + + primary + + + 888B95A717B60C70000B5911 + + primary + + + + + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/AppDelegate.h b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/AppDelegate.h new file mode 100644 index 0000000..7772949 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 6-4: Moving a Label with Gravity +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/AppDelegate.m b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/AppDelegate.m new file mode 100644 index 0000000..37f36c2 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 6-4: Moving a Label with Gravity +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Base.lproj/Main.storyboard b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e238032 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Base.lproj/Main.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Images.xcassets/AppIcon.appiconset/Contents.json b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Info.plist b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Info.plist new file mode 100644 index 0000000..67948fe --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Prefix.pch b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4 Moving a Label with Gravity-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/ViewController.h b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/ViewController.h new file mode 100644 index 0000000..2d60990 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/ViewController.h @@ -0,0 +1,18 @@ +// +// ViewController.h +// Recipe 6-4: Moving a Label with Gravity +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) CMMotionManager *motionManager; + +@property (weak, nonatomic) IBOutlet UILabel *myLabel; + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/ViewController.m b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/ViewController.m new file mode 100644 index 0000000..6654dbc --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/ViewController.m @@ -0,0 +1,107 @@ +// +// ViewController.m +// Recipe 6-4: Moving a Label with Gravity +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + [self startUpdates]; +} +-(void)viewWillDisappear:(BOOL)animated +{ + + [self stopUpdates]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +-(CMMotionManager *)motionManager +{ + //Lazy initilization + if(_motionManager == nil) + { + _motionManager = [[CMMotionManager alloc] init]; + } + return _motionManager; +} +- (void)startUpdates +{ + if ([self.motionManager isDeviceMotionAvailable] && + ![self.motionManager isDeviceMotionActive]) + { + __block double accumulatedDx = 0; + __block double accumulatedDy = 0; + + [self.motionManager setDeviceMotionUpdateInterval:1.0/50.0]; + [self.motionManager startDeviceMotionUpdatesUsingReferenceFrame: + CMAttitudeReferenceFrameXArbitraryCorrectedZVertical + toQueue:[NSOperationQueue mainQueue] + withHandler: + ^(CMDeviceMotion *motion, NSError *error) + { + CGRect labelRect = self.myLabel.frame; + double scale = 1.5; + + double dx = motion.gravity.x * scale; + accumulatedDx += dx; + labelRect.origin.x += accumulatedDx; + + if (labelRect.origin.x < 0) + { + labelRect.origin.x = 0; + accumulatedDx = 0; + } + else if (labelRect.origin.x + labelRect.size.width > + self.view.bounds.size.width) + { + labelRect.origin.x = + self.view.bounds.size.width - labelRect.size.width; + accumulatedDx = 0; + } + + double dy = motion.gravity.y * scale; + accumulatedDy += dy; + labelRect.origin.y -= accumulatedDy; + + if (labelRect.origin.y < 0) + { + labelRect.origin.y = 0; + accumulatedDy = 0; + } + else if (labelRect.origin.y + labelRect.size.height > self.view.bounds.size.height) + { + labelRect.origin.y = self.view.bounds.size.height - labelRect.size.height; + accumulatedDy = 0; + } + + [self.myLabel setFrame:labelRect]; + }]; + } +} + + +- (void)stopUpdates +{ + if ([self.motionManager isDeviceMotionAvailable] && + [self.motionManager isDeviceMotionActive]) + { + [self.motionManager stopDeviceMotionUpdates]; + } +} +@end diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/main.m b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/main.m new file mode 100644 index 0000000..1d656d2 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with Gravity/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 6-4: Moving a Label with Gravity +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/Recipe 6-4 Moving a Label with GravityTests-Info.plist b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/Recipe 6-4 Moving a Label with GravityTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/Recipe 6-4 Moving a Label with GravityTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/Recipe_6_4__Moving_a_Label_with_GravityTests.m b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/Recipe_6_4__Moving_a_Label_with_GravityTests.m new file mode 100644 index 0000000..88f7e45 --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/Recipe_6_4__Moving_a_Label_with_GravityTests.m @@ -0,0 +1,34 @@ +// +// Recipe_6_4__Moving_a_Label_with_GravityTests.m +// Recipe 6-4: Moving a Label with GravityTests +// +// Created by joseph hoffman on 8/9/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_6_4__Moving_a_Label_with_GravityTests : XCTestCase + +@end + +@implementation Recipe_6_4__Moving_a_Label_with_GravityTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/en.lproj/InfoPlist.strings b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH6 - Motion Recipes/Recipe 6-4_ Moving a Label with Gravity/Recipe 6-4_ Moving a Label with GravityTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8ae35b6 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88D3EF0F17B9EC0F003487AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF0E17B9EC0F003487AA /* Foundation.framework */; }; + 88D3EF1117B9EC0F003487AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF1017B9EC0F003487AA /* CoreGraphics.framework */; }; + 88D3EF1317B9EC0F003487AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF1217B9EC0F003487AA /* UIKit.framework */; }; + 88D3EF1917B9EC0F003487AA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88D3EF1717B9EC0F003487AA /* InfoPlist.strings */; }; + 88D3EF1B17B9EC0F003487AA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D3EF1A17B9EC0F003487AA /* main.m */; }; + 88D3EF1F17B9EC0F003487AA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D3EF1E17B9EC0F003487AA /* AppDelegate.m */; }; + 88D3EF2217B9EC0F003487AA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88D3EF2017B9EC0F003487AA /* Main.storyboard */; }; + 88D3EF2517B9EC0F003487AA /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D3EF2417B9EC0F003487AA /* ViewController.m */; }; + 88D3EF2717B9EC0F003487AA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88D3EF2617B9EC0F003487AA /* Images.xcassets */; }; + 88D3EF2E17B9EC0F003487AA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF2D17B9EC0F003487AA /* XCTest.framework */; }; + 88D3EF2F17B9EC0F003487AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF0E17B9EC0F003487AA /* Foundation.framework */; }; + 88D3EF3017B9EC0F003487AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF1217B9EC0F003487AA /* UIKit.framework */; }; + 88D3EF3817B9EC0F003487AA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88D3EF3617B9EC0F003487AA /* InfoPlist.strings */; }; + 88D3EF3A17B9EC0F003487AA /* Recipe_7_10__Using_3D_MappingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D3EF3917B9EC0F003487AA /* Recipe_7_10__Using_3D_MappingTests.m */; }; + 88D3EF4417B9EC25003487AA /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF4317B9EC25003487AA /* MapKit.framework */; }; + 88D3EF4617B9EC2C003487AA /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88D3EF4517B9EC2C003487AA /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88D3EF3117B9EC0F003487AA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88D3EF0317B9EC0F003487AA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88D3EF0A17B9EC0F003487AA; + remoteInfo = "Recipe 7-10: Using 3D Mapping"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88D3EF0B17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-10 Using 3D Mapping.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88D3EF0E17B9EC0F003487AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88D3EF1017B9EC0F003487AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88D3EF1217B9EC0F003487AA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88D3EF1617B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-10 Using 3D Mapping-Info.plist"; sourceTree = ""; }; + 88D3EF1817B9EC0F003487AA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88D3EF1A17B9EC0F003487AA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88D3EF1C17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-10 Using 3D Mapping-Prefix.pch"; sourceTree = ""; }; + 88D3EF1D17B9EC0F003487AA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88D3EF1E17B9EC0F003487AA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88D3EF2117B9EC0F003487AA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88D3EF2317B9EC0F003487AA /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88D3EF2417B9EC0F003487AA /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88D3EF2617B9EC0F003487AA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88D3EF2C17B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-10 Using 3D MappingTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88D3EF2D17B9EC0F003487AA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88D3EF3517B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-10 Using 3D MappingTests-Info.plist"; sourceTree = ""; }; + 88D3EF3717B9EC0F003487AA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88D3EF3917B9EC0F003487AA /* Recipe_7_10__Using_3D_MappingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_10__Using_3D_MappingTests.m; sourceTree = ""; }; + 88D3EF4317B9EC25003487AA /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 88D3EF4517B9EC2C003487AA /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88D3EF0817B9EC0F003487AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D3EF4617B9EC2C003487AA /* CoreLocation.framework in Frameworks */, + 88D3EF4417B9EC25003487AA /* MapKit.framework in Frameworks */, + 88D3EF1117B9EC0F003487AA /* CoreGraphics.framework in Frameworks */, + 88D3EF1317B9EC0F003487AA /* UIKit.framework in Frameworks */, + 88D3EF0F17B9EC0F003487AA /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88D3EF2917B9EC0F003487AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D3EF2E17B9EC0F003487AA /* XCTest.framework in Frameworks */, + 88D3EF3017B9EC0F003487AA /* UIKit.framework in Frameworks */, + 88D3EF2F17B9EC0F003487AA /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88D3EF0217B9EC0F003487AA = { + isa = PBXGroup; + children = ( + 88D3EF1417B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping */, + 88D3EF3317B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests */, + 88D3EF0D17B9EC0F003487AA /* Frameworks */, + 88D3EF0C17B9EC0F003487AA /* Products */, + ); + sourceTree = ""; + }; + 88D3EF0C17B9EC0F003487AA /* Products */ = { + isa = PBXGroup; + children = ( + 88D3EF0B17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping.app */, + 88D3EF2C17B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88D3EF0D17B9EC0F003487AA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88D3EF4517B9EC2C003487AA /* CoreLocation.framework */, + 88D3EF4317B9EC25003487AA /* MapKit.framework */, + 88D3EF0E17B9EC0F003487AA /* Foundation.framework */, + 88D3EF1017B9EC0F003487AA /* CoreGraphics.framework */, + 88D3EF1217B9EC0F003487AA /* UIKit.framework */, + 88D3EF2D17B9EC0F003487AA /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88D3EF1417B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping */ = { + isa = PBXGroup; + children = ( + 88D3EF1D17B9EC0F003487AA /* AppDelegate.h */, + 88D3EF1E17B9EC0F003487AA /* AppDelegate.m */, + 88D3EF2017B9EC0F003487AA /* Main.storyboard */, + 88D3EF2317B9EC0F003487AA /* ViewController.h */, + 88D3EF2417B9EC0F003487AA /* ViewController.m */, + 88D3EF2617B9EC0F003487AA /* Images.xcassets */, + 88D3EF1517B9EC0F003487AA /* Supporting Files */, + ); + name = "Recipe 7-10 Using 3D Mapping"; + path = "Recipe 7-10: Using 3D Mapping"; + sourceTree = ""; + }; + 88D3EF1517B9EC0F003487AA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88D3EF1617B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping-Info.plist */, + 88D3EF1717B9EC0F003487AA /* InfoPlist.strings */, + 88D3EF1A17B9EC0F003487AA /* main.m */, + 88D3EF1C17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88D3EF3317B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests */ = { + isa = PBXGroup; + children = ( + 88D3EF3917B9EC0F003487AA /* Recipe_7_10__Using_3D_MappingTests.m */, + 88D3EF3417B9EC0F003487AA /* Supporting Files */, + ); + name = "Recipe 7-10 Using 3D MappingTests"; + path = "Recipe 7-10: Using 3D MappingTests"; + sourceTree = ""; + }; + 88D3EF3417B9EC0F003487AA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88D3EF3517B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests-Info.plist */, + 88D3EF3617B9EC0F003487AA /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88D3EF0A17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88D3EF3D17B9EC0F003487AA /* Build configuration list for PBXNativeTarget "Recipe 7-10 Using 3D Mapping" */; + buildPhases = ( + 88D3EF0717B9EC0F003487AA /* Sources */, + 88D3EF0817B9EC0F003487AA /* Frameworks */, + 88D3EF0917B9EC0F003487AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-10 Using 3D Mapping"; + productName = "Recipe 7-10: Using 3D Mapping"; + productReference = 88D3EF0B17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping.app */; + productType = "com.apple.product-type.application"; + }; + 88D3EF2B17B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88D3EF4017B9EC0F003487AA /* Build configuration list for PBXNativeTarget "Recipe 7-10 Using 3D MappingTests" */; + buildPhases = ( + 88D3EF2817B9EC0F003487AA /* Sources */, + 88D3EF2917B9EC0F003487AA /* Frameworks */, + 88D3EF2A17B9EC0F003487AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88D3EF3217B9EC0F003487AA /* PBXTargetDependency */, + ); + name = "Recipe 7-10 Using 3D MappingTests"; + productName = "Recipe 7-10: Using 3D MappingTests"; + productReference = 88D3EF2C17B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88D3EF0317B9EC0F003487AA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88D3EF2B17B9EC0F003487AA = { + TestTargetID = 88D3EF0A17B9EC0F003487AA; + }; + }; + }; + buildConfigurationList = 88D3EF0617B9EC0F003487AA /* Build configuration list for PBXProject "Recipe 7-10 Using 3D Mapping" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88D3EF0217B9EC0F003487AA; + productRefGroup = 88D3EF0C17B9EC0F003487AA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88D3EF0A17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping */, + 88D3EF2B17B9EC0F003487AA /* Recipe 7-10 Using 3D MappingTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88D3EF0917B9EC0F003487AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D3EF2717B9EC0F003487AA /* Images.xcassets in Resources */, + 88D3EF1917B9EC0F003487AA /* InfoPlist.strings in Resources */, + 88D3EF2217B9EC0F003487AA /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88D3EF2A17B9EC0F003487AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D3EF3817B9EC0F003487AA /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88D3EF0717B9EC0F003487AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D3EF2517B9EC0F003487AA /* ViewController.m in Sources */, + 88D3EF1F17B9EC0F003487AA /* AppDelegate.m in Sources */, + 88D3EF1B17B9EC0F003487AA /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88D3EF2817B9EC0F003487AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88D3EF3A17B9EC0F003487AA /* Recipe_7_10__Using_3D_MappingTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88D3EF3217B9EC0F003487AA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88D3EF0A17B9EC0F003487AA /* Recipe 7-10 Using 3D Mapping */; + targetProxy = 88D3EF3117B9EC0F003487AA /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88D3EF1717B9EC0F003487AA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88D3EF1817B9EC0F003487AA /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88D3EF2017B9EC0F003487AA /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88D3EF2117B9EC0F003487AA /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88D3EF3617B9EC0F003487AA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88D3EF3717B9EC0F003487AA /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88D3EF3B17B9EC0F003487AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88D3EF3C17B9EC0F003487AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88D3EF3E17B9EC0F003487AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-10: Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-10: Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Info.plist"; + PRODUCT_NAME = "Recipe 7-10 Using 3D Mapping"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88D3EF3F17B9EC0F003487AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-10: Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-10: Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Info.plist"; + PRODUCT_NAME = "Recipe 7-10 Using 3D Mapping"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88D3EF4117B9EC0F003487AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-10: Using 3D Mapping.app/Recipe 7-10: Using 3D Mapping"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-10: Using 3D Mapping/Recipe 7-10: Using 3D Mapping-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-10: Using 3D MappingTests/Recipe 7-10 Using 3D MappingTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-10 Using 3D MappingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88D3EF4217B9EC0F003487AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-10: Using 3D Mapping.app/Recipe 7-10: Using 3D Mapping"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-10: Using 3D Mapping/Recipe 7-10: Using 3D Mapping-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-10: Using 3D MappingTests/Recipe 7-10 Using 3D MappingTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-10 Using 3D MappingTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88D3EF0617B9EC0F003487AA /* Build configuration list for PBXProject "Recipe 7-10 Using 3D Mapping" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88D3EF3B17B9EC0F003487AA /* Debug */, + 88D3EF3C17B9EC0F003487AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88D3EF3D17B9EC0F003487AA /* Build configuration list for PBXNativeTarget "Recipe 7-10 Using 3D Mapping" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88D3EF3E17B9EC0F003487AA /* Debug */, + 88D3EF3F17B9EC0F003487AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88D3EF4017B9EC0F003487AA /* Build configuration list for PBXNativeTarget "Recipe 7-10 Using 3D MappingTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88D3EF4117B9EC0F003487AA /* Debug */, + 88D3EF4217B9EC0F003487AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88D3EF0317B9EC0F003487AA /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..7675e1d --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..13c8970 Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-10_ Using 3D Mapping.xcscheme b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-10_ Using 3D Mapping.xcscheme new file mode 100644 index 0000000..d31c204 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-10_ Using 3D Mapping.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f6079a0 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-10: Using 3D Mapping.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88D3EF0A17B9EC0F003487AA + + primary + + + 88D3EF2B17B9EC0F003487AA + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/AppDelegate.h new file mode 100644 index 0000000..f3c521b --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-10: Using 3D Mapping +// +// Created by joseph hoffman on 8/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/AppDelegate.m new file mode 100644 index 0000000..c3188c0 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-10: Using 3D Mapping +// +// Created by joseph hoffman on 8/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Base.lproj/Main.storyboard new file mode 100644 index 0000000..7559faa --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Info.plist b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Prefix.pch b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/Recipe 7-10 Using 3D Mapping-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/ViewController.h b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/ViewController.h new file mode 100644 index 0000000..b0688b1 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/ViewController.h @@ -0,0 +1,16 @@ +// +// ViewController.h +// Recipe 7-10: Using 3D Mapping +// +// Created by joseph hoffman on 8/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; +@end diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/ViewController.m b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/ViewController.m new file mode 100644 index 0000000..74d0fcf --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/ViewController.m @@ -0,0 +1,86 @@ +// +// ViewController.m +// Recipe 7-10: Using 3D Mapping +// +// Created by joseph hoffman on 8/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mapView.delegate = self; + + + //Create a new MKMapCamera object + //MKMapCamera *mapCamera = [[MKMapCamera alloc] init]; + + + //set MKMapCamera properties + //mapCamera.centerCoordinate = CLLocationCoordinate2DMake(40.7130,-74.0085); + //mapCamera.pitch = 57; + //mapCamera.altitude = 650; + //mapCamera.heading = 90; + + //Using the Convenience Method + + CLLocationCoordinate2D ground = CLLocationCoordinate2DMake(40.7128,-74.0117); + CLLocationCoordinate2D eye = CLLocationCoordinate2DMake(40.7132,-74.0150); + MKMapCamera *mapCamera = [MKMapCamera cameraLookingAtCenterCoordinate:ground fromEyeCoordinate:eye eyeAltitude:700]; + + CLLocationCoordinate2D ground2 = CLLocationCoordinate2DMake(40.7,-73.99); + CLLocationCoordinate2D eye2 = CLLocationCoordinate2DMake(40.7,-73.98); + MKMapCamera *mapCamera2 = [MKMapCamera cameraLookingAtCenterCoordinate:ground2 fromEyeCoordinate:eye2 eyeAltitude:700]; + + + + //Set MKmapView camera property + self.mapView.camera = mapCamera; + + //Set a few MKMapView Properties to allow pitch, building view, points of interest, and zooming. + self.mapView.pitchEnabled = YES; + self.mapView.showsBuildings = YES; + self.mapView.showsPointsOfInterest = YES; + self.mapView.zoomEnabled = YES; + + + + [UIView animateWithDuration:25.0 animations:^{ + + + + self.mapView.camera = mapCamera2; + + }]; + + + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated +{ + + NSLog(@"pitch: %f",self.mapView.camera.pitch); + NSLog(@"altitude: %f",self.mapView.camera.altitude); + NSLog(@"heading: %f",self.mapView.camera.heading); + + + +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/main.m b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/main.m new file mode 100644 index 0000000..b3df9bf --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D Mapping/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-10: Using 3D Mapping +// +// Created by joseph hoffman on 8/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/Recipe 7-10 Using 3D MappingTests-Info.plist b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/Recipe 7-10 Using 3D MappingTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/Recipe 7-10 Using 3D MappingTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/Recipe_7_10__Using_3D_MappingTests.m b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/Recipe_7_10__Using_3D_MappingTests.m new file mode 100644 index 0000000..1e10c38 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/Recipe_7_10__Using_3D_MappingTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_10__Using_3D_MappingTests.m +// Recipe 7-10: Using 3D MappingTests +// +// Created by joseph hoffman on 8/12/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_10__Using_3D_MappingTests : XCTestCase + +@end + +@implementation Recipe_7_10__Using_3D_MappingTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-10_ Using 3D Mapping/Recipe 7-10_ Using 3D MappingTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d20b886 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/project.pbxproj @@ -0,0 +1,490 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B95CE17B6E653000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95CD17B6E653000B5911 /* Foundation.framework */; }; + 888B95D017B6E653000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95CF17B6E653000B5911 /* CoreGraphics.framework */; }; + 888B95D217B6E653000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95D117B6E653000B5911 /* UIKit.framework */; }; + 888B95D817B6E653000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B95D617B6E653000B5911 /* InfoPlist.strings */; }; + 888B95DA17B6E653000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B95D917B6E653000B5911 /* main.m */; }; + 888B95DE17B6E653000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B95DD17B6E653000B5911 /* AppDelegate.m */; }; + 888B95E117B6E653000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B95DF17B6E653000B5911 /* Main.storyboard */; }; + 888B95E417B6E653000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B95E317B6E653000B5911 /* ViewController.m */; }; + 888B95E617B6E653000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B95E517B6E653000B5911 /* Images.xcassets */; }; + 888B95ED17B6E654000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95EC17B6E654000B5911 /* XCTest.framework */; }; + 888B95EE17B6E654000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95CD17B6E653000B5911 /* Foundation.framework */; }; + 888B95EF17B6E655000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B95D117B6E653000B5911 /* UIKit.framework */; }; + 888B95F717B6E655000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B95F517B6E655000B5911 /* InfoPlist.strings */; }; + 888B95F917B6E655000B5911 /* Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B95F817B6E655000B5911 /* Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m */; }; + 888B960317B6EABB000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B960217B6EABA000B5911 /* MapKit.framework */; }; + 888B960517B6EAC6000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B960417B6EAC6000B5911 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B95F017B6E655000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B95C217B6E652000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B95C917B6E652000B5911; + remoteInfo = "Recipe 7-1: Showing a Map with the Current Locaiton"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B95CA17B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Location.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-1 Showing a Map with the Current Location.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B95CD17B6E653000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B95CF17B6E653000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B95D117B6E653000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B95D517B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Location-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-1 Showing a Map with the Current Location-Info.plist"; sourceTree = ""; }; + 888B95D717B6E653000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B95D917B6E653000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B95DB17B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Location-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-1 Showing a Map with the Current Location-Prefix.pch"; sourceTree = ""; }; + 888B95DC17B6E653000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B95DD17B6E653000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B95E017B6E653000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B95E217B6E653000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B95E317B6E653000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B95E517B6E653000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B95EB17B6E654000B5911 /* Recipe 7-1 Showing a Map with the Current LocationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-1 Showing a Map with the Current LocationTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B95EC17B6E654000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B95F417B6E655000B5911 /* Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist"; sourceTree = ""; }; + 888B95F617B6E655000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B95F817B6E655000B5911 /* Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m"; sourceTree = ""; }; + 888B960217B6EABA000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B960417B6EAC6000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B95C717B6E652000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B960517B6EAC6000B5911 /* CoreLocation.framework in Frameworks */, + 888B960317B6EABB000B5911 /* MapKit.framework in Frameworks */, + 888B95D017B6E653000B5911 /* CoreGraphics.framework in Frameworks */, + 888B95D217B6E653000B5911 /* UIKit.framework in Frameworks */, + 888B95CE17B6E653000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B95E817B6E654000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95ED17B6E654000B5911 /* XCTest.framework in Frameworks */, + 888B95EF17B6E655000B5911 /* UIKit.framework in Frameworks */, + 888B95EE17B6E654000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B95C117B6E652000B5911 = { + isa = PBXGroup; + children = ( + 888B95D317B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Locaiton */, + 888B95F217B6E655000B5911 /* Recipe 7-1 Showing a Map with the Current LocaitonTests */, + 888B95CC17B6E653000B5911 /* Frameworks */, + 888B95CB17B6E653000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B95CB17B6E653000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B95CA17B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Location.app */, + 888B95EB17B6E654000B5911 /* Recipe 7-1 Showing a Map with the Current LocationTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B95CC17B6E653000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B960417B6EAC6000B5911 /* CoreLocation.framework */, + 888B960217B6EABA000B5911 /* MapKit.framework */, + 888B95CD17B6E653000B5911 /* Foundation.framework */, + 888B95CF17B6E653000B5911 /* CoreGraphics.framework */, + 888B95D117B6E653000B5911 /* UIKit.framework */, + 888B95EC17B6E654000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B95D317B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Locaiton */ = { + isa = PBXGroup; + children = ( + 888B95DC17B6E653000B5911 /* AppDelegate.h */, + 888B95DD17B6E653000B5911 /* AppDelegate.m */, + 888B95DF17B6E653000B5911 /* Main.storyboard */, + 888B95E217B6E653000B5911 /* ViewController.h */, + 888B95E317B6E653000B5911 /* ViewController.m */, + 888B95E517B6E653000B5911 /* Images.xcassets */, + 888B95D417B6E653000B5911 /* Supporting Files */, + ); + name = "Recipe 7-1 Showing a Map with the Current Locaiton"; + path = "Recipe 7-1: Showing a Map with the Current Locaiton"; + sourceTree = ""; + }; + 888B95D417B6E653000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B95D517B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Location-Info.plist */, + 888B95D617B6E653000B5911 /* InfoPlist.strings */, + 888B95D917B6E653000B5911 /* main.m */, + 888B95DB17B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Location-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B95F217B6E655000B5911 /* Recipe 7-1 Showing a Map with the Current LocaitonTests */ = { + isa = PBXGroup; + children = ( + 888B95F817B6E655000B5911 /* Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m */, + 888B95F317B6E655000B5911 /* Supporting Files */, + ); + name = "Recipe 7-1 Showing a Map with the Current LocaitonTests"; + path = "Recipe 7-1: Showing a Map with the Current LocaitonTests"; + sourceTree = ""; + }; + 888B95F317B6E655000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B95F417B6E655000B5911 /* Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist */, + 888B95F517B6E655000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B95C917B6E652000B5911 /* Recipe 7-1 Showing a Map with the Current Location */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B95FC17B6E655000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-1 Showing a Map with the Current Location" */; + buildPhases = ( + 888B95C617B6E652000B5911 /* Sources */, + 888B95C717B6E652000B5911 /* Frameworks */, + 888B95C817B6E652000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-1 Showing a Map with the Current Location"; + productName = "Recipe 7-1: Showing a Map with the Current Locaiton"; + productReference = 888B95CA17B6E653000B5911 /* Recipe 7-1 Showing a Map with the Current Location.app */; + productType = "com.apple.product-type.application"; + }; + 888B95EA17B6E654000B5911 /* Recipe 7-1 Showing a Map with the Current LocationTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B95FF17B6E655000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-1 Showing a Map with the Current LocationTests" */; + buildPhases = ( + 888B95E717B6E654000B5911 /* Sources */, + 888B95E817B6E654000B5911 /* Frameworks */, + 888B95E917B6E654000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B95F117B6E655000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-1 Showing a Map with the Current LocationTests"; + productName = "Recipe 7-1: Showing a Map with the Current LocaitonTests"; + productReference = 888B95EB17B6E654000B5911 /* Recipe 7-1 Showing a Map with the Current LocationTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B95C217B6E652000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B95C917B6E652000B5911 = { + DevelopmentTeam = H7ALWBN8YV; + }; + 888B95EA17B6E654000B5911 = { + TestTargetID = 888B95C917B6E652000B5911; + }; + }; + }; + buildConfigurationList = 888B95C517B6E652000B5911 /* Build configuration list for PBXProject "Recipe 7-1 Showing a Map with the Current Location" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B95C117B6E652000B5911; + productRefGroup = 888B95CB17B6E653000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B95C917B6E652000B5911 /* Recipe 7-1 Showing a Map with the Current Location */, + 888B95EA17B6E654000B5911 /* Recipe 7-1 Showing a Map with the Current LocationTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B95C817B6E652000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95E617B6E653000B5911 /* Images.xcassets in Resources */, + 888B95D817B6E653000B5911 /* InfoPlist.strings in Resources */, + 888B95E117B6E653000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B95E917B6E654000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95F717B6E655000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B95C617B6E652000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95E417B6E653000B5911 /* ViewController.m in Sources */, + 888B95DE17B6E653000B5911 /* AppDelegate.m in Sources */, + 888B95DA17B6E653000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B95E717B6E654000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B95F917B6E655000B5911 /* Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B95F117B6E655000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B95C917B6E652000B5911 /* Recipe 7-1 Showing a Map with the Current Location */; + targetProxy = 888B95F017B6E655000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B95D617B6E653000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B95D717B6E653000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B95DF17B6E653000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B95E017B6E653000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B95F517B6E655000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B95F617B6E655000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B95FA17B6E655000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B95FB17B6E655000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B95FD17B6E655000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-1: Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Info.plist"; + PRODUCT_NAME = "Recipe 7-1 Showing a Map with the Current Location"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B95FE17B6E655000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-1: Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Info.plist"; + PRODUCT_NAME = "Recipe 7-1 Showing a Map with the Current Location"; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B960017B6E655000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-1: Showing a Map with the Current Locaiton.app/Recipe 7-1: Showing a Map with the Current Locaiton"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Showing a Map with the Current Locaiton/Recipe 7-1: Showing a Map with the Current Locaiton-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-1: Showing a Map with the Current LocaitonTests/Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-1 Showing a Map with the Current LocationTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B960117B6E655000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-1: Showing a Map with the Current Locaiton.app/Recipe 7-1: Showing a Map with the Current Locaiton"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Showing a Map with the Current Locaiton/Recipe 7-1: Showing a Map with the Current Locaiton-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-1: Showing a Map with the Current LocaitonTests/Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-1 Showing a Map with the Current LocationTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B95C517B6E652000B5911 /* Build configuration list for PBXProject "Recipe 7-1 Showing a Map with the Current Location" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B95FA17B6E655000B5911 /* Debug */, + 888B95FB17B6E655000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B95FC17B6E655000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-1 Showing a Map with the Current Location" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B95FD17B6E655000B5911 /* Debug */, + 888B95FE17B6E655000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B95FF17B6E655000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-1 Showing a Map with the Current LocationTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B960017B6E655000B5911 /* Debug */, + 888B960117B6E655000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B95C217B6E652000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..5010e60 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1926cb7 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-1: Showing a Map with the Current Locaiton.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B95C917B6E652000B5911 + + primary + + + 888B95EA17B6E654000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/AppDelegate.h new file mode 100644 index 0000000..7ecf4b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-1: Showing a Map with the Current Locaiton +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/AppDelegate.m new file mode 100644 index 0000000..0a81016 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-1: Showing a Map with the Current Locaiton +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Base.lproj/Main.storyboard new file mode 100644 index 0000000..7f23e7f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Base.lproj/Main.storyboard @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Info.plist b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Info.plist new file mode 100644 index 0000000..6ca50f3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationUsageDescription + Testing map views + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Prefix.pch b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1 Showing a Map with the Current Location-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/ViewController.h b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/ViewController.h new file mode 100644 index 0000000..a81b749 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Recipe 7-1: Showing a Map with the Current Locaiton +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + + +@interface ViewController : UIViewController + + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; +@property (weak, nonatomic) IBOutlet UILabel *userLocationLabel; + +@property (weak, nonatomic) IBOutlet UIToolbar *mapToolbar; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/ViewController.m b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/ViewController.m new file mode 100644 index 0000000..a7b369d --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/ViewController.m @@ -0,0 +1,63 @@ +///Users/josephhoffman/Google Drive/iOS 7 Book/iOS 7 Book Chapter folders/CH7 - Map Recipes/projects/Recipe 7-1: Showing a Map with the Current Locaiton/Recipe 7-1: Showing a Map with the Current Locaiton.xcodeproj +// ViewController.m +// Recipe 7-1: Showing a Map with the Current Locaiton +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mapView.delegate = self; + + // Set initial region + CLLocationCoordinate2D denverLocation = CLLocationCoordinate2DMake(39.739, 104.984); + self.mapView.region = + MKCoordinateRegionMakeWithDistance(denverLocation, 10000, 10000); + + // Optional Controls + // self.mapView.zoomEnabled = NO; + // self.mapView.scrollEnabled = NO; + + //Control User Location on Map + if ([CLLocationManager locationServicesEnabled]) + { + self.mapView.showsUserLocation = YES; + [self.mapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES]; + } + + // Add button for controlling user location tracking + MKUserTrackingBarButtonItem *trackingButton = + [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView]; + [self.mapToolbar setItems: [NSArray arrayWithObject: trackingButton] animated:YES]; + + + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - delegate methods + +-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation +{ + self.userLocationLabel.text = + [NSString stringWithFormat:@"Location: %.5f°, %.5f°", + userLocation.coordinate.latitude, userLocation.coordinate.longitude]; +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/main.m b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/main.m new file mode 100644 index 0000000..f1a22eb --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current Locaiton/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-1: Showing a Map with the Current Locaiton +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/Recipe 7-1 Showing a Map with the Current LocationTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m new file mode 100644 index 0000000..6f834b7 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests.m +// Recipe 7-1: Showing a Map with the Current LocaitonTests +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests : XCTestCase + +@end + +@implementation Recipe_7_1___Showing_a_Map_with_the_Current_LocaitonTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Showing a Map with the Current Locaiton/Recipe 7-1_ Showing a Map with the Current LocaitonTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/AppDelegate.h new file mode 100644 index 0000000..8ee84d1 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-2: Marking Locations wiht Pins +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/AppDelegate.m new file mode 100644 index 0000000..3b0ca71 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-2: Marking Locations wiht Pins +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e48e489 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Info.plist b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Prefix.pch b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/ViewController.h b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/ViewController.h new file mode 100644 index 0000000..8b3f57a --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/ViewController.h @@ -0,0 +1,17 @@ +// +// ViewController.h +// Recipe 7-2: Marking Locations wiht Pins +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/ViewController.m b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/ViewController.m new file mode 100644 index 0000000..4f707ef --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/ViewController.m @@ -0,0 +1,74 @@ +// +// ViewController.m +// Recipe 7-2: Marking Locations wiht Pins +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + self.mapView.delegate = self; + + MKPointAnnotation *annotation1 = [[MKPointAnnotation alloc] init]; + annotation1.title = @"Miami"; + annotation1.subtitle = @"Annotation 1"; + annotation1.coordinate = CLLocationCoordinate2DMake(25.802, -80.132); + + MKPointAnnotation *annotation2 = [[MKPointAnnotation alloc] init]; + annotation2.title = @"Denver"; + annotation2.subtitle = @"Annotation 2"; + annotation2.coordinate = CLLocationCoordinate2DMake(39.733, -105.018); + + [self.mapView addAnnotation:annotation1]; + [self.mapView addAnnotation:annotation2]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation +{ + // Don't create annotation views for the user location annotation + if ([annotation isKindOfClass:[MKPointAnnotation class]]) + { + static NSString *userPinAnnotationId = @"userPinAnnotation"; + + // Create an annotation view, but reuse a cached one if available + MKPinAnnotationView *annotationView =(MKPinAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:userPinAnnotationId]; + + if(annotationView) + { + // Cached view found. It’ll have the pin color set but not annotation. + annotationView.annotation = annotation; + } + else + { + // No cached view were available, create a new one + annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation + reuseIdentifier:userPinAnnotationId]; + + // Purple indicates user defined pin + annotationView.pinColor = MKPinAnnotationColorPurple; + } + + return annotationView; + } + return nil; +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/main.m b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/main.m new file mode 100644 index 0000000..a6645c4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht Pins/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-1: Marking Locations wiht Pins +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/Recipe 7-2 Marking Locations wiht PinsTests-Info.plist b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/Recipe 7-2 Marking Locations wiht PinsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/Recipe 7-2 Marking Locations wiht PinsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/Recipe_7_1__Marking_Locations_wiht_PinsTests.m b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/Recipe_7_1__Marking_Locations_wiht_PinsTests.m new file mode 100644 index 0000000..e82db59 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/Recipe_7_1__Marking_Locations_wiht_PinsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_1__Marking_Locations_wiht_PinsTests.m +// Recipe 7-1: Marking Locations wiht PinsTests +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_1__Marking_Locations_wiht_PinsTests : XCTestCase + +@end + +@implementation Recipe_7_1__Marking_Locations_wiht_PinsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-1_ Marking Locations wiht PinsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.pbxproj new file mode 100644 index 0000000..75ba1fa --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B961317B6FD06000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B961217B6FD06000B5911 /* Foundation.framework */; }; + 888B961517B6FD06000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B961417B6FD06000B5911 /* CoreGraphics.framework */; }; + 888B961717B6FD06000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B961617B6FD06000B5911 /* UIKit.framework */; }; + 888B961D17B6FD06000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B961B17B6FD06000B5911 /* InfoPlist.strings */; }; + 888B961F17B6FD06000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B961E17B6FD06000B5911 /* main.m */; }; + 888B962317B6FD06000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B962217B6FD06000B5911 /* AppDelegate.m */; }; + 888B962617B6FD06000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B962417B6FD06000B5911 /* Main.storyboard */; }; + 888B962917B6FD07000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B962817B6FD07000B5911 /* ViewController.m */; }; + 888B962B17B6FD07000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B962A17B6FD07000B5911 /* Images.xcassets */; }; + 888B963217B6FD07000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B963117B6FD07000B5911 /* XCTest.framework */; }; + 888B963317B6FD07000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B961217B6FD06000B5911 /* Foundation.framework */; }; + 888B963417B6FD07000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B961617B6FD06000B5911 /* UIKit.framework */; }; + 888B963C17B6FD07000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B963A17B6FD07000B5911 /* InfoPlist.strings */; }; + 888B963E17B6FD07000B5911 /* Recipe_7_1__Marking_Locations_wiht_PinsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B963D17B6FD07000B5911 /* Recipe_7_1__Marking_Locations_wiht_PinsTests.m */; }; + 888B964817B6FE0A000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B964717B6FE0A000B5911 /* MapKit.framework */; }; + 888B964A17B6FE20000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B964917B6FE20000B5911 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B963517B6FD07000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B960717B6FD05000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B960E17B6FD06000B5911; + remoteInfo = "Recipe 7-1: Marking Locations wiht Pins"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B960F17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-2 Marking Locations wiht Pins.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B961217B6FD06000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B961417B6FD06000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B961617B6FD06000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B961A17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-2 Marking Locations wiht Pins-Info.plist"; sourceTree = ""; }; + 888B961C17B6FD06000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B961E17B6FD06000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B962017B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-2 Marking Locations wiht Pins-Prefix.pch"; sourceTree = ""; }; + 888B962117B6FD06000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B962217B6FD06000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B962517B6FD06000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B962717B6FD07000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B962817B6FD07000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B962A17B6FD07000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B963017B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-2 Marking Locations wiht PinsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B963117B6FD07000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B963917B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-2 Marking Locations wiht PinsTests-Info.plist"; sourceTree = ""; }; + 888B963B17B6FD07000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B963D17B6FD07000B5911 /* Recipe_7_1__Marking_Locations_wiht_PinsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_1__Marking_Locations_wiht_PinsTests.m; sourceTree = ""; }; + 888B964717B6FE0A000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B964917B6FE20000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B960C17B6FD06000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B964A17B6FE20000B5911 /* CoreLocation.framework in Frameworks */, + 888B964817B6FE0A000B5911 /* MapKit.framework in Frameworks */, + 888B961517B6FD06000B5911 /* CoreGraphics.framework in Frameworks */, + 888B961717B6FD06000B5911 /* UIKit.framework in Frameworks */, + 888B961317B6FD06000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B962D17B6FD07000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B963217B6FD07000B5911 /* XCTest.framework in Frameworks */, + 888B963417B6FD07000B5911 /* UIKit.framework in Frameworks */, + 888B963317B6FD07000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B960617B6FD05000B5911 = { + isa = PBXGroup; + children = ( + 888B961817B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins */, + 888B963717B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests */, + 888B961117B6FD06000B5911 /* Frameworks */, + 888B961017B6FD06000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B961017B6FD06000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B960F17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins.app */, + 888B963017B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B961117B6FD06000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B964917B6FE20000B5911 /* CoreLocation.framework */, + 888B964717B6FE0A000B5911 /* MapKit.framework */, + 888B961217B6FD06000B5911 /* Foundation.framework */, + 888B961417B6FD06000B5911 /* CoreGraphics.framework */, + 888B961617B6FD06000B5911 /* UIKit.framework */, + 888B963117B6FD07000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B961817B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins */ = { + isa = PBXGroup; + children = ( + 888B962117B6FD06000B5911 /* AppDelegate.h */, + 888B962217B6FD06000B5911 /* AppDelegate.m */, + 888B962417B6FD06000B5911 /* Main.storyboard */, + 888B962717B6FD07000B5911 /* ViewController.h */, + 888B962817B6FD07000B5911 /* ViewController.m */, + 888B962A17B6FD07000B5911 /* Images.xcassets */, + 888B961917B6FD06000B5911 /* Supporting Files */, + ); + name = "Recipe 7-2 Marking Locations wiht Pins"; + path = "Recipe 7-1: Marking Locations wiht Pins"; + sourceTree = ""; + }; + 888B961917B6FD06000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B961A17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins-Info.plist */, + 888B961B17B6FD06000B5911 /* InfoPlist.strings */, + 888B961E17B6FD06000B5911 /* main.m */, + 888B962017B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B963717B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests */ = { + isa = PBXGroup; + children = ( + 888B963D17B6FD07000B5911 /* Recipe_7_1__Marking_Locations_wiht_PinsTests.m */, + 888B963817B6FD07000B5911 /* Supporting Files */, + ); + name = "Recipe 7-2 Marking Locations wiht PinsTests"; + path = "Recipe 7-1: Marking Locations wiht PinsTests"; + sourceTree = ""; + }; + 888B963817B6FD07000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B963917B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests-Info.plist */, + 888B963A17B6FD07000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B960E17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B964117B6FD07000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-2 Marking Locations wiht Pins" */; + buildPhases = ( + 888B960B17B6FD06000B5911 /* Sources */, + 888B960C17B6FD06000B5911 /* Frameworks */, + 888B960D17B6FD06000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-2 Marking Locations wiht Pins"; + productName = "Recipe 7-1: Marking Locations wiht Pins"; + productReference = 888B960F17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins.app */; + productType = "com.apple.product-type.application"; + }; + 888B962F17B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B964417B6FD07000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-2 Marking Locations wiht PinsTests" */; + buildPhases = ( + 888B962C17B6FD07000B5911 /* Sources */, + 888B962D17B6FD07000B5911 /* Frameworks */, + 888B962E17B6FD07000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B963617B6FD07000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-2 Marking Locations wiht PinsTests"; + productName = "Recipe 7-1: Marking Locations wiht PinsTests"; + productReference = 888B963017B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B960717B6FD05000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B962F17B6FD07000B5911 = { + TestTargetID = 888B960E17B6FD06000B5911; + }; + }; + }; + buildConfigurationList = 888B960A17B6FD05000B5911 /* Build configuration list for PBXProject "Recipe 7-2 Marking Locations wiht Pins" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B960617B6FD05000B5911; + productRefGroup = 888B961017B6FD06000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B960E17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins */, + 888B962F17B6FD07000B5911 /* Recipe 7-2 Marking Locations wiht PinsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B960D17B6FD06000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B962B17B6FD07000B5911 /* Images.xcassets in Resources */, + 888B961D17B6FD06000B5911 /* InfoPlist.strings in Resources */, + 888B962617B6FD06000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B962E17B6FD07000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B963C17B6FD07000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B960B17B6FD06000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B962917B6FD07000B5911 /* ViewController.m in Sources */, + 888B962317B6FD06000B5911 /* AppDelegate.m in Sources */, + 888B961F17B6FD06000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B962C17B6FD07000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B963E17B6FD07000B5911 /* Recipe_7_1__Marking_Locations_wiht_PinsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B963617B6FD07000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B960E17B6FD06000B5911 /* Recipe 7-2 Marking Locations wiht Pins */; + targetProxy = 888B963517B6FD07000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B961B17B6FD06000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B961C17B6FD06000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B962417B6FD06000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B962517B6FD06000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B963A17B6FD07000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B963B17B6FD07000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B963F17B6FD07000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B964017B6FD07000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B964217B6FD07000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-1: Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Info.plist"; + PRODUCT_NAME = "Recipe 7-2 Marking Locations wiht Pins"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B964317B6FD07000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-1: Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins-Info.plist"; + PRODUCT_NAME = "Recipe 7-2 Marking Locations wiht Pins"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B964517B6FD07000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-1: Marking Locations wiht Pins.app/Recipe 7-1: Marking Locations wiht Pins"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Marking Locations wiht Pins/Recipe 7-1: Marking Locations wiht Pins-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-1: Marking Locations wiht PinsTests/Recipe 7-2 Marking Locations wiht PinsTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-2 Marking Locations wiht PinsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B964617B6FD07000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-1: Marking Locations wiht Pins.app/Recipe 7-1: Marking Locations wiht Pins"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-1: Marking Locations wiht Pins/Recipe 7-1: Marking Locations wiht Pins-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-1: Marking Locations wiht PinsTests/Recipe 7-2 Marking Locations wiht PinsTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-2 Marking Locations wiht PinsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B960A17B6FD05000B5911 /* Build configuration list for PBXProject "Recipe 7-2 Marking Locations wiht Pins" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B963F17B6FD07000B5911 /* Debug */, + 888B964017B6FD07000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B964117B6FD07000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-2 Marking Locations wiht Pins" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B964217B6FD07000B5911 /* Debug */, + 888B964317B6FD07000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B964417B6FD07000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-2 Marking Locations wiht PinsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B964517B6FD07000B5911 /* Debug */, + 888B964617B6FD07000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B960717B6FD05000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..fef6a70 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c6feec5 Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-1_ Marking Locations wiht Pins.xcscheme b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-1_ Marking Locations wiht Pins.xcscheme new file mode 100644 index 0000000..c253874 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-1_ Marking Locations wiht Pins.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..a28246a --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-1_ Marking Locations wiht Pins/Recipe 7-2 Marking Locations wiht Pins.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-1: Marking Locations wiht Pins.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B960E17B6FD06000B5911 + + primary + + + 888B962F17B6FD07000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8601047 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.pbxproj @@ -0,0 +1,512 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B965817B704C6000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B965717B704C6000B5911 /* Foundation.framework */; }; + 888B965A17B704C6000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B965917B704C6000B5911 /* CoreGraphics.framework */; }; + 888B965C17B704C6000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B965B17B704C6000B5911 /* UIKit.framework */; }; + 888B966217B704C6000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B966017B704C6000B5911 /* InfoPlist.strings */; }; + 888B966417B704C6000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B966317B704C6000B5911 /* main.m */; }; + 888B966817B704C6000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B966717B704C6000B5911 /* AppDelegate.m */; }; + 888B966B17B704C6000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B966917B704C6000B5911 /* Main.storyboard */; }; + 888B966E17B704C6000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B966D17B704C6000B5911 /* ViewController.m */; }; + 888B967017B704C6000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B966F17B704C6000B5911 /* Images.xcassets */; }; + 888B967717B704C6000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B967617B704C6000B5911 /* XCTest.framework */; }; + 888B967817B704C6000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B965717B704C6000B5911 /* Foundation.framework */; }; + 888B967917B704C6000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B965B17B704C6000B5911 /* UIKit.framework */; }; + 888B968117B704C6000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B967F17B704C6000B5911 /* InfoPlist.strings */; }; + 888B968317B704C6000B5911 /* Recipe_7_3_Creating_Custom_AnnotationsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B968217B704C6000B5911 /* Recipe_7_3_Creating_Custom_AnnotationsTests.m */; }; + 888B968D17B70532000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B968C17B70532000B5911 /* MapKit.framework */; }; + 888B968F17B70539000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B968E17B70539000B5911 /* CoreLocation.framework */; }; + 888B969117B70B0E000B5911 /* overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 888B969017B70B0C000B5911 /* overlay.png */; }; + 888B969417B70C01000B5911 /* MyAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B969317B70C01000B5911 /* MyAnnotation.m */; }; + 888B969717B70CA7000B5911 /* MyAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B969617B70CA7000B5911 /* MyAnnotationView.m */; }; + 888B969B17B71192000B5911 /* DetailedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B969917B71192000B5911 /* DetailedViewController.m */; }; + 888B969C17B71192000B5911 /* DetailedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 888B969A17B71192000B5911 /* DetailedViewController.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B967A17B704C6000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B964C17B704C6000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B965317B704C6000B5911; + remoteInfo = "Recipe 7-3:Creating Custom Annotations"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B965417B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-3 Creating Custom Annotations.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B965717B704C6000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B965917B704C6000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B965B17B704C6000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B965F17B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-3 Creating Custom Annotations-Info.plist"; sourceTree = ""; }; + 888B966117B704C6000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B966317B704C6000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B966517B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-3 Creating Custom Annotations-Prefix.pch"; sourceTree = ""; }; + 888B966617B704C6000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B966717B704C6000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B966A17B704C6000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B966C17B704C6000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B966D17B704C6000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B966F17B704C6000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B967517B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-3 Creating Custom AnnotationsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B967617B704C6000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B967E17B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-3 Creating Custom AnnotationsTests-Info.plist"; sourceTree = ""; }; + 888B968017B704C6000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B968217B704C6000B5911 /* Recipe_7_3_Creating_Custom_AnnotationsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_3_Creating_Custom_AnnotationsTests.m; sourceTree = ""; }; + 888B968C17B70532000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B968E17B70539000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; + 888B969017B70B0C000B5911 /* overlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = overlay.png; sourceTree = ""; }; + 888B969217B70C01000B5911 /* MyAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyAnnotation.h; sourceTree = ""; }; + 888B969317B70C01000B5911 /* MyAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyAnnotation.m; sourceTree = ""; }; + 888B969517B70CA7000B5911 /* MyAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyAnnotationView.h; sourceTree = ""; }; + 888B969617B70CA7000B5911 /* MyAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyAnnotationView.m; sourceTree = ""; }; + 888B969817B71192000B5911 /* DetailedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailedViewController.h; sourceTree = ""; }; + 888B969917B71192000B5911 /* DetailedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailedViewController.m; sourceTree = ""; }; + 888B969A17B71192000B5911 /* DetailedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailedViewController.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B965117B704C6000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B968F17B70539000B5911 /* CoreLocation.framework in Frameworks */, + 888B968D17B70532000B5911 /* MapKit.framework in Frameworks */, + 888B965A17B704C6000B5911 /* CoreGraphics.framework in Frameworks */, + 888B965C17B704C6000B5911 /* UIKit.framework in Frameworks */, + 888B965817B704C6000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B967217B704C6000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B967717B704C6000B5911 /* XCTest.framework in Frameworks */, + 888B967917B704C6000B5911 /* UIKit.framework in Frameworks */, + 888B967817B704C6000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B964B17B704C6000B5911 = { + isa = PBXGroup; + children = ( + 888B965D17B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations */, + 888B967C17B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests */, + 888B965617B704C6000B5911 /* Frameworks */, + 888B965517B704C6000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B965517B704C6000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B965417B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations.app */, + 888B967517B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B965617B704C6000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B968E17B70539000B5911 /* CoreLocation.framework */, + 888B968C17B70532000B5911 /* MapKit.framework */, + 888B965717B704C6000B5911 /* Foundation.framework */, + 888B965917B704C6000B5911 /* CoreGraphics.framework */, + 888B965B17B704C6000B5911 /* UIKit.framework */, + 888B967617B704C6000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B965D17B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations */ = { + isa = PBXGroup; + children = ( + 888B969217B70C01000B5911 /* MyAnnotation.h */, + 888B969317B70C01000B5911 /* MyAnnotation.m */, + 888B969517B70CA7000B5911 /* MyAnnotationView.h */, + 888B969617B70CA7000B5911 /* MyAnnotationView.m */, + 888B966617B704C6000B5911 /* AppDelegate.h */, + 888B966717B704C6000B5911 /* AppDelegate.m */, + 888B966917B704C6000B5911 /* Main.storyboard */, + 888B969817B71192000B5911 /* DetailedViewController.h */, + 888B969917B71192000B5911 /* DetailedViewController.m */, + 888B969A17B71192000B5911 /* DetailedViewController.xib */, + 888B966C17B704C6000B5911 /* ViewController.h */, + 888B966D17B704C6000B5911 /* ViewController.m */, + 888B966F17B704C6000B5911 /* Images.xcassets */, + 888B965E17B704C6000B5911 /* Supporting Files */, + ); + name = "Recipe 7-3 Creating Custom Annotations"; + path = "Recipe 7-3:Creating Custom Annotations"; + sourceTree = ""; + }; + 888B965E17B704C6000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B969017B70B0C000B5911 /* overlay.png */, + 888B965F17B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations-Info.plist */, + 888B966017B704C6000B5911 /* InfoPlist.strings */, + 888B966317B704C6000B5911 /* main.m */, + 888B966517B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B967C17B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests */ = { + isa = PBXGroup; + children = ( + 888B968217B704C6000B5911 /* Recipe_7_3_Creating_Custom_AnnotationsTests.m */, + 888B967D17B704C6000B5911 /* Supporting Files */, + ); + name = "Recipe 7-3 Creating Custom AnnotationsTests"; + path = "Recipe 7-3:Creating Custom AnnotationsTests"; + sourceTree = ""; + }; + 888B967D17B704C6000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B967E17B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests-Info.plist */, + 888B967F17B704C6000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B965317B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B968617B704C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-3 Creating Custom Annotations" */; + buildPhases = ( + 888B965017B704C6000B5911 /* Sources */, + 888B965117B704C6000B5911 /* Frameworks */, + 888B965217B704C6000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-3 Creating Custom Annotations"; + productName = "Recipe 7-3:Creating Custom Annotations"; + productReference = 888B965417B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations.app */; + productType = "com.apple.product-type.application"; + }; + 888B967417B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B968917B704C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-3 Creating Custom AnnotationsTests" */; + buildPhases = ( + 888B967117B704C6000B5911 /* Sources */, + 888B967217B704C6000B5911 /* Frameworks */, + 888B967317B704C6000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B967B17B704C6000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-3 Creating Custom AnnotationsTests"; + productName = "Recipe 7-3:Creating Custom AnnotationsTests"; + productReference = 888B967517B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B964C17B704C6000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B965317B704C6000B5911 = { + DevelopmentTeam = H7ALWBN8YV; + }; + 888B967417B704C6000B5911 = { + TestTargetID = 888B965317B704C6000B5911; + }; + }; + }; + buildConfigurationList = 888B964F17B704C6000B5911 /* Build configuration list for PBXProject "Recipe 7-3 Creating Custom Annotations" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B964B17B704C6000B5911; + productRefGroup = 888B965517B704C6000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B965317B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations */, + 888B967417B704C6000B5911 /* Recipe 7-3 Creating Custom AnnotationsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B965217B704C6000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B969117B70B0E000B5911 /* overlay.png in Resources */, + 888B967017B704C6000B5911 /* Images.xcassets in Resources */, + 888B969C17B71192000B5911 /* DetailedViewController.xib in Resources */, + 888B966217B704C6000B5911 /* InfoPlist.strings in Resources */, + 888B966B17B704C6000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B967317B704C6000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B968117B704C6000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B965017B704C6000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B966E17B704C6000B5911 /* ViewController.m in Sources */, + 888B969717B70CA7000B5911 /* MyAnnotationView.m in Sources */, + 888B966817B704C6000B5911 /* AppDelegate.m in Sources */, + 888B969417B70C01000B5911 /* MyAnnotation.m in Sources */, + 888B969B17B71192000B5911 /* DetailedViewController.m in Sources */, + 888B966417B704C6000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B967117B704C6000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B968317B704C6000B5911 /* Recipe_7_3_Creating_Custom_AnnotationsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B967B17B704C6000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B965317B704C6000B5911 /* Recipe 7-3 Creating Custom Annotations */; + targetProxy = 888B967A17B704C6000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B966017B704C6000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B966117B704C6000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B966917B704C6000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B966A17B704C6000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B967F17B704C6000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B968017B704C6000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B968417B704C6000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B968517B704C6000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B968717B704C6000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-3:Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-3:Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Info.plist"; + PRODUCT_NAME = "Recipe 7-3 Creating Custom Annotations"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B968817B704C6000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-3:Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-3:Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Info.plist"; + PRODUCT_NAME = "Recipe 7-3 Creating Custom Annotations"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B968A17B704C6000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-3:Creating Custom Annotations.app/Recipe 7-3:Creating Custom Annotations"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-3:Creating Custom Annotations/Recipe 7-3:Creating Custom Annotations-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-3:Creating Custom AnnotationsTests/Recipe 7-3 Creating Custom AnnotationsTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-3 Creating Custom AnnotationsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B968B17B704C6000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-3:Creating Custom Annotations.app/Recipe 7-3:Creating Custom Annotations"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-3:Creating Custom Annotations/Recipe 7-3:Creating Custom Annotations-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-3:Creating Custom AnnotationsTests/Recipe 7-3 Creating Custom AnnotationsTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-3 Creating Custom AnnotationsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B964F17B704C6000B5911 /* Build configuration list for PBXProject "Recipe 7-3 Creating Custom Annotations" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B968417B704C6000B5911 /* Debug */, + 888B968517B704C6000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B968617B704C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-3 Creating Custom Annotations" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B968717B704C6000B5911 /* Debug */, + 888B968817B704C6000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B968917B704C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-3 Creating Custom AnnotationsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B968A17B704C6000B5911 /* Debug */, + 888B968B17B704C6000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B964C17B704C6000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..eb5c895 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..eb3c1c0 Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..3919902 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-3_Creating Custom Annotations.xcscheme b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-3_Creating Custom Annotations.xcscheme new file mode 100644 index 0000000..3f70708 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-3_Creating Custom Annotations.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..dfe86e7 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-3:Creating Custom Annotations.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B965317B704C6000B5911 + + primary + + + 888B967417B704C6000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/AppDelegate.h new file mode 100644 index 0000000..47b150a --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/AppDelegate.m new file mode 100644 index 0000000..a4481fa --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Base.lproj/Main.storyboard new file mode 100644 index 0000000..611c1c0 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.h b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.h new file mode 100644 index 0000000..ddc0b0e --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.h @@ -0,0 +1,21 @@ +// +// DetailedViewController.h +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import "MyAnnotation.h" + +@interface DetailedViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; +@property (weak, nonatomic) IBOutlet UILabel *subtitleLabel; +@property (weak, nonatomic) IBOutlet UILabel *contactInformationLabel; + +@property (strong, nonatomic) MyAnnotation *annotation; + +-(id)initWithAnnotation:(MyAnnotation *)annotation; +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.m b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.m new file mode 100644 index 0000000..b6660a6 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.m @@ -0,0 +1,41 @@ +// +// DetailedViewController.m +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "DetailedViewController.h" + +@interface DetailedViewController () + +@end + +@implementation DetailedViewController + +- (id)initWithAnnotation:(MyAnnotation *)annotation +{ + self = [super init]; + if (self) { + self.annotation = annotation; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + self.titleLabel.text = self.annotation.title; + self.subtitleLabel.text = self.annotation.subtitle; + self.contactInformationLabel.text = self.annotation.contactInformation; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.xib b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.xib new file mode 100644 index 0000000..397ec09 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/DetailedViewController.xib @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotation.h b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotation.h new file mode 100644 index 0000000..2420b10 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotation.h @@ -0,0 +1,17 @@ +// +// MyAnnotation.h +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface MyAnnotation : MKPointAnnotation + +@property (nonatomic, strong) NSString *contactInformation; + +-(id)initWithCoordinate:(CLLocationCoordinate2D)coord title:(NSString *)title subtitle:(NSString *)subtitle contactInformation:(NSString *)contactInfo; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotation.m b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotation.m new file mode 100644 index 0000000..643525a --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotation.m @@ -0,0 +1,28 @@ +// +// MyAnnotation.m +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MyAnnotation.h" + +@implementation MyAnnotation + +-(id)initWithCoordinate:(CLLocationCoordinate2D)coord title:(NSString *)title subtitle:(NSString *)subtitle contactInformation:(NSString *)contactInfo +{ + self = [super init]; + if (self) + { + self.coordinate = coord; + self.title = title; + self.subtitle = subtitle; + self.contactInformation = contactInfo; + } + + return self; +} + + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotationView.h b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotationView.h new file mode 100644 index 0000000..7314747 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotationView.h @@ -0,0 +1,13 @@ +// +// MyViewAnnotation.h +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface MyAnnotationView : MKAnnotationView + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotationView.m b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotationView.m new file mode 100644 index 0000000..b247fa1 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/MyAnnotationView.m @@ -0,0 +1,43 @@ +// +// MyViewAnnotation.m +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MyAnnotationView.h" + +@implementation MyAnnotationView + +- (id)initWithAnnotation:(id )annotation + reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]; + if (self) + { + UIImage *myImage = [UIImage imageNamed:@"overlay.png"]; + self.image = myImage; + self.frame = CGRectMake(0, 0, 40, 40); + // Use contentMode to ensure best scaling of image + self.contentMode = UIViewContentModeScaleAspectFill; + // Use centerOffset to adjust the position of the image + self.centerOffset = CGPointMake(0, -20); + + self.canShowCallout = YES; + + // Left callout accessory view + UIImageView *leftAccessoryView = [[UIImageView alloc] initWithImage:myImage]; + leftAccessoryView.frame = CGRectMake(0, 0, 20, 20); + leftAccessoryView.contentMode = UIViewContentModeScaleAspectFill; + self.leftCalloutAccessoryView = leftAccessoryView; + + // Right callout accessory view + self.rightCalloutAccessoryView = + [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; + + } + return self; +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Info.plist b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Prefix.pch b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/Recipe 7-3 Creating Custom Annotations-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/ViewController.h b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/ViewController.h new file mode 100644 index 0000000..9ec1f27 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/ViewController.h @@ -0,0 +1,16 @@ +// +// ViewController.h +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/ViewController.m b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/ViewController.m new file mode 100644 index 0000000..5927e70 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/ViewController.m @@ -0,0 +1,85 @@ +// +// ViewController.m +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" +#import "MyAnnotation.h" +#import "MyAnnotationView.h" +#import "DetailedViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mapView.delegate = self; + MyAnnotation *ann1 = [[MyAnnotation alloc] + initWithCoordinate: CLLocationCoordinate2DMake(37.68, -97.33) + title: @"Company 1" + subtitle: @"Something Catchy" + contactInformation: @"Call 555-123456"]; + + MyAnnotation *ann2 = [[MyAnnotation alloc] + initWithCoordinate:CLLocationCoordinate2DMake(41.500, -81.695) + title:@"Company 2" + subtitle:@"Even More Catchy" + contactInformation:@"Call 555-654321"]; + + NSArray *annotations = [NSArray arrayWithObjects: ann1, ann2, nil]; + [self.mapView addAnnotations:annotations]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation +{ + // Don't create annotation views for the user location annotation + if ([annotation isKindOfClass:[MyAnnotation class]]) + { + static NSString *myAnnotationId = @"myAnnotation"; + + // Create an annotation view, but reuse a cached one if available + MyAnnotationView *annotationView = + (MyAnnotationView *)[self.mapView + dequeueReusableAnnotationViewWithIdentifier:myAnnotationId]; + if(annotationView) + { + // Cached view found, associate it with the annotation + annotationView.annotation = annotation; + } + else + { + // No cached view were available, create a new one + annotationView = [[MyAnnotationView alloc] initWithAnnotation:annotation + reuseIdentifier:myAnnotationId]; + } + + return annotationView; + } + + // Use a default annotation view for the user location annotation + return nil; +} +-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control +{ + DetailedViewController *dvc = [[DetailedViewController alloc] + initWithAnnotation:view.annotation]; + dvc.modalTransitionStyle = UIModalTransitionStylePartialCurl; + [self presentViewController:dvc animated:YES completion:^{}]; +} + + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/main.m b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/main.m new file mode 100644 index 0000000..ae1ed45 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-3:Creating Custom Annotations +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/overlay.png b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/overlay.png new file mode 100644 index 0000000..9354408 Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom Annotations/overlay.png differ diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/Recipe 7-3 Creating Custom AnnotationsTests-Info.plist b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/Recipe 7-3 Creating Custom AnnotationsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/Recipe 7-3 Creating Custom AnnotationsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/Recipe_7_3_Creating_Custom_AnnotationsTests.m b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/Recipe_7_3_Creating_Custom_AnnotationsTests.m new file mode 100644 index 0000000..8820de3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/Recipe_7_3_Creating_Custom_AnnotationsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_3_Creating_Custom_AnnotationsTests.m +// Recipe 7-3:Creating Custom AnnotationsTests +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_3_Creating_Custom_AnnotationsTests : XCTestCase + +@end + +@implementation Recipe_7_3_Creating_Custom_AnnotationsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-3_Creating Custom Annotations/Recipe 7-3_Creating Custom AnnotationsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.pbxproj new file mode 100644 index 0000000..79900a4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B96AA17B714FE000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96A917B714FE000B5911 /* Foundation.framework */; }; + 888B96AC17B714FE000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96AB17B714FE000B5911 /* CoreGraphics.framework */; }; + 888B96AE17B714FE000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96AD17B714FE000B5911 /* UIKit.framework */; }; + 888B96B417B714FE000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B96B217B714FE000B5911 /* InfoPlist.strings */; }; + 888B96B617B714FE000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B96B517B714FE000B5911 /* main.m */; }; + 888B96BA17B714FE000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B96B917B714FE000B5911 /* AppDelegate.m */; }; + 888B96BD17B714FE000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B96BB17B714FE000B5911 /* Main.storyboard */; }; + 888B96C017B714FE000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B96BF17B714FE000B5911 /* ViewController.m */; }; + 888B96C217B714FE000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B96C117B714FE000B5911 /* Images.xcassets */; }; + 888B96C917B714FE000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96C817B714FE000B5911 /* XCTest.framework */; }; + 888B96CA17B714FE000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96A917B714FE000B5911 /* Foundation.framework */; }; + 888B96CB17B714FE000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96AD17B714FE000B5911 /* UIKit.framework */; }; + 888B96D317B714FE000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B96D117B714FE000B5911 /* InfoPlist.strings */; }; + 888B96D517B714FE000B5911 /* Recipe_7_4__Dragging_a_PinTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B96D417B714FE000B5911 /* Recipe_7_4__Dragging_a_PinTests.m */; }; + 888B96DF17B71518000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96DE17B71518000B5911 /* MapKit.framework */; }; + 888B96E117B71522000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96E017B71522000B5911 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B96CC17B714FE000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B969E17B714FE000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B96A517B714FE000B5911; + remoteInfo = "Recipe 7-4: Dragging a Pin"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B96A617B714FE000B5911 /* Recipe 7-4 Dragging a Pin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-4 Dragging a Pin.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B96A917B714FE000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B96AB17B714FE000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B96AD17B714FE000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B96B117B714FE000B5911 /* Recipe 7-4 Dragging a Pin-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-4 Dragging a Pin-Info.plist"; sourceTree = ""; }; + 888B96B317B714FE000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B96B517B714FE000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B96B717B714FE000B5911 /* Recipe 7-4 Dragging a Pin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-4 Dragging a Pin-Prefix.pch"; sourceTree = ""; }; + 888B96B817B714FE000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B96B917B714FE000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B96BC17B714FE000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B96BE17B714FE000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B96BF17B714FE000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B96C117B714FE000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B96C717B714FE000B5911 /* Recipe 7-4 Dragging a PinTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-4 Dragging a PinTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B96C817B714FE000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B96D017B714FE000B5911 /* Recipe 7-4 Dragging a PinTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-4 Dragging a PinTests-Info.plist"; sourceTree = ""; }; + 888B96D217B714FE000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B96D417B714FE000B5911 /* Recipe_7_4__Dragging_a_PinTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_4__Dragging_a_PinTests.m; sourceTree = ""; }; + 888B96DE17B71518000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B96E017B71522000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B96A317B714FE000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B96E117B71522000B5911 /* CoreLocation.framework in Frameworks */, + 888B96DF17B71518000B5911 /* MapKit.framework in Frameworks */, + 888B96AC17B714FE000B5911 /* CoreGraphics.framework in Frameworks */, + 888B96AE17B714FE000B5911 /* UIKit.framework in Frameworks */, + 888B96AA17B714FE000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B96C417B714FE000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B96C917B714FE000B5911 /* XCTest.framework in Frameworks */, + 888B96CB17B714FE000B5911 /* UIKit.framework in Frameworks */, + 888B96CA17B714FE000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B969D17B714FE000B5911 = { + isa = PBXGroup; + children = ( + 888B96AF17B714FE000B5911 /* Recipe 7-4 Dragging a Pin */, + 888B96CE17B714FE000B5911 /* Recipe 7-4 Dragging a PinTests */, + 888B96A817B714FE000B5911 /* Frameworks */, + 888B96A717B714FE000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B96A717B714FE000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B96A617B714FE000B5911 /* Recipe 7-4 Dragging a Pin.app */, + 888B96C717B714FE000B5911 /* Recipe 7-4 Dragging a PinTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B96A817B714FE000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B96E017B71522000B5911 /* CoreLocation.framework */, + 888B96DE17B71518000B5911 /* MapKit.framework */, + 888B96A917B714FE000B5911 /* Foundation.framework */, + 888B96AB17B714FE000B5911 /* CoreGraphics.framework */, + 888B96AD17B714FE000B5911 /* UIKit.framework */, + 888B96C817B714FE000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B96AF17B714FE000B5911 /* Recipe 7-4 Dragging a Pin */ = { + isa = PBXGroup; + children = ( + 888B96B817B714FE000B5911 /* AppDelegate.h */, + 888B96B917B714FE000B5911 /* AppDelegate.m */, + 888B96BB17B714FE000B5911 /* Main.storyboard */, + 888B96BE17B714FE000B5911 /* ViewController.h */, + 888B96BF17B714FE000B5911 /* ViewController.m */, + 888B96C117B714FE000B5911 /* Images.xcassets */, + 888B96B017B714FE000B5911 /* Supporting Files */, + ); + name = "Recipe 7-4 Dragging a Pin"; + path = "Recipe 7-4: Dragging a Pin"; + sourceTree = ""; + }; + 888B96B017B714FE000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B96B117B714FE000B5911 /* Recipe 7-4 Dragging a Pin-Info.plist */, + 888B96B217B714FE000B5911 /* InfoPlist.strings */, + 888B96B517B714FE000B5911 /* main.m */, + 888B96B717B714FE000B5911 /* Recipe 7-4 Dragging a Pin-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B96CE17B714FE000B5911 /* Recipe 7-4 Dragging a PinTests */ = { + isa = PBXGroup; + children = ( + 888B96D417B714FE000B5911 /* Recipe_7_4__Dragging_a_PinTests.m */, + 888B96CF17B714FE000B5911 /* Supporting Files */, + ); + name = "Recipe 7-4 Dragging a PinTests"; + path = "Recipe 7-4: Dragging a PinTests"; + sourceTree = ""; + }; + 888B96CF17B714FE000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B96D017B714FE000B5911 /* Recipe 7-4 Dragging a PinTests-Info.plist */, + 888B96D117B714FE000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B96A517B714FE000B5911 /* Recipe 7-4 Dragging a Pin */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B96D817B714FE000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-4 Dragging a Pin" */; + buildPhases = ( + 888B96A217B714FE000B5911 /* Sources */, + 888B96A317B714FE000B5911 /* Frameworks */, + 888B96A417B714FE000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-4 Dragging a Pin"; + productName = "Recipe 7-4: Dragging a Pin"; + productReference = 888B96A617B714FE000B5911 /* Recipe 7-4 Dragging a Pin.app */; + productType = "com.apple.product-type.application"; + }; + 888B96C617B714FE000B5911 /* Recipe 7-4 Dragging a PinTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B96DB17B714FE000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-4 Dragging a PinTests" */; + buildPhases = ( + 888B96C317B714FE000B5911 /* Sources */, + 888B96C417B714FE000B5911 /* Frameworks */, + 888B96C517B714FE000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B96CD17B714FE000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-4 Dragging a PinTests"; + productName = "Recipe 7-4: Dragging a PinTests"; + productReference = 888B96C717B714FE000B5911 /* Recipe 7-4 Dragging a PinTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B969E17B714FE000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B96C617B714FE000B5911 = { + TestTargetID = 888B96A517B714FE000B5911; + }; + }; + }; + buildConfigurationList = 888B96A117B714FE000B5911 /* Build configuration list for PBXProject "Recipe 7-4 Dragging a Pin" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B969D17B714FE000B5911; + productRefGroup = 888B96A717B714FE000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B96A517B714FE000B5911 /* Recipe 7-4 Dragging a Pin */, + 888B96C617B714FE000B5911 /* Recipe 7-4 Dragging a PinTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B96A417B714FE000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B96C217B714FE000B5911 /* Images.xcassets in Resources */, + 888B96B417B714FE000B5911 /* InfoPlist.strings in Resources */, + 888B96BD17B714FE000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B96C517B714FE000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B96D317B714FE000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B96A217B714FE000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B96C017B714FE000B5911 /* ViewController.m in Sources */, + 888B96BA17B714FE000B5911 /* AppDelegate.m in Sources */, + 888B96B617B714FE000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B96C317B714FE000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B96D517B714FE000B5911 /* Recipe_7_4__Dragging_a_PinTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B96CD17B714FE000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B96A517B714FE000B5911 /* Recipe 7-4 Dragging a Pin */; + targetProxy = 888B96CC17B714FE000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B96B217B714FE000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B96B317B714FE000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B96BB17B714FE000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B96BC17B714FE000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B96D117B714FE000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B96D217B714FE000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B96D617B714FE000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B96D717B714FE000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B96D917B714FE000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-4: Dragging a Pin/Recipe 7-4 Dragging a Pin-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-4: Dragging a Pin/Recipe 7-4 Dragging a Pin-Info.plist"; + PRODUCT_NAME = "Recipe 7-4 Dragging a Pin"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B96DA17B714FE000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-4: Dragging a Pin/Recipe 7-4 Dragging a Pin-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-4: Dragging a Pin/Recipe 7-4 Dragging a Pin-Info.plist"; + PRODUCT_NAME = "Recipe 7-4 Dragging a Pin"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B96DC17B714FE000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-4: Dragging a Pin.app/Recipe 7-4: Dragging a Pin"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-4: Dragging a Pin/Recipe 7-4: Dragging a Pin-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-4: Dragging a PinTests/Recipe 7-4 Dragging a PinTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-4 Dragging a PinTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B96DD17B714FE000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-4: Dragging a Pin.app/Recipe 7-4: Dragging a Pin"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-4: Dragging a Pin/Recipe 7-4: Dragging a Pin-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-4: Dragging a PinTests/Recipe 7-4 Dragging a PinTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-4 Dragging a PinTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B96A117B714FE000B5911 /* Build configuration list for PBXProject "Recipe 7-4 Dragging a Pin" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B96D617B714FE000B5911 /* Debug */, + 888B96D717B714FE000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B96D817B714FE000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-4 Dragging a Pin" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B96D917B714FE000B5911 /* Debug */, + 888B96DA17B714FE000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B96DB17B714FE000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-4 Dragging a PinTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B96DC17B714FE000B5911 /* Debug */, + 888B96DD17B714FE000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B969E17B714FE000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b6f3ad2 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..38d0cb9 Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-4_ Dragging a Pin.xcscheme b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-4_ Dragging a Pin.xcscheme new file mode 100644 index 0000000..331f049 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-4_ Dragging a Pin.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..99411e2 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-4: Dragging a Pin.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B96A517B714FE000B5911 + + primary + + + 888B96C617B714FE000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/AppDelegate.h new file mode 100644 index 0000000..42631c7 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-4: Dragging a Pin +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/AppDelegate.m new file mode 100644 index 0000000..46d51f5 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-4: Dragging a Pin +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Base.lproj/Main.storyboard new file mode 100644 index 0000000..53a2475 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin-Info.plist b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin-Prefix.pch b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/Recipe 7-4 Dragging a Pin-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/ViewController.h b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/ViewController.h new file mode 100644 index 0000000..1783756 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/ViewController.h @@ -0,0 +1,16 @@ +// +// ViewController.h +// Recipe 7-4: Dragging a Pin +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/ViewController.m b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/ViewController.m new file mode 100644 index 0000000..a84e376 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/ViewController.m @@ -0,0 +1,77 @@ +// +// ViewController.m +// Recipe 7-4: Dragging a Pin +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mapView.delegate = self; + + MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init]; + annotation.coordinate = CLLocationCoordinate2DMake(39.739, -104.984); + [self.mapView addAnnotation:annotation]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation +{ + // Don't create annotation views for the user location annotation + if ([annotation isKindOfClass:[MKPointAnnotation class]]) + { + static NSString *draggableAnnotationId = @"draggableAnnotation"; + + // Create an annotation view, but reuse a cached one if available + MKPinAnnotationView *annotationView = + (MKPinAnnotationView *)[self.mapView + dequeueReusableAnnotationViewWithIdentifier:draggableAnnotationId]; + if(annotationView) + { + // Cached view found, associate it with the annotation + annotationView.annotation = annotation; + } + else + { + // No cached view were available, create a new one + annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation + reuseIdentifier:draggableAnnotationId]; + annotationView.pinColor = MKPinAnnotationColorPurple; + annotationView.draggable = YES; + } + + return annotationView; + } + + // Use a default annotation view for the user location annotation + return nil; +} + +-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState +{ + if (newState == MKAnnotationViewDragStateEnding) + { + MKPointAnnotation *annotation = view.annotation; + NSLog(@"\nPin Location: %f, %f (Lat, Long)", + annotation.coordinate.latitude, view.annotation.coordinate.longitude); + } + +} + + +@end diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/main.m b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/main.m new file mode 100644 index 0000000..c81913d --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a Pin/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-4: Dragging a Pin +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/Recipe 7-4 Dragging a PinTests-Info.plist b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/Recipe 7-4 Dragging a PinTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/Recipe 7-4 Dragging a PinTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/Recipe_7_4__Dragging_a_PinTests.m b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/Recipe_7_4__Dragging_a_PinTests.m new file mode 100644 index 0000000..6c29e77 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/Recipe_7_4__Dragging_a_PinTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_4__Dragging_a_PinTests.m +// Recipe 7-4: Dragging a PinTests +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_4__Dragging_a_PinTests : XCTestCase + +@end + +@implementation Recipe_7_4__Dragging_a_PinTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-4_ Dragging a Pin/Recipe 7-4_ Dragging a PinTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6d1637b --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B96EF17B71AC4000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96EE17B71AC4000B5911 /* Foundation.framework */; }; + 888B96F117B71AC4000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96F017B71AC4000B5911 /* CoreGraphics.framework */; }; + 888B96F317B71AC4000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96F217B71AC4000B5911 /* UIKit.framework */; }; + 888B96F917B71AC4000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B96F717B71AC4000B5911 /* InfoPlist.strings */; }; + 888B96FB17B71AC4000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B96FA17B71AC4000B5911 /* main.m */; }; + 888B96FF17B71AC4000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B96FE17B71AC4000B5911 /* AppDelegate.m */; }; + 888B970217B71AC4000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B970017B71AC4000B5911 /* Main.storyboard */; }; + 888B970517B71AC4000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B970417B71AC4000B5911 /* ViewController.m */; }; + 888B970717B71AC4000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B970617B71AC4000B5911 /* Images.xcassets */; }; + 888B970E17B71AC4000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B970D17B71AC4000B5911 /* XCTest.framework */; }; + 888B970F17B71AC4000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96EE17B71AC4000B5911 /* Foundation.framework */; }; + 888B971017B71AC4000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B96F217B71AC4000B5911 /* UIKit.framework */; }; + 888B971817B71AC4000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B971617B71AC4000B5911 /* InfoPlist.strings */; }; + 888B971A17B71AC4000B5911 /* Recipe_7_5__Adding_Overlays_to_a_MapTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B971917B71AC4000B5911 /* Recipe_7_5__Adding_Overlays_to_a_MapTests.m */; }; + 888B972417B71AD9000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B972317B71AD9000B5911 /* MapKit.framework */; }; + 888B972617B71AE2000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B972517B71AE2000B5911 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B971117B71AC4000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B96E317B71AC4000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B96EA17B71AC4000B5911; + remoteInfo = "Recipe 7-5: Adding Overlays to a Map"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B96EB17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-5 Adding Overlays to a Map.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B96EE17B71AC4000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B96F017B71AC4000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B96F217B71AC4000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B96F617B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-5 Adding Overlays to a Map-Info.plist"; sourceTree = ""; }; + 888B96F817B71AC4000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B96FA17B71AC4000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B96FC17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-5 Adding Overlays to a Map-Prefix.pch"; sourceTree = ""; }; + 888B96FD17B71AC4000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B96FE17B71AC4000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B970117B71AC4000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B970317B71AC4000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B970417B71AC4000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B970617B71AC4000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B970C17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-5 Adding Overlays to a MapTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B970D17B71AC4000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B971517B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-5 Adding Overlays to a MapTests-Info.plist"; sourceTree = ""; }; + 888B971717B71AC4000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B971917B71AC4000B5911 /* Recipe_7_5__Adding_Overlays_to_a_MapTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_5__Adding_Overlays_to_a_MapTests.m; sourceTree = ""; }; + 888B972317B71AD9000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B972517B71AE2000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B96E817B71AC4000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B972617B71AE2000B5911 /* CoreLocation.framework in Frameworks */, + 888B972417B71AD9000B5911 /* MapKit.framework in Frameworks */, + 888B96F117B71AC4000B5911 /* CoreGraphics.framework in Frameworks */, + 888B96F317B71AC4000B5911 /* UIKit.framework in Frameworks */, + 888B96EF17B71AC4000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B970917B71AC4000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B970E17B71AC4000B5911 /* XCTest.framework in Frameworks */, + 888B971017B71AC4000B5911 /* UIKit.framework in Frameworks */, + 888B970F17B71AC4000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B96E217B71AC4000B5911 = { + isa = PBXGroup; + children = ( + 888B96F417B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map */, + 888B971317B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests */, + 888B96ED17B71AC4000B5911 /* Frameworks */, + 888B96EC17B71AC4000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B96EC17B71AC4000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B96EB17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map.app */, + 888B970C17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B96ED17B71AC4000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B972517B71AE2000B5911 /* CoreLocation.framework */, + 888B972317B71AD9000B5911 /* MapKit.framework */, + 888B96EE17B71AC4000B5911 /* Foundation.framework */, + 888B96F017B71AC4000B5911 /* CoreGraphics.framework */, + 888B96F217B71AC4000B5911 /* UIKit.framework */, + 888B970D17B71AC4000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B96F417B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map */ = { + isa = PBXGroup; + children = ( + 888B96FD17B71AC4000B5911 /* AppDelegate.h */, + 888B96FE17B71AC4000B5911 /* AppDelegate.m */, + 888B970017B71AC4000B5911 /* Main.storyboard */, + 888B970317B71AC4000B5911 /* ViewController.h */, + 888B970417B71AC4000B5911 /* ViewController.m */, + 888B970617B71AC4000B5911 /* Images.xcassets */, + 888B96F517B71AC4000B5911 /* Supporting Files */, + ); + name = "Recipe 7-5 Adding Overlays to a Map"; + path = "Recipe 7-5: Adding Overlays to a Map"; + sourceTree = ""; + }; + 888B96F517B71AC4000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B96F617B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map-Info.plist */, + 888B96F717B71AC4000B5911 /* InfoPlist.strings */, + 888B96FA17B71AC4000B5911 /* main.m */, + 888B96FC17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B971317B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests */ = { + isa = PBXGroup; + children = ( + 888B971917B71AC4000B5911 /* Recipe_7_5__Adding_Overlays_to_a_MapTests.m */, + 888B971417B71AC4000B5911 /* Supporting Files */, + ); + name = "Recipe 7-5 Adding Overlays to a MapTests"; + path = "Recipe 7-5: Adding Overlays to a MapTests"; + sourceTree = ""; + }; + 888B971417B71AC4000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B971517B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests-Info.plist */, + 888B971617B71AC4000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B96EA17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B971D17B71AC4000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-5 Adding Overlays to a Map" */; + buildPhases = ( + 888B96E717B71AC4000B5911 /* Sources */, + 888B96E817B71AC4000B5911 /* Frameworks */, + 888B96E917B71AC4000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-5 Adding Overlays to a Map"; + productName = "Recipe 7-5: Adding Overlays to a Map"; + productReference = 888B96EB17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map.app */; + productType = "com.apple.product-type.application"; + }; + 888B970B17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B972017B71AC4000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-5 Adding Overlays to a MapTests" */; + buildPhases = ( + 888B970817B71AC4000B5911 /* Sources */, + 888B970917B71AC4000B5911 /* Frameworks */, + 888B970A17B71AC4000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B971217B71AC4000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-5 Adding Overlays to a MapTests"; + productName = "Recipe 7-5: Adding Overlays to a MapTests"; + productReference = 888B970C17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B96E317B71AC4000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B970B17B71AC4000B5911 = { + TestTargetID = 888B96EA17B71AC4000B5911; + }; + }; + }; + buildConfigurationList = 888B96E617B71AC4000B5911 /* Build configuration list for PBXProject "Recipe 7-5 Adding Overlays to a Map" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B96E217B71AC4000B5911; + productRefGroup = 888B96EC17B71AC4000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B96EA17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map */, + 888B970B17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a MapTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B96E917B71AC4000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B970717B71AC4000B5911 /* Images.xcassets in Resources */, + 888B96F917B71AC4000B5911 /* InfoPlist.strings in Resources */, + 888B970217B71AC4000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B970A17B71AC4000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B971817B71AC4000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B96E717B71AC4000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B970517B71AC4000B5911 /* ViewController.m in Sources */, + 888B96FF17B71AC4000B5911 /* AppDelegate.m in Sources */, + 888B96FB17B71AC4000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B970817B71AC4000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B971A17B71AC4000B5911 /* Recipe_7_5__Adding_Overlays_to_a_MapTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B971217B71AC4000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B96EA17B71AC4000B5911 /* Recipe 7-5 Adding Overlays to a Map */; + targetProxy = 888B971117B71AC4000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B96F717B71AC4000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B96F817B71AC4000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B970017B71AC4000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B970117B71AC4000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B971617B71AC4000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B971717B71AC4000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B971B17B71AC4000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B971C17B71AC4000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B971E17B71AC4000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-5: Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-5: Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Info.plist"; + PRODUCT_NAME = "Recipe 7-5 Adding Overlays to a Map"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B971F17B71AC4000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-5: Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-5: Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Info.plist"; + PRODUCT_NAME = "Recipe 7-5 Adding Overlays to a Map"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B972117B71AC4000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-5: Adding Overlays to a Map.app/Recipe 7-5: Adding Overlays to a Map"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-5: Adding Overlays to a Map/Recipe 7-5: Adding Overlays to a Map-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-5: Adding Overlays to a MapTests/Recipe 7-5 Adding Overlays to a MapTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-5 Adding Overlays to a MapTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B972217B71AC4000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-5: Adding Overlays to a Map.app/Recipe 7-5: Adding Overlays to a Map"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-5: Adding Overlays to a Map/Recipe 7-5: Adding Overlays to a Map-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-5: Adding Overlays to a MapTests/Recipe 7-5 Adding Overlays to a MapTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-5 Adding Overlays to a MapTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B96E617B71AC4000B5911 /* Build configuration list for PBXProject "Recipe 7-5 Adding Overlays to a Map" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B971B17B71AC4000B5911 /* Debug */, + 888B971C17B71AC4000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B971D17B71AC4000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-5 Adding Overlays to a Map" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B971E17B71AC4000B5911 /* Debug */, + 888B971F17B71AC4000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B972017B71AC4000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-5 Adding Overlays to a MapTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B972117B71AC4000B5911 /* Debug */, + 888B972217B71AC4000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B96E317B71AC4000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..72108ba --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..7f170ce Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..bf45fbd --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-5_ Adding Overlays to a Map.xcscheme b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-5_ Adding Overlays to a Map.xcscheme new file mode 100644 index 0000000..d747b18 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-5_ Adding Overlays to a Map.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..a44730f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-5: Adding Overlays to a Map.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B96EA17B71AC4000B5911 + + primary + + + 888B970B17B71AC4000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/AppDelegate.h new file mode 100644 index 0000000..99c4866 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-5: Adding Overlays to a Map +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/AppDelegate.m new file mode 100644 index 0000000..539e84a --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-5: Adding Overlays to a Map +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Base.lproj/Main.storyboard new file mode 100644 index 0000000..a9270c2 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Info.plist b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Prefix.pch b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5 Adding Overlays to a Map-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/ViewController.h b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/ViewController.h new file mode 100644 index 0000000..eacfbe1 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/ViewController.h @@ -0,0 +1,17 @@ +// +// ViewController.h +// Recipe 7-5: Adding Overlays to a Map +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/ViewController.m b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/ViewController.m new file mode 100644 index 0000000..927f0ae --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/ViewController.m @@ -0,0 +1,99 @@ +// +// ViewController.m +// Recipe 7-5: Adding Overlays to a Map +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mapView.delegate = self; + + CLLocationCoordinate2D mexicoCityLocation = CLLocationCoordinate2DMake(19.808, -98.965); + MKCircle *circleOverlay = [MKCircle circleWithCenterCoordinate:mexicoCityLocation + radius:500000]; + + CLLocationCoordinate2D polyCoords[5] = + { + CLLocationCoordinate2DMake(39.9, -76.6), + CLLocationCoordinate2DMake(36.7, -84.0), + CLLocationCoordinate2DMake(33.1, -89.4), + CLLocationCoordinate2DMake(27.3, -80.8), + CLLocationCoordinate2DMake(39.9, -76.6) + }; + + MKPolygon *polygonOverlay = [MKPolygon polygonWithCoordinates:polyCoords count:5]; + + CLLocationCoordinate2D pathCoords[2] = + { + CLLocationCoordinate2DMake(46.8, -100.8), + CLLocationCoordinate2DMake(43.7, -70.4) + }; + MKPolyline *pathOverlay = [MKPolyline polylineWithCoordinates:pathCoords count:2]; + + [self.mapView addOverlays:[NSArray arrayWithObjects: circleOverlay, polygonOverlay, pathOverlay, nil] + level:MKOverlayLevelAboveRoads]; + + +} + + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - delegate methods + +-(MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id )overlay +{ + if([overlay isKindOfClass:[MKCircle class]]) + { + + MKCircleRenderer *renderer = [[MKCircleRenderer alloc] initWithOverlay:overlay]; + + //Display settings + renderer.lineWidth = 1; + renderer.strokeColor = [UIColor blueColor]; + renderer.fillColor = [[UIColor blueColor] colorWithAlphaComponent:0.5]; + return renderer; + } + if([overlay isKindOfClass:[MKPolygon class]]) + { + MKPolygonRenderer *renderer= [[MKPolygonRenderer alloc] initWithOverlay:overlay]; + + //Display settings + renderer.lineWidth=1; + renderer.strokeColor=[UIColor blueColor]; + renderer.fillColor=[[UIColor blueColor] colorWithAlphaComponent:0.5]; + return renderer; + } + else if ([overlay isKindOfClass:[MKPolyline class]]) + { + + MKPolylineRenderer *renderer = [[MKPolylineRenderer alloc] initWithOverlay:overlay]; + + //Display settings + renderer.lineWidth = 3; + renderer.strokeColor = [UIColor blueColor]; + return renderer; + } + + return nil; +} + + + +@end diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/main.m b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/main.m new file mode 100644 index 0000000..1189141 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a Map/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-5: Adding Overlays to a Map +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/Recipe 7-5 Adding Overlays to a MapTests-Info.plist b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/Recipe 7-5 Adding Overlays to a MapTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/Recipe 7-5 Adding Overlays to a MapTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/Recipe_7_5__Adding_Overlays_to_a_MapTests.m b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/Recipe_7_5__Adding_Overlays_to_a_MapTests.m new file mode 100644 index 0000000..3512aa3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/Recipe_7_5__Adding_Overlays_to_a_MapTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_5__Adding_Overlays_to_a_MapTests.m +// Recipe 7-5: Adding Overlays to a MapTests +// +// Created by joseph hoffman on 8/10/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_5__Adding_Overlays_to_a_MapTests : XCTestCase + +@end + +@implementation Recipe_7_5__Adding_Overlays_to_a_MapTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-5_ Adding Overlays to a Map/Recipe 7-5_ Adding Overlays to a MapTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.pbxproj new file mode 100644 index 0000000..22fd5b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.pbxproj @@ -0,0 +1,487 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B973417B82159000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B973317B82159000B5911 /* Foundation.framework */; }; + 888B973617B82159000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B973517B82159000B5911 /* CoreGraphics.framework */; }; + 888B973817B82159000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B973717B82159000B5911 /* UIKit.framework */; }; + 888B973E17B82159000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B973C17B82159000B5911 /* InfoPlist.strings */; }; + 888B974017B82159000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B973F17B82159000B5911 /* main.m */; }; + 888B974417B82159000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B974317B82159000B5911 /* AppDelegate.m */; }; + 888B974717B82159000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B974517B82159000B5911 /* Main.storyboard */; }; + 888B974A17B82159000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B974917B82159000B5911 /* ViewController.m */; }; + 888B974C17B82159000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B974B17B82159000B5911 /* Images.xcassets */; }; + 888B975317B8215A000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B975217B8215A000B5911 /* XCTest.framework */; }; + 888B975417B8215A000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B973317B82159000B5911 /* Foundation.framework */; }; + 888B975517B8215A000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B973717B82159000B5911 /* UIKit.framework */; }; + 888B975D17B8215A000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B975B17B8215A000B5911 /* InfoPlist.strings */; }; + 888B975F17B8215A000B5911 /* Recipe_7_6__Grouping_Annotations_DynamicallyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B975E17B8215A000B5911 /* Recipe_7_6__Grouping_Annotations_DynamicallyTests.m */; }; + 888B976917B821FE000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B976817B821FE000B5911 /* MapKit.framework */; }; + 888B976B17B82206000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B976A17B82206000B5911 /* CoreLocation.framework */; }; + 888B976E17B8236C000B5911 /* Hotspot.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B976D17B8236C000B5911 /* Hotspot.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B975617B8215A000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B972817B82159000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B972F17B82159000B5911; + remoteInfo = "Recipe 7-6: Grouping Annotations Dynamically"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B973017B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-6 Grouping Annotations Dynamically.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B973317B82159000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B973517B82159000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B973717B82159000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B973B17B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-6 Grouping Annotations Dynamically-Info.plist"; sourceTree = ""; }; + 888B973D17B82159000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B973F17B82159000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B974117B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch"; sourceTree = ""; }; + 888B974217B82159000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B974317B82159000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B974617B82159000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B974817B82159000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B974917B82159000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B974B17B82159000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B975117B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-6 Grouping Annotations DynamicallyTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B975217B8215A000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B975A17B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist"; sourceTree = ""; }; + 888B975C17B8215A000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B975E17B8215A000B5911 /* Recipe_7_6__Grouping_Annotations_DynamicallyTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_6__Grouping_Annotations_DynamicallyTests.m; sourceTree = ""; }; + 888B976817B821FE000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B976A17B82206000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; + 888B976C17B8236C000B5911 /* Hotspot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Hotspot.h; sourceTree = ""; }; + 888B976D17B8236C000B5911 /* Hotspot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Hotspot.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B972D17B82159000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B976B17B82206000B5911 /* CoreLocation.framework in Frameworks */, + 888B976917B821FE000B5911 /* MapKit.framework in Frameworks */, + 888B973617B82159000B5911 /* CoreGraphics.framework in Frameworks */, + 888B973817B82159000B5911 /* UIKit.framework in Frameworks */, + 888B973417B82159000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B974E17B8215A000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B975317B8215A000B5911 /* XCTest.framework in Frameworks */, + 888B975517B8215A000B5911 /* UIKit.framework in Frameworks */, + 888B975417B8215A000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B972717B82159000B5911 = { + isa = PBXGroup; + children = ( + 888B973917B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically */, + 888B975817B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests */, + 888B973217B82159000B5911 /* Frameworks */, + 888B973117B82159000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B973117B82159000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B973017B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically.app */, + 888B975117B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B973217B82159000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B976A17B82206000B5911 /* CoreLocation.framework */, + 888B976817B821FE000B5911 /* MapKit.framework */, + 888B973317B82159000B5911 /* Foundation.framework */, + 888B973517B82159000B5911 /* CoreGraphics.framework */, + 888B973717B82159000B5911 /* UIKit.framework */, + 888B975217B8215A000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B973917B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically */ = { + isa = PBXGroup; + children = ( + 888B974217B82159000B5911 /* AppDelegate.h */, + 888B974317B82159000B5911 /* AppDelegate.m */, + 888B974517B82159000B5911 /* Main.storyboard */, + 888B974817B82159000B5911 /* ViewController.h */, + 888B974917B82159000B5911 /* ViewController.m */, + 888B976C17B8236C000B5911 /* Hotspot.h */, + 888B976D17B8236C000B5911 /* Hotspot.m */, + 888B974B17B82159000B5911 /* Images.xcassets */, + 888B973A17B82159000B5911 /* Supporting Files */, + ); + name = "Recipe 7-6 Grouping Annotations Dynamically"; + path = "Recipe 7-6: Grouping Annotations Dynamically"; + sourceTree = ""; + }; + 888B973A17B82159000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B973B17B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically-Info.plist */, + 888B973C17B82159000B5911 /* InfoPlist.strings */, + 888B973F17B82159000B5911 /* main.m */, + 888B974117B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B975817B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests */ = { + isa = PBXGroup; + children = ( + 888B975E17B8215A000B5911 /* Recipe_7_6__Grouping_Annotations_DynamicallyTests.m */, + 888B975917B8215A000B5911 /* Supporting Files */, + ); + name = "Recipe 7-6 Grouping Annotations DynamicallyTests"; + path = "Recipe 7-6: Grouping Annotations DynamicallyTests"; + sourceTree = ""; + }; + 888B975917B8215A000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B975A17B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist */, + 888B975B17B8215A000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B972F17B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B976217B8215A000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-6 Grouping Annotations Dynamically" */; + buildPhases = ( + 888B972C17B82159000B5911 /* Sources */, + 888B972D17B82159000B5911 /* Frameworks */, + 888B972E17B82159000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-6 Grouping Annotations Dynamically"; + productName = "Recipe 7-6: Grouping Annotations Dynamically"; + productReference = 888B973017B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically.app */; + productType = "com.apple.product-type.application"; + }; + 888B975017B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B976517B8215A000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-6 Grouping Annotations DynamicallyTests" */; + buildPhases = ( + 888B974D17B8215A000B5911 /* Sources */, + 888B974E17B8215A000B5911 /* Frameworks */, + 888B974F17B8215A000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B975717B8215A000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-6 Grouping Annotations DynamicallyTests"; + productName = "Recipe 7-6: Grouping Annotations DynamicallyTests"; + productReference = 888B975117B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B972817B82159000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B975017B8215A000B5911 = { + TestTargetID = 888B972F17B82159000B5911; + }; + }; + }; + buildConfigurationList = 888B972B17B82159000B5911 /* Build configuration list for PBXProject "Recipe 7-6 Grouping Annotations Dynamically" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B972717B82159000B5911; + productRefGroup = 888B973117B82159000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B972F17B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically */, + 888B975017B8215A000B5911 /* Recipe 7-6 Grouping Annotations DynamicallyTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B972E17B82159000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B974C17B82159000B5911 /* Images.xcassets in Resources */, + 888B973E17B82159000B5911 /* InfoPlist.strings in Resources */, + 888B974717B82159000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B974F17B8215A000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B975D17B8215A000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B972C17B82159000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B974A17B82159000B5911 /* ViewController.m in Sources */, + 888B976E17B8236C000B5911 /* Hotspot.m in Sources */, + 888B974417B82159000B5911 /* AppDelegate.m in Sources */, + 888B974017B82159000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B974D17B8215A000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B975F17B8215A000B5911 /* Recipe_7_6__Grouping_Annotations_DynamicallyTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B975717B8215A000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B972F17B82159000B5911 /* Recipe 7-6 Grouping Annotations Dynamically */; + targetProxy = 888B975617B8215A000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B973C17B82159000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B973D17B82159000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B974517B82159000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B974617B82159000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B975B17B8215A000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B975C17B8215A000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B976017B8215A000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B976117B8215A000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B976317B8215A000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-6: Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-6: Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Info.plist"; + PRODUCT_NAME = "Recipe 7-6 Grouping Annotations Dynamically"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B976417B8215A000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-6: Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-6: Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Info.plist"; + PRODUCT_NAME = "Recipe 7-6 Grouping Annotations Dynamically"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B976617B8215A000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-6: Grouping Annotations Dynamically.app/Recipe 7-6: Grouping Annotations Dynamically"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-6: Grouping Annotations Dynamically/Recipe 7-6: Grouping Annotations Dynamically-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-6: Grouping Annotations DynamicallyTests/Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-6 Grouping Annotations DynamicallyTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B976717B8215A000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-6: Grouping Annotations Dynamically.app/Recipe 7-6: Grouping Annotations Dynamically"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-6: Grouping Annotations Dynamically/Recipe 7-6: Grouping Annotations Dynamically-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-6: Grouping Annotations DynamicallyTests/Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-6 Grouping Annotations DynamicallyTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B972B17B82159000B5911 /* Build configuration list for PBXProject "Recipe 7-6 Grouping Annotations Dynamically" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B976017B8215A000B5911 /* Debug */, + 888B976117B8215A000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B976217B8215A000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-6 Grouping Annotations Dynamically" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B976317B8215A000B5911 /* Debug */, + 888B976417B8215A000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B976517B8215A000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-6 Grouping Annotations DynamicallyTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B976617B8215A000B5911 /* Debug */, + 888B976717B8215A000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B972817B82159000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..beeba27 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..b38a664 Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..9ebc983 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..68f7a28 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-6: Grouping Annotations Dynamically.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B972F17B82159000B5911 + + primary + + + 888B975017B8215A000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/AppDelegate.h new file mode 100644 index 0000000..9b3a86e --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-6: Grouping Annotations Dynamically +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/AppDelegate.m new file mode 100644 index 0000000..80a137c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-6: Grouping Annotations Dynamically +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b4f4bb6 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Hotspot.h b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Hotspot.h new file mode 100644 index 0000000..02a50ea --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Hotspot.h @@ -0,0 +1,33 @@ +// +// Hotspot.h +// Recipe 7-6: Grouping Annotations Dynamically +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface Hotspot : NSObject +{ + CLLocationCoordinate2D _coordinate; + NSString *_title; + NSString *_subtitle; +} + +@property (nonatomic) CLLocationCoordinate2D coordinate; +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) NSString *subtitle; + +@property (nonatomic, strong) NSMutableArray *places; +@property (nonatomic, strong) MKPinAnnotationView *annotationView; + +-(void)addPlace:(Hotspot *)hotspot; +-(int)placesCount; +-(void)cleanPlaces; + + +-(id)initWithCoordinate:(CLLocationCoordinate2D)coordinate title:(NSString *)title subtitle:(NSString *)subtitle; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Hotspot.m b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Hotspot.m new file mode 100644 index 0000000..32d7fa7 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Hotspot.m @@ -0,0 +1,78 @@ +// +// Hotspot.m +// Recipe 7-6: Grouping Annotations Dynamically +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + + + +#import "Hotspot.h" +@interface Hotspot() + + + +@end + +@implementation Hotspot + +-(id)initWithCoordinate:(CLLocationCoordinate2D)coordinate title:(NSString *)title subtitle:(NSString *)subtitle +{ + self = [super init]; + if (self) { + self.coordinate = coordinate; + self.title = title; + self.subtitle = subtitle; + self.places = [[NSMutableArray alloc] initWithCapacity:0]; + } + return self; +} + +-(NSString *)title +{ + if ([self placesCount] == 1) + { + return _title; + } + else + return [NSString stringWithFormat:@"%i Places", [self.places count]]; +} + +-(CLLocationCoordinate2D)coordinate +{ + return _coordinate; +} + +-(void)setCoordinate:(CLLocationCoordinate2D)coordinate +{ + _coordinate = coordinate; +} + +-(void)setTitle:(NSString *)title +{ + _title = title; +} + +-(void)setSubtitle:(NSString *)subtitle +{ + _subtitle = subtitle; +} + +-(void)addPlace:(Hotspot *)hotspot +{ + [self.places addObject:hotspot]; +} + +-(int)placesCount +{ + return [self.places count]; +} + +-(void)cleanPlaces +{ + [self.places removeAllObjects]; + [self.places addObject:self]; +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Info.plist b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6 Grouping Annotations Dynamically-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/ViewController.h b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/ViewController.h new file mode 100644 index 0000000..ea509af --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/ViewController.h @@ -0,0 +1,23 @@ +// +// ViewController.h +// Recipe 7-6: Grouping Annotations Dynamically +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController +{ + CLLocationDegrees _zoomLevel; + NSMutableArray *_annotations; + +} + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; + + + +@end diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/ViewController.m b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/ViewController.m new file mode 100644 index 0000000..1d8b3ef --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/ViewController.m @@ -0,0 +1,164 @@ +// +// ViewController.m +// Recipe 7-6: Grouping Annotations Dynamically +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + + +#define centerLat 39.7392 +#define centerLong -104.9842 +#define spanDeltaLat 4.9 +#define spanDeltaLong 5.8 +#define scaleLat 9.0 +#define scaleLong 11.0 + +#import "ViewController.h" +#import "Hotspot.h" + +@interface ViewController () + +@end + +@implementation ViewController +@synthesize mapView = _mapView; + +-(float)randomFloatFrom:(float)a to:(float)b +{ + float random = ((float) rand()) / (float) RAND_MAX; + float diff = b - a; + float r = random * diff; + return a + r; +} + +-(void)generateAnnotations +{ + srand((unsigned)time(0)); + + for (int i=0; i<1000; i++) + { + CLLocationCoordinate2D randomLocation = + CLLocationCoordinate2DMake([self randomFloatFrom:37.0 to:42.0], [self randomFloatFrom:-103.0 to:-107.0]); + + Hotspot *place = [[Hotspot alloc] initWithCoordinate:randomLocation title:[NSString stringWithFormat:@"Place %d title", i] subtitle:[NSString stringWithFormat:@"Place %d subtitle", i]]; + [_annotations addObject:place]; + } +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mapView.delegate = self; + + _annotations = [[NSMutableArray alloc] initWithCapacity:1000]; + + [self generateAnnotations]; + // The line below is for setup purposes only. It will be unnecessary + // when grouping is implemented. + //[self.mapView addAnnotations:_annotations]; + + CLLocationCoordinate2D centerPoint = {centerLat, centerLong}; + MKCoordinateSpan coordinateSpan = MKCoordinateSpanMake(spanDeltaLat, spanDeltaLong); + MKCoordinateRegion coordinateRegion = MKCoordinateRegionMake(centerPoint, coordinateSpan); + + [self.mapView setRegion:coordinateRegion]; + [self.mapView regionThatFits:coordinateRegion]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} + +- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id )annotation +{ + // if it's the user location, just return nil. + if ([annotation isKindOfClass:[MKUserLocation class]]) + return nil; + else + { + static NSString *startPinId = @"StartPinIdentifier"; + MKPinAnnotationView *startPin = (id)[mapView dequeueReusableAnnotationViewWithIdentifier:startPinId]; + if (startPin == nil) + { + startPin = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:startPinId]; + startPin.canShowCallout = YES; + startPin.animatesDrop = YES; + + Hotspot *place = annotation; + place.annotationView = startPin; + if ([place placesCount] > 1) + { + startPin.pinColor = MKPinAnnotationColorGreen; + } + else if ([place placesCount] == 1) + { + startPin.pinColor = MKPinAnnotationColorRed; + } + } + return startPin; + } +} + +-(void)group:(NSArray *)annotations +{ + float latDelta = self.mapView.region.span.latitudeDelta / scaleLat; + float longDelta = self.mapView.region.span.longitudeDelta / scaleLong; + [_annotations makeObjectsPerformSelector:@selector(cleanPlaces)]; + NSMutableArray *visibleAnnotations = [[NSMutableArray alloc] initWithCapacity:0]; + + for (Hotspot *current in annotations) + { + CLLocationDegrees lat = current.coordinate.latitude; + CLLocationDegrees longi = current.coordinate.longitude; + + bool found = FALSE; + for (Hotspot *temp in visibleAnnotations) + { + if(fabs(temp.coordinate.latitude - lat) < latDelta && + fabs(temp.coordinate.longitude - longi) < longDelta) + { + [self.mapView removeAnnotation:current]; + found = TRUE; + [temp addPlace:current]; + break; + } + } + if (!found) + { + [visibleAnnotations addObject:current]; + [self.mapView addAnnotation:current]; + } + } +} + +-(void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated +{ + if (_zoomLevel != mapView.region.span.longitudeDelta) + { + [self group:_annotations]; + _zoomLevel = mapView.region.span.longitudeDelta; + + NSSet *visibleAnnotations = [mapView annotationsInMapRect:mapView.visibleMapRect]; + for (Hotspot *place in visibleAnnotations) + { + if ([place placesCount] > 1) + place.annotationView.pinColor = MKPinAnnotationColorGreen; + else + place.annotationView.pinColor = MKPinAnnotationColorRed; + } + + } +} + + + +@end diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/main.m b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/main.m new file mode 100644 index 0000000..b5f4c91 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations Dynamically/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-6: Grouping Annotations Dynamically +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/Recipe 7-6 Grouping Annotations DynamicallyTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/Recipe_7_6__Grouping_Annotations_DynamicallyTests.m b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/Recipe_7_6__Grouping_Annotations_DynamicallyTests.m new file mode 100644 index 0000000..49f3756 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/Recipe_7_6__Grouping_Annotations_DynamicallyTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_6__Grouping_Annotations_DynamicallyTests.m +// Recipe 7-6: Grouping Annotations DynamicallyTests +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_6__Grouping_Annotations_DynamicallyTests : XCTestCase + +@end + +@implementation Recipe_7_6__Grouping_Annotations_DynamicallyTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-6_ Grouping Annotations Dynamically/Recipe 7-6_ Grouping Annotations DynamicallyTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.pbxproj new file mode 100644 index 0000000..254765a --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B977C17B838C5000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B977B17B838C5000B5911 /* Foundation.framework */; }; + 888B977E17B838C5000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B977D17B838C5000B5911 /* CoreGraphics.framework */; }; + 888B978017B838C5000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B977F17B838C5000B5911 /* UIKit.framework */; }; + 888B978617B838C5000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B978417B838C5000B5911 /* InfoPlist.strings */; }; + 888B978817B838C5000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B978717B838C5000B5911 /* main.m */; }; + 888B978C17B838C5000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B978B17B838C5000B5911 /* AppDelegate.m */; }; + 888B978F17B838C5000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B978D17B838C5000B5911 /* Main.storyboard */; }; + 888B979217B838C5000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B979117B838C5000B5911 /* ViewController.m */; }; + 888B979417B838C5000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B979317B838C5000B5911 /* Images.xcassets */; }; + 888B979B17B838C5000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B979A17B838C5000B5911 /* XCTest.framework */; }; + 888B979C17B838C5000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B977B17B838C5000B5911 /* Foundation.framework */; }; + 888B979D17B838C5000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B977F17B838C5000B5911 /* UIKit.framework */; }; + 888B97A517B838C5000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B97A317B838C5000B5911 /* InfoPlist.strings */; }; + 888B97A717B838C6000B5911 /* Recipe_7_7__Starting_Maps_from_Your_AppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B97A617B838C5000B5911 /* Recipe_7_7__Starting_Maps_from_Your_AppTests.m */; }; + 888B97B117B838D3000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97B017B838D3000B5911 /* MapKit.framework */; }; + 888B97B317B838D9000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97B217B838D9000B5911 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B979E17B838C5000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B977017B838C5000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B977717B838C5000B5911; + remoteInfo = "Recipe 7-7: Starting Maps from Your App"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B977817B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-7 Starting Maps from Your App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B977B17B838C5000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B977D17B838C5000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B977F17B838C5000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B978317B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-7 Starting Maps from Your App-Info.plist"; sourceTree = ""; }; + 888B978517B838C5000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B978717B838C5000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B978917B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-7 Starting Maps from Your App-Prefix.pch"; sourceTree = ""; }; + 888B978A17B838C5000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B978B17B838C5000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B978E17B838C5000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B979017B838C5000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B979117B838C5000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B979317B838C5000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B979917B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-7 Starting Maps from Your AppTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B979A17B838C5000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B97A217B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-7 Starting Maps from Your AppTests-Info.plist"; sourceTree = ""; }; + 888B97A417B838C5000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B97A617B838C5000B5911 /* Recipe_7_7__Starting_Maps_from_Your_AppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_7__Starting_Maps_from_Your_AppTests.m; sourceTree = ""; }; + 888B97B017B838D3000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B97B217B838D9000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B977517B838C5000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97B317B838D9000B5911 /* CoreLocation.framework in Frameworks */, + 888B97B117B838D3000B5911 /* MapKit.framework in Frameworks */, + 888B977E17B838C5000B5911 /* CoreGraphics.framework in Frameworks */, + 888B978017B838C5000B5911 /* UIKit.framework in Frameworks */, + 888B977C17B838C5000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B979617B838C5000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B979B17B838C5000B5911 /* XCTest.framework in Frameworks */, + 888B979D17B838C5000B5911 /* UIKit.framework in Frameworks */, + 888B979C17B838C5000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B976F17B838C5000B5911 = { + isa = PBXGroup; + children = ( + 888B978117B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App */, + 888B97A017B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests */, + 888B977A17B838C5000B5911 /* Frameworks */, + 888B977917B838C5000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B977917B838C5000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B977817B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App.app */, + 888B979917B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B977A17B838C5000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B97B217B838D9000B5911 /* CoreLocation.framework */, + 888B97B017B838D3000B5911 /* MapKit.framework */, + 888B977B17B838C5000B5911 /* Foundation.framework */, + 888B977D17B838C5000B5911 /* CoreGraphics.framework */, + 888B977F17B838C5000B5911 /* UIKit.framework */, + 888B979A17B838C5000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B978117B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App */ = { + isa = PBXGroup; + children = ( + 888B978A17B838C5000B5911 /* AppDelegate.h */, + 888B978B17B838C5000B5911 /* AppDelegate.m */, + 888B978D17B838C5000B5911 /* Main.storyboard */, + 888B979017B838C5000B5911 /* ViewController.h */, + 888B979117B838C5000B5911 /* ViewController.m */, + 888B979317B838C5000B5911 /* Images.xcassets */, + 888B978217B838C5000B5911 /* Supporting Files */, + ); + name = "Recipe 7-7 Starting Maps from Your App"; + path = "Recipe 7-7: Starting Maps from Your App"; + sourceTree = ""; + }; + 888B978217B838C5000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B978317B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App-Info.plist */, + 888B978417B838C5000B5911 /* InfoPlist.strings */, + 888B978717B838C5000B5911 /* main.m */, + 888B978917B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B97A017B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests */ = { + isa = PBXGroup; + children = ( + 888B97A617B838C5000B5911 /* Recipe_7_7__Starting_Maps_from_Your_AppTests.m */, + 888B97A117B838C5000B5911 /* Supporting Files */, + ); + name = "Recipe 7-7 Starting Maps from Your AppTests"; + path = "Recipe 7-7: Starting Maps from Your AppTests"; + sourceTree = ""; + }; + 888B97A117B838C5000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B97A217B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests-Info.plist */, + 888B97A317B838C5000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B977717B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B97AA17B838C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-7 Starting Maps from Your App" */; + buildPhases = ( + 888B977417B838C5000B5911 /* Sources */, + 888B977517B838C5000B5911 /* Frameworks */, + 888B977617B838C5000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-7 Starting Maps from Your App"; + productName = "Recipe 7-7: Starting Maps from Your App"; + productReference = 888B977817B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App.app */; + productType = "com.apple.product-type.application"; + }; + 888B979817B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B97AD17B838C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-7 Starting Maps from Your AppTests" */; + buildPhases = ( + 888B979517B838C5000B5911 /* Sources */, + 888B979617B838C5000B5911 /* Frameworks */, + 888B979717B838C5000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B979F17B838C5000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-7 Starting Maps from Your AppTests"; + productName = "Recipe 7-7: Starting Maps from Your AppTests"; + productReference = 888B979917B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B977017B838C5000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B979817B838C5000B5911 = { + TestTargetID = 888B977717B838C5000B5911; + }; + }; + }; + buildConfigurationList = 888B977317B838C5000B5911 /* Build configuration list for PBXProject "Recipe 7-7 Starting Maps from Your App" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B976F17B838C5000B5911; + productRefGroup = 888B977917B838C5000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B977717B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App */, + 888B979817B838C5000B5911 /* Recipe 7-7 Starting Maps from Your AppTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B977617B838C5000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B979417B838C5000B5911 /* Images.xcassets in Resources */, + 888B978617B838C5000B5911 /* InfoPlist.strings in Resources */, + 888B978F17B838C5000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B979717B838C5000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97A517B838C5000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B977417B838C5000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B979217B838C5000B5911 /* ViewController.m in Sources */, + 888B978C17B838C5000B5911 /* AppDelegate.m in Sources */, + 888B978817B838C5000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B979517B838C5000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97A717B838C6000B5911 /* Recipe_7_7__Starting_Maps_from_Your_AppTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B979F17B838C5000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B977717B838C5000B5911 /* Recipe 7-7 Starting Maps from Your App */; + targetProxy = 888B979E17B838C5000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B978417B838C5000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B978517B838C5000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B978D17B838C5000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B978E17B838C5000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B97A317B838C5000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B97A417B838C5000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B97A817B838C6000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B97A917B838C6000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B97AB17B838C6000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-7: Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-7: Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Info.plist"; + PRODUCT_NAME = "Recipe 7-7 Starting Maps from Your App"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B97AC17B838C6000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-7: Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-7: Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Info.plist"; + PRODUCT_NAME = "Recipe 7-7 Starting Maps from Your App"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B97AE17B838C6000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-7: Starting Maps from Your App.app/Recipe 7-7: Starting Maps from Your App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-7: Starting Maps from Your App/Recipe 7-7: Starting Maps from Your App-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-7: Starting Maps from Your AppTests/Recipe 7-7 Starting Maps from Your AppTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-7 Starting Maps from Your AppTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B97AF17B838C6000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-7: Starting Maps from Your App.app/Recipe 7-7: Starting Maps from Your App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-7: Starting Maps from Your App/Recipe 7-7: Starting Maps from Your App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-7: Starting Maps from Your AppTests/Recipe 7-7 Starting Maps from Your AppTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-7 Starting Maps from Your AppTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B977317B838C5000B5911 /* Build configuration list for PBXProject "Recipe 7-7 Starting Maps from Your App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B97A817B838C6000B5911 /* Debug */, + 888B97A917B838C6000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B97AA17B838C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-7 Starting Maps from Your App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B97AB17B838C6000B5911 /* Debug */, + 888B97AC17B838C6000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B97AD17B838C6000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-7 Starting Maps from Your AppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B97AE17B838C6000B5911 /* Debug */, + 888B97AF17B838C6000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B977017B838C5000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b767b5e --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0c3920a Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..344bcbf --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-7 Starting Maps from Your App.xcscheme b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-7 Starting Maps from Your App.xcscheme new file mode 100644 index 0000000..3b76b00 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-7 Starting Maps from Your App.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..3e10284 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-7 Starting Maps from Your App.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B977717B838C5000B5911 + + primary + + + 888B979817B838C5000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/AppDelegate.h new file mode 100644 index 0000000..7bab51a --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-7: Starting Maps from Your App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/AppDelegate.m new file mode 100644 index 0000000..807b998 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-7: Starting Maps from Your App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e3e9c84 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Base.lproj/Main.storyboard @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Info.plist b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Prefix.pch b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7 Starting Maps from Your App-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/ViewController.h b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/ViewController.h new file mode 100644 index 0000000..1d580f0 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 7-7: Starting Maps from Your App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +- (IBAction)startWithOnePlacemark:(id)sender; +- (IBAction)startWithMultiplePlacemarks:(id)sender; +- (IBAction)startInDirectionsMode:(id)sender; + + +@end diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/ViewController.m b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/ViewController.m new file mode 100644 index 0000000..909957e --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/ViewController.m @@ -0,0 +1,78 @@ +// +// ViewController.m +// Recipe 7-7: Starting Maps from Your App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)startWithOnePlacemark:(id)sender { + + CLLocationCoordinate2D bigBenLocation = CLLocationCoordinate2DMake(51.50065200, -0.12483300); + MKPlacemark *bigBenPlacemark = [[MKPlacemark alloc] initWithCoordinate:bigBenLocation addressDictionary:nil]; + MKMapItem *bigBenItem = [[MKMapItem alloc] initWithPlacemark:bigBenPlacemark]; + bigBenItem.name = @"Big Ben"; + + [bigBenItem openInMapsWithLaunchOptions:nil]; +} + +- (IBAction)startWithMultiplePlacemarks:(id)sender { + + CLLocationCoordinate2D bigBenLocation = CLLocationCoordinate2DMake(51.50065200, -0.12483300); + MKPlacemark *bigBenPlacemark = [[MKPlacemark alloc] initWithCoordinate:bigBenLocation addressDictionary:nil]; + MKMapItem *bigBenItem = [[MKMapItem alloc] initWithPlacemark:bigBenPlacemark]; + bigBenItem.name = @"Big Ben"; + + CLLocationCoordinate2D westminsterLocation = CLLocationCoordinate2DMake(51.50054300, -0.13570200); + MKPlacemark *westminsterPlacemark = [[MKPlacemark alloc] initWithCoordinate:westminsterLocation addressDictionary:nil]; + MKMapItem *westminsterItem = [[MKMapItem alloc] initWithPlacemark:westminsterPlacemark]; + westminsterItem.name = @"Westminster Abbey"; + + NSArray *items = [[NSArray alloc] initWithObjects:bigBenItem, westminsterItem, nil]; + [MKMapItem openMapsWithItems:items launchOptions:nil]; +} + +- (IBAction)startInDirectionsMode:(id)sender { + + CLLocationCoordinate2D bigBenLocation = + CLLocationCoordinate2DMake(51.50065200, -0.12483300); + MKPlacemark *bigBenPlacemark = [[MKPlacemark alloc] + initWithCoordinate:bigBenLocation addressDictionary:nil]; + MKMapItem *bigBenItem = [[MKMapItem alloc] initWithPlacemark:bigBenPlacemark]; + bigBenItem.name = @"Big Ben"; + + CLLocationCoordinate2D westminsterLocation = + CLLocationCoordinate2DMake(51.50054300, -0.13570200); + MKPlacemark *westminsterPlacemark = [[MKPlacemark alloc] + initWithCoordinate:westminsterLocation addressDictionary:nil]; + MKMapItem *westminsterItem = [[MKMapItem alloc] + initWithPlacemark:westminsterPlacemark]; + westminsterItem.name = @"Westminster Abbey"; + + NSArray *items = [[NSArray alloc] initWithObjects:bigBenItem, westminsterItem, nil]; + NSDictionary *options = + @{MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeWalking}; + [MKMapItem openMapsWithItems:items launchOptions:options]; +} +@end diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/main.m b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/main.m new file mode 100644 index 0000000..8d6e086 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your App/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-7: Starting Maps from Your App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/Recipe 7-7 Starting Maps from Your AppTests-Info.plist b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/Recipe 7-7 Starting Maps from Your AppTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/Recipe 7-7 Starting Maps from Your AppTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/Recipe_7_7__Starting_Maps_from_Your_AppTests.m b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/Recipe_7_7__Starting_Maps_from_Your_AppTests.m new file mode 100644 index 0000000..47b6ca6 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/Recipe_7_7__Starting_Maps_from_Your_AppTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_7__Starting_Maps_from_Your_AppTests.m +// Recipe 7-7: Starting Maps from Your AppTests +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_7__Starting_Maps_from_Your_AppTests : XCTestCase + +@end + +@implementation Recipe_7_7__Starting_Maps_from_Your_AppTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-7_ Starting Maps from Your App/Recipe 7-7_ Starting Maps from Your AppTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fb4c27f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.pbxproj @@ -0,0 +1,490 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B97C117B83DE5000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97C017B83DE5000B5911 /* Foundation.framework */; }; + 888B97C317B83DE5000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97C217B83DE5000B5911 /* CoreGraphics.framework */; }; + 888B97C517B83DE5000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97C417B83DE5000B5911 /* UIKit.framework */; }; + 888B97CB17B83DE5000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B97C917B83DE5000B5911 /* InfoPlist.strings */; }; + 888B97CD17B83DE5000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B97CC17B83DE5000B5911 /* main.m */; }; + 888B97D117B83DE5000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B97D017B83DE5000B5911 /* AppDelegate.m */; }; + 888B97D417B83DE5000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B97D217B83DE5000B5911 /* Main.storyboard */; }; + 888B97D717B83DE5000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B97D617B83DE5000B5911 /* ViewController.m */; }; + 888B97D917B83DE5000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B97D817B83DE5000B5911 /* Images.xcassets */; }; + 888B97E017B83DE5000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97DF17B83DE5000B5911 /* XCTest.framework */; }; + 888B97E117B83DE5000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97C017B83DE5000B5911 /* Foundation.framework */; }; + 888B97E217B83DE5000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97C417B83DE5000B5911 /* UIKit.framework */; }; + 888B97EA17B83DE5000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B97E817B83DE5000B5911 /* InfoPlist.strings */; }; + 888B97EC17B83DE5000B5911 /* Recipe_7_8_Registering_a_Routing_AppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B97EB17B83DE5000B5911 /* Recipe_7_8_Registering_a_Routing_AppTests.m */; }; + 888B97F617B83DEF000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97F517B83DEF000B5911 /* CoreLocation.framework */; }; + 888B97F817B83DF6000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B97F717B83DF6000B5911 /* MapKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B97E317B83DE5000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B97B517B83DE5000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B97BC17B83DE5000B5911; + remoteInfo = "Recipe 7-8:Registering a Routing App"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B97BD17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-8 Registering a Routing App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B97C017B83DE5000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B97C217B83DE5000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B97C417B83DE5000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B97C817B83DE5000B5911 /* Recipe 7-8 Registering a Routing App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-8 Registering a Routing App-Info.plist"; sourceTree = ""; }; + 888B97CA17B83DE5000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B97CC17B83DE5000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B97CE17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-8 Registering a Routing App-Prefix.pch"; sourceTree = ""; }; + 888B97CF17B83DE5000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B97D017B83DE5000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B97D317B83DE5000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B97D517B83DE5000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B97D617B83DE5000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B97D817B83DE5000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B97DE17B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-8 Registering a Routing AppTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B97DF17B83DE5000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B97E717B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-8 Registering a Routing AppTests-Info.plist"; sourceTree = ""; }; + 888B97E917B83DE5000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B97EB17B83DE5000B5911 /* Recipe_7_8_Registering_a_Routing_AppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_8_Registering_a_Routing_AppTests.m; sourceTree = ""; }; + 888B97F517B83DEF000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; + 888B97F717B83DF6000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B97F917B852BD000B5911 /* London.geojson */ = {isa = PBXFileReference; lastKnownFileType = text; path = London.geojson; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B97BA17B83DE5000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97F817B83DF6000B5911 /* MapKit.framework in Frameworks */, + 888B97F617B83DEF000B5911 /* CoreLocation.framework in Frameworks */, + 888B97C317B83DE5000B5911 /* CoreGraphics.framework in Frameworks */, + 888B97C517B83DE5000B5911 /* UIKit.framework in Frameworks */, + 888B97C117B83DE5000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B97DB17B83DE5000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97E017B83DE5000B5911 /* XCTest.framework in Frameworks */, + 888B97E217B83DE5000B5911 /* UIKit.framework in Frameworks */, + 888B97E117B83DE5000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B97B417B83DE5000B5911 = { + isa = PBXGroup; + children = ( + 888B97C617B83DE5000B5911 /* Recipe 7-8 Registering a Routing App */, + 888B97E517B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests */, + 888B97BF17B83DE5000B5911 /* Frameworks */, + 888B97BE17B83DE5000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B97BE17B83DE5000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B97BD17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App.app */, + 888B97DE17B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B97BF17B83DE5000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B97F717B83DF6000B5911 /* MapKit.framework */, + 888B97F517B83DEF000B5911 /* CoreLocation.framework */, + 888B97C017B83DE5000B5911 /* Foundation.framework */, + 888B97C217B83DE5000B5911 /* CoreGraphics.framework */, + 888B97C417B83DE5000B5911 /* UIKit.framework */, + 888B97DF17B83DE5000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B97C617B83DE5000B5911 /* Recipe 7-8 Registering a Routing App */ = { + isa = PBXGroup; + children = ( + 888B97CF17B83DE5000B5911 /* AppDelegate.h */, + 888B97D017B83DE5000B5911 /* AppDelegate.m */, + 888B97D217B83DE5000B5911 /* Main.storyboard */, + 888B97D517B83DE5000B5911 /* ViewController.h */, + 888B97D617B83DE5000B5911 /* ViewController.m */, + 888B97D817B83DE5000B5911 /* Images.xcassets */, + 888B97C717B83DE5000B5911 /* Supporting Files */, + ); + name = "Recipe 7-8 Registering a Routing App"; + path = "Recipe 7-8:Registering a Routing App"; + sourceTree = ""; + }; + 888B97C717B83DE5000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B97C817B83DE5000B5911 /* Recipe 7-8 Registering a Routing App-Info.plist */, + 888B97C917B83DE5000B5911 /* InfoPlist.strings */, + 888B97CC17B83DE5000B5911 /* main.m */, + 888B97CE17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App-Prefix.pch */, + 888B97F917B852BD000B5911 /* London.geojson */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B97E517B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests */ = { + isa = PBXGroup; + children = ( + 888B97EB17B83DE5000B5911 /* Recipe_7_8_Registering_a_Routing_AppTests.m */, + 888B97E617B83DE5000B5911 /* Supporting Files */, + ); + name = "Recipe 7-8 Registering a Routing AppTests"; + path = "Recipe 7-8:Registering a Routing AppTests"; + sourceTree = ""; + }; + 888B97E617B83DE5000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B97E717B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests-Info.plist */, + 888B97E817B83DE5000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B97BC17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B97EF17B83DE5000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-8 Registering a Routing App" */; + buildPhases = ( + 888B97B917B83DE5000B5911 /* Sources */, + 888B97BA17B83DE5000B5911 /* Frameworks */, + 888B97BB17B83DE5000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-8 Registering a Routing App"; + productName = "Recipe 7-8:Registering a Routing App"; + productReference = 888B97BD17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App.app */; + productType = "com.apple.product-type.application"; + }; + 888B97DD17B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B97F217B83DE5000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-8 Registering a Routing AppTests" */; + buildPhases = ( + 888B97DA17B83DE5000B5911 /* Sources */, + 888B97DB17B83DE5000B5911 /* Frameworks */, + 888B97DC17B83DE5000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B97E417B83DE5000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-8 Registering a Routing AppTests"; + productName = "Recipe 7-8:Registering a Routing AppTests"; + productReference = 888B97DE17B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B97B517B83DE5000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B97BC17B83DE5000B5911 = { + SystemCapabilities = { + com.apple.iOS = { + enabled = 1; + }; + }; + }; + 888B97DD17B83DE5000B5911 = { + TestTargetID = 888B97BC17B83DE5000B5911; + }; + }; + }; + buildConfigurationList = 888B97B817B83DE5000B5911 /* Build configuration list for PBXProject "Recipe 7-8 Registering a Routing App" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B97B417B83DE5000B5911; + productRefGroup = 888B97BE17B83DE5000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B97BC17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App */, + 888B97DD17B83DE5000B5911 /* Recipe 7-8 Registering a Routing AppTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B97BB17B83DE5000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97D917B83DE5000B5911 /* Images.xcassets in Resources */, + 888B97CB17B83DE5000B5911 /* InfoPlist.strings in Resources */, + 888B97D417B83DE5000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B97DC17B83DE5000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97EA17B83DE5000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B97B917B83DE5000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97D717B83DE5000B5911 /* ViewController.m in Sources */, + 888B97D117B83DE5000B5911 /* AppDelegate.m in Sources */, + 888B97CD17B83DE5000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B97DA17B83DE5000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B97EC17B83DE5000B5911 /* Recipe_7_8_Registering_a_Routing_AppTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B97E417B83DE5000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B97BC17B83DE5000B5911 /* Recipe 7-8 Registering a Routing App */; + targetProxy = 888B97E317B83DE5000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B97C917B83DE5000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B97CA17B83DE5000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B97D217B83DE5000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B97D317B83DE5000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B97E817B83DE5000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B97E917B83DE5000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B97ED17B83DE5000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B97EE17B83DE5000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B97F017B83DE5000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-8:Registering a Routing App/Recipe 7-8 Registering a Routing App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-8:Registering a Routing App/Recipe 7-8 Registering a Routing App-Info.plist"; + PRODUCT_NAME = "Recipe 7-8 Registering a Routing App"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B97F117B83DE5000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-8:Registering a Routing App/Recipe 7-8 Registering a Routing App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-8:Registering a Routing App/Recipe 7-8 Registering a Routing App-Info.plist"; + PRODUCT_NAME = "Recipe 7-8 Registering a Routing App"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B97F317B83DE5000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-8:Registering a Routing App.app/Recipe 7-8:Registering a Routing App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-8:Registering a Routing App/Recipe 7-8:Registering a Routing App-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-8:Registering a Routing AppTests/Recipe 7-8 Registering a Routing AppTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-8 Registering a Routing AppTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B97F417B83DE5000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-8:Registering a Routing App.app/Recipe 7-8:Registering a Routing App"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-8:Registering a Routing App/Recipe 7-8:Registering a Routing App-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-8:Registering a Routing AppTests/Recipe 7-8 Registering a Routing AppTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-8 Registering a Routing AppTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B97B817B83DE5000B5911 /* Build configuration list for PBXProject "Recipe 7-8 Registering a Routing App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B97ED17B83DE5000B5911 /* Debug */, + 888B97EE17B83DE5000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B97EF17B83DE5000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-8 Registering a Routing App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B97F017B83DE5000B5911 /* Debug */, + 888B97F117B83DE5000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B97F217B83DE5000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-8 Registering a Routing AppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B97F317B83DE5000B5911 /* Debug */, + 888B97F417B83DE5000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B97B517B83DE5000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..44ccfa3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..e7c5b9e Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..e72ef69 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-8_Registering a Routing App.xcscheme b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-8_Registering a Routing App.xcscheme new file mode 100644 index 0000000..043e230 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-8_Registering a Routing App.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..4dbb17f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-8:Registering a Routing App.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B97BC17B83DE5000B5911 + + primary + + + 888B97DD17B83DE5000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/AppDelegate.h new file mode 100644 index 0000000..1867508 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/AppDelegate.h @@ -0,0 +1,19 @@ +// +// AppDelegate.h +// Recipe 7-8:Registering a Routing App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import "ViewController.h" + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property(strong,nonatomic) ViewController *viewController; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/AppDelegate.m new file mode 100644 index 0000000..6899438 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/AppDelegate.m @@ -0,0 +1,87 @@ +// +// AppDelegate.m +// Recipe 7-8:Registering a Routing App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + + + 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:. +} +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation +{ + if ([MKDirectionsRequest isDirectionsRequestURL:url]) + { + MKDirectionsRequest *request = [[MKDirectionsRequest alloc] + initWithContentsOfURL:url]; + + MKMapItem *source = [request source]; + MKMapItem *destination = [request destination]; + + NSString *sourceString; + NSString *destinationString; + + if (source.isCurrentLocation) + sourceString = @"Current Location"; + else + sourceString = [NSString stringWithFormat:@"%f, %f", + source.placemark.location.coordinate.latitude, + source.placemark.location.coordinate.longitude]; + + if (destination.isCurrentLocation) + sourceString = @"Current Location"; + else + destinationString = [NSString stringWithFormat:@"%f, %f", + destination.placemark.location.coordinate.latitude, + destination.placemark.location.coordinate.longitude]; + + self.viewController= (ViewController*)self.window.rootViewController; + self.viewController.routingLabel.text = [NSString stringWithFormat:@"Start at: %@\nStop at: %@", + sourceString, destinationString]; + + [self.viewController view]; + + return YES; + } + + return NO; +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Base.lproj/Main.storyboard new file mode 100644 index 0000000..80ad470 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Base.lproj/Main.storyboard @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/London.geojson b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/London.geojson new file mode 100644 index 0000000..741f8f8 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/London.geojson @@ -0,0 +1,12 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [[[52.257770, -0.989542], + [51.001232, -0.943830], + [51.050521, 0.303471], + [51.848169, 0.362244], + [52.257770, -0.989542]]] + + + ] +} diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App-Info.plist b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App-Info.plist new file mode 100644 index 0000000..47ac3e1 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App-Info.plist @@ -0,0 +1,55 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleDocumentTypes + + + CFBundleTypeName + MKDirectionsRequest + LSItemContentTypes + + com.apple.maps.directionsrequest + + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + MKDirectionsApplicationSupportedModes + + MKDirectionsModeOther + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App-Prefix.pch b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/Recipe 7-8 Registering a Routing App-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/ViewController.h b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/ViewController.h new file mode 100644 index 0000000..f2c50b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/ViewController.h @@ -0,0 +1,16 @@ +// +// ViewController.h +// Recipe 7-8:Registering a Routing App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *routingLabel; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/ViewController.m b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/ViewController.m new file mode 100644 index 0000000..e094b9b --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/ViewController.m @@ -0,0 +1,30 @@ +// +// ViewController.m +// Recipe 7-8:Registering a Routing App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/main.m b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/main.m new file mode 100644 index 0000000..51e29ae --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing App/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-8:Registering a Routing App +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/Recipe 7-8 Registering a Routing AppTests-Info.plist b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/Recipe 7-8 Registering a Routing AppTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/Recipe 7-8 Registering a Routing AppTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/Recipe_7_8_Registering_a_Routing_AppTests.m b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/Recipe_7_8_Registering_a_Routing_AppTests.m new file mode 100644 index 0000000..307ea2f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/Recipe_7_8_Registering_a_Routing_AppTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_8_Registering_a_Routing_AppTests.m +// Recipe 7-8:Registering a Routing AppTests +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_8_Registering_a_Routing_AppTests : XCTestCase + +@end + +@implementation Recipe_7_8_Registering_a_Routing_AppTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-8_Registering a Routing App/Recipe 7-8_Registering a Routing AppTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.pbxproj b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4e87222 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 888B980717B85879000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B980617B85879000B5911 /* Foundation.framework */; }; + 888B980917B85879000B5911 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B980817B85879000B5911 /* CoreGraphics.framework */; }; + 888B980B17B85879000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B980A17B85879000B5911 /* UIKit.framework */; }; + 888B981117B85879000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B980F17B85879000B5911 /* InfoPlist.strings */; }; + 888B981317B85879000B5911 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B981217B85879000B5911 /* main.m */; }; + 888B981717B85879000B5911 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B981617B85879000B5911 /* AppDelegate.m */; }; + 888B981A17B85879000B5911 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 888B981817B85879000B5911 /* Main.storyboard */; }; + 888B981D17B85879000B5911 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B981C17B85879000B5911 /* ViewController.m */; }; + 888B981F17B85879000B5911 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 888B981E17B85879000B5911 /* Images.xcassets */; }; + 888B982617B85879000B5911 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B982517B85879000B5911 /* XCTest.framework */; }; + 888B982717B85879000B5911 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B980617B85879000B5911 /* Foundation.framework */; }; + 888B982817B85879000B5911 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B980A17B85879000B5911 /* UIKit.framework */; }; + 888B983017B85879000B5911 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 888B982E17B85879000B5911 /* InfoPlist.strings */; }; + 888B983217B85879000B5911 /* Recipe_7_9_Getting_DirectionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 888B983117B85879000B5911 /* Recipe_7_9_Getting_DirectionsTests.m */; }; + 888B983C17B85885000B5911 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B983B17B85885000B5911 /* MapKit.framework */; }; + 888B983E17B8588F000B5911 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 888B983D17B8588F000B5911 /* CoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 888B982917B85879000B5911 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 888B97FB17B85879000B5911 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 888B980217B85879000B5911; + remoteInfo = "Recipe 7-9:Getting Directions"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 888B980317B85879000B5911 /* Recipe 7-9 Getting Directions.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 7-9 Getting Directions.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B980617B85879000B5911 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 888B980817B85879000B5911 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 888B980A17B85879000B5911 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 888B980E17B85879000B5911 /* Recipe 7-9 Getting Directions-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-9 Getting Directions-Info.plist"; sourceTree = ""; }; + 888B981017B85879000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B981217B85879000B5911 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 888B981417B85879000B5911 /* Recipe 7-9 Getting Directions-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 7-9 Getting Directions-Prefix.pch"; sourceTree = ""; }; + 888B981517B85879000B5911 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 888B981617B85879000B5911 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 888B981917B85879000B5911 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 888B981B17B85879000B5911 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 888B981C17B85879000B5911 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 888B981E17B85879000B5911 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 888B982417B85879000B5911 /* Recipe 7-9 Getting DirectionsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 7-9 Getting DirectionsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 888B982517B85879000B5911 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 888B982D17B85879000B5911 /* Recipe 7-9 Getting DirectionsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 7-9 Getting DirectionsTests-Info.plist"; sourceTree = ""; }; + 888B982F17B85879000B5911 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 888B983117B85879000B5911 /* Recipe_7_9_Getting_DirectionsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_7_9_Getting_DirectionsTests.m; sourceTree = ""; }; + 888B983B17B85885000B5911 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; + 888B983D17B8588F000B5911 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 888B980017B85879000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B983E17B8588F000B5911 /* CoreLocation.framework in Frameworks */, + 888B983C17B85885000B5911 /* MapKit.framework in Frameworks */, + 888B980917B85879000B5911 /* CoreGraphics.framework in Frameworks */, + 888B980B17B85879000B5911 /* UIKit.framework in Frameworks */, + 888B980717B85879000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B982117B85879000B5911 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B982617B85879000B5911 /* XCTest.framework in Frameworks */, + 888B982817B85879000B5911 /* UIKit.framework in Frameworks */, + 888B982717B85879000B5911 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 888B97FA17B85879000B5911 = { + isa = PBXGroup; + children = ( + 888B980C17B85879000B5911 /* Recipe 7-9 Getting Directions */, + 888B982B17B85879000B5911 /* Recipe 7-9 Getting DirectionsTests */, + 888B980517B85879000B5911 /* Frameworks */, + 888B980417B85879000B5911 /* Products */, + ); + sourceTree = ""; + }; + 888B980417B85879000B5911 /* Products */ = { + isa = PBXGroup; + children = ( + 888B980317B85879000B5911 /* Recipe 7-9 Getting Directions.app */, + 888B982417B85879000B5911 /* Recipe 7-9 Getting DirectionsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 888B980517B85879000B5911 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 888B983D17B8588F000B5911 /* CoreLocation.framework */, + 888B983B17B85885000B5911 /* MapKit.framework */, + 888B980617B85879000B5911 /* Foundation.framework */, + 888B980817B85879000B5911 /* CoreGraphics.framework */, + 888B980A17B85879000B5911 /* UIKit.framework */, + 888B982517B85879000B5911 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 888B980C17B85879000B5911 /* Recipe 7-9 Getting Directions */ = { + isa = PBXGroup; + children = ( + 888B981517B85879000B5911 /* AppDelegate.h */, + 888B981617B85879000B5911 /* AppDelegate.m */, + 888B981817B85879000B5911 /* Main.storyboard */, + 888B981B17B85879000B5911 /* ViewController.h */, + 888B981C17B85879000B5911 /* ViewController.m */, + 888B981E17B85879000B5911 /* Images.xcassets */, + 888B980D17B85879000B5911 /* Supporting Files */, + ); + name = "Recipe 7-9 Getting Directions"; + path = "Recipe 7-9:Getting Directions"; + sourceTree = ""; + }; + 888B980D17B85879000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B980E17B85879000B5911 /* Recipe 7-9 Getting Directions-Info.plist */, + 888B980F17B85879000B5911 /* InfoPlist.strings */, + 888B981217B85879000B5911 /* main.m */, + 888B981417B85879000B5911 /* Recipe 7-9 Getting Directions-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 888B982B17B85879000B5911 /* Recipe 7-9 Getting DirectionsTests */ = { + isa = PBXGroup; + children = ( + 888B983117B85879000B5911 /* Recipe_7_9_Getting_DirectionsTests.m */, + 888B982C17B85879000B5911 /* Supporting Files */, + ); + name = "Recipe 7-9 Getting DirectionsTests"; + path = "Recipe 7-9:Getting DirectionsTests"; + sourceTree = ""; + }; + 888B982C17B85879000B5911 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 888B982D17B85879000B5911 /* Recipe 7-9 Getting DirectionsTests-Info.plist */, + 888B982E17B85879000B5911 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 888B980217B85879000B5911 /* Recipe 7-9 Getting Directions */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B983517B85879000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-9 Getting Directions" */; + buildPhases = ( + 888B97FF17B85879000B5911 /* Sources */, + 888B980017B85879000B5911 /* Frameworks */, + 888B980117B85879000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 7-9 Getting Directions"; + productName = "Recipe 7-9:Getting Directions"; + productReference = 888B980317B85879000B5911 /* Recipe 7-9 Getting Directions.app */; + productType = "com.apple.product-type.application"; + }; + 888B982317B85879000B5911 /* Recipe 7-9 Getting DirectionsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 888B983817B85879000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-9 Getting DirectionsTests" */; + buildPhases = ( + 888B982017B85879000B5911 /* Sources */, + 888B982117B85879000B5911 /* Frameworks */, + 888B982217B85879000B5911 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 888B982A17B85879000B5911 /* PBXTargetDependency */, + ); + name = "Recipe 7-9 Getting DirectionsTests"; + productName = "Recipe 7-9:Getting DirectionsTests"; + productReference = 888B982417B85879000B5911 /* Recipe 7-9 Getting DirectionsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 888B97FB17B85879000B5911 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 888B982317B85879000B5911 = { + TestTargetID = 888B980217B85879000B5911; + }; + }; + }; + buildConfigurationList = 888B97FE17B85879000B5911 /* Build configuration list for PBXProject "Recipe 7-9 Getting Directions" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 888B97FA17B85879000B5911; + productRefGroup = 888B980417B85879000B5911 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 888B980217B85879000B5911 /* Recipe 7-9 Getting Directions */, + 888B982317B85879000B5911 /* Recipe 7-9 Getting DirectionsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 888B980117B85879000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B981F17B85879000B5911 /* Images.xcassets in Resources */, + 888B981117B85879000B5911 /* InfoPlist.strings in Resources */, + 888B981A17B85879000B5911 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B982217B85879000B5911 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B983017B85879000B5911 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 888B97FF17B85879000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B981D17B85879000B5911 /* ViewController.m in Sources */, + 888B981717B85879000B5911 /* AppDelegate.m in Sources */, + 888B981317B85879000B5911 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 888B982017B85879000B5911 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 888B983217B85879000B5911 /* Recipe_7_9_Getting_DirectionsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 888B982A17B85879000B5911 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 888B980217B85879000B5911 /* Recipe 7-9 Getting Directions */; + targetProxy = 888B982917B85879000B5911 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 888B980F17B85879000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B981017B85879000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 888B981817B85879000B5911 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 888B981917B85879000B5911 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 888B982E17B85879000B5911 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 888B982F17B85879000B5911 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 888B983317B85879000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 888B983417B85879000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 888B983617B85879000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-9:Getting Directions/Recipe 7-9 Getting Directions-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-9:Getting Directions/Recipe 7-9 Getting Directions-Info.plist"; + PRODUCT_NAME = "Recipe 7-9 Getting Directions"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 888B983717B85879000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-9:Getting Directions/Recipe 7-9 Getting Directions-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-9:Getting Directions/Recipe 7-9 Getting Directions-Info.plist"; + PRODUCT_NAME = "Recipe 7-9 Getting Directions"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 888B983917B85879000B5911 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-9:Getting Directions.app/Recipe 7-9:Getting Directions"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-9:Getting Directions/Recipe 7-9:Getting Directions-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 7-9:Getting DirectionsTests/Recipe 7-9 Getting DirectionsTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-9 Getting DirectionsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 888B983A17B85879000B5911 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 7-9:Getting Directions.app/Recipe 7-9:Getting Directions"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 7-9:Getting Directions/Recipe 7-9:Getting Directions-Prefix.pch"; + INFOPLIST_FILE = "Recipe 7-9:Getting DirectionsTests/Recipe 7-9 Getting DirectionsTests-Info.plist"; + PRODUCT_NAME = "Recipe 7-9 Getting DirectionsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 888B97FE17B85879000B5911 /* Build configuration list for PBXProject "Recipe 7-9 Getting Directions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B983317B85879000B5911 /* Debug */, + 888B983417B85879000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B983517B85879000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-9 Getting Directions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B983617B85879000B5911 /* Debug */, + 888B983717B85879000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 888B983817B85879000B5911 /* Build configuration list for PBXNativeTarget "Recipe 7-9 Getting DirectionsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 888B983917B85879000B5911 /* Debug */, + 888B983A17B85879000B5911 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 888B97FB17B85879000B5911 /* Project object */; +} diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..fe677ce --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..a59e56a Binary files /dev/null and b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..0fede79 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-9_Getting Directions.xcscheme b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-9_Getting Directions.xcscheme new file mode 100644 index 0000000..b72d9f7 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 7-9_Getting Directions.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..7c30dc4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 7-9:Getting Directions.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 888B980217B85879000B5911 + + primary + + + 888B982317B85879000B5911 + + primary + + + + + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/AppDelegate.h b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/AppDelegate.h new file mode 100644 index 0000000..e7b0623 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 7-9:Getting Directions +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/AppDelegate.m b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/AppDelegate.m new file mode 100644 index 0000000..f0f3ac0 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 7-9:Getting Directions +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Base.lproj/Main.storyboard b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8841023 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Images.xcassets/AppIcon.appiconset/Contents.json b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions-Info.plist b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions-Info.plist new file mode 100644 index 0000000..6879c68 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions-Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationUsageDescription + Testing Directions API + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions-Prefix.pch b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/Recipe 7-9 Getting Directions-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/ViewController.h b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/ViewController.h new file mode 100644 index 0000000..09cb9ca --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 7-9:Getting Directions +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet MKMapView *mapView; +@property (strong, nonatomic) MKDirectionsResponse *response; + +@end diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/ViewController.m b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/ViewController.m new file mode 100644 index 0000000..450ad57 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/ViewController.m @@ -0,0 +1,137 @@ +// +// ViewController.m +// Recipe 7-9:Getting Directions +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#define centerLat 39.6653 +#define centerLong -105.2058 +#define spanDeltaLat .5 +#define spanDeltaLong .5 + +#import "ViewController.h" + +@interface ViewController () + + + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.mapView.delegate = self; + + CLLocationCoordinate2D centerPoint = {centerLat, centerLong}; + MKCoordinateSpan coordinateSpan = MKCoordinateSpanMake(spanDeltaLat, spanDeltaLong); + MKCoordinateRegion coordinateRegion = + MKCoordinateRegionMake(centerPoint, coordinateSpan); + + [self.mapView setRegion:coordinateRegion]; + [self.mapView regionThatFits:coordinateRegion]; + + CLLocationCoordinate2D redRocksAmpitheater = CLLocationCoordinate2DMake(39.6653, -105.2058); + MKPlacemark *redRocksPlacemark = [[MKPlacemark alloc] initWithCoordinate:redRocksAmpitheater addressDictionary:nil]; + MKMapItem *redRocksItem = [[MKMapItem alloc] initWithPlacemark:redRocksPlacemark]; + redRocksItem.name = @"Big Ben"; + + CLLocationCoordinate2D sportsAuthorityField = CLLocationCoordinate2DMake(39.7439, -105.0200); + MKPlacemark *sportsAuthorityPlacemark = [[MKPlacemark alloc] initWithCoordinate:sportsAuthorityField addressDictionary:nil]; + MKMapItem *sportsAuthorityItem = [[MKMapItem alloc] initWithPlacemark:sportsAuthorityPlacemark]; + sportsAuthorityItem.name = @"Big Ben"; + + + [self findDirectionsFrom:redRocksItem to: sportsAuthorityItem]; + + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +-(void)findDirectionsFrom: (MKMapItem *)source to:(MKMapItem *)destination +{ + //Make request and provide it with source and destination MKMapItems + MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init]; + request.source = source; + request.destination = destination; + request.requestsAlternateRoutes = NO; + + MKDirections *directions = [[MKDirections alloc] initWithRequest:request]; + + + + + [directions calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse *response, NSError *error) { + if(error) + { + NSLog(@"Bummer, we got an error: %@",error); + + } + else + { + [self showDirectionsOnMap:response]; + + [directions calculateETAWithCompletionHandler:^(MKETAResponse *response, NSError *error) { + NSLog(@"You will arive in: %.1f Mins%@", response.expectedTravelTime/60.0,error); + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ETA!" + message:[NSString stringWithFormat:@"Estimated Time of Arrival in: %.1f Mins.",response.expectedTravelTime/60.0] + delegate:nil + cancelButtonTitle:@"Dismiss" + otherButtonTitles: nil]; + [alert show]; + }]; + + } + }]; + + + + + + + +} + +-(void)showDirectionsOnMap:(MKDirectionsResponse *)response +{ + self.response = response; + + for (MKRoute *route in self.response.routes) + { + [self.mapView addOverlay:route.polyline level:MKOverlayLevelAboveRoads]; + } + + [self.mapView addAnnotation:self.response.source.placemark]; + [self.mapView addAnnotation:self.response.destination.placemark]; + +} + +#pragma mark - delegates + +-(MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id )overlay +{ + + if([overlay isKindOfClass:[MKPolyline class]]) + { + MKPolylineRenderer *renderer = [[MKPolylineRenderer alloc] initWithOverlay:overlay]; + renderer.lineWidth = 3; + renderer.strokeColor = [UIColor blueColor]; + return renderer; + + } + else + { + return nil; + } +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/main.m b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/main.m new file mode 100644 index 0000000..c885c68 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting Directions/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 7-9:Getting Directions +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/Recipe 7-9 Getting DirectionsTests-Info.plist b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/Recipe 7-9 Getting DirectionsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/Recipe 7-9 Getting DirectionsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/Recipe_7_9_Getting_DirectionsTests.m b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/Recipe_7_9_Getting_DirectionsTests.m new file mode 100644 index 0000000..cdf8675 --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/Recipe_7_9_Getting_DirectionsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_7_9_Getting_DirectionsTests.m +// Recipe 7-9:Getting DirectionsTests +// +// Created by joseph hoffman on 8/11/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_7_9_Getting_DirectionsTests : XCTestCase + +@end + +@implementation Recipe_7_9_Getting_DirectionsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/en.lproj/InfoPlist.strings b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH7 - Map Recipes/Recipe 7-9_Getting Directions/Recipe 7-9_Getting DirectionsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew.xcodeproj/project.pbxproj b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew.xcodeproj/project.pbxproj new file mode 100644 index 0000000..caaf12a --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew.xcodeproj/project.pbxproj @@ -0,0 +1,482 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF862017BC942E003D7C86 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF861F17BC942E003D7C86 /* Social.framework */; }; + 88DB218E17BB36D00042E115 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88DB218D17BB36D00042E115 /* Foundation.framework */; }; + 88DB219017BB36D00042E115 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88DB218F17BB36D00042E115 /* CoreGraphics.framework */; }; + 88DB219217BB36D00042E115 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88DB219117BB36D00042E115 /* UIKit.framework */; }; + 88DB219817BB36D00042E115 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88DB219617BB36D00042E115 /* InfoPlist.strings */; }; + 88DB219A17BB36D00042E115 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DB219917BB36D00042E115 /* main.m */; }; + 88DB219E17BB36D00042E115 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DB219D17BB36D00042E115 /* AppDelegate.m */; }; + 88DB21A117BB36D00042E115 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88DB219F17BB36D00042E115 /* Main.storyboard */; }; + 88DB21A417BB36D00042E115 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DB21A317BB36D00042E115 /* ViewController.m */; }; + 88DB21A617BB36D00042E115 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88DB21A517BB36D00042E115 /* Images.xcassets */; }; + 88DB21AD17BB36D00042E115 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88DB21AC17BB36D00042E115 /* XCTest.framework */; }; + 88DB21AE17BB36D00042E115 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88DB218D17BB36D00042E115 /* Foundation.framework */; }; + 88DB21AF17BB36D00042E115 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88DB219117BB36D00042E115 /* UIKit.framework */; }; + 88DB21B717BB36D00042E115 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88DB21B517BB36D00042E115 /* InfoPlist.strings */; }; + 88DB21B917BB36D00042E115 /* Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DB21B817BB36D00042E115 /* Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m */; }; + 88DB21C417BC74360042E115 /* MyLogActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DB21C317BC74360042E115 /* MyLogActivity.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88DB21B017BB36D00042E115 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88DB218217BB36D00042E115 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88DB218917BB36D00042E115; + remoteInfo = "Recipe 8-1: Sharing content with the Activity VIew"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF861F17BC942E003D7C86 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; + 88DB218A17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 8-1 Sharing content with the Activity VIew.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88DB218D17BB36D00042E115 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88DB218F17BB36D00042E115 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88DB219117BB36D00042E115 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88DB219517BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 8-1 Sharing content with the Activity VIew-Info.plist"; sourceTree = ""; }; + 88DB219717BB36D00042E115 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88DB219917BB36D00042E115 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88DB219B17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch"; sourceTree = ""; }; + 88DB219C17BB36D00042E115 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88DB219D17BB36D00042E115 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88DB21A017BB36D00042E115 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88DB21A217BB36D00042E115 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88DB21A317BB36D00042E115 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88DB21A517BB36D00042E115 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88DB21AB17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 8-1 Sharing content with the Activity VIewTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88DB21AC17BB36D00042E115 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88DB21B417BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist"; sourceTree = ""; }; + 88DB21B617BB36D00042E115 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88DB21B817BB36D00042E115 /* Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m; sourceTree = ""; }; + 88DB21C217BC74360042E115 /* MyLogActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyLogActivity.h; sourceTree = ""; }; + 88DB21C317BC74360042E115 /* MyLogActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyLogActivity.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88DB218717BB36D00042E115 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF862017BC942E003D7C86 /* Social.framework in Frameworks */, + 88DB219017BB36D00042E115 /* CoreGraphics.framework in Frameworks */, + 88DB219217BB36D00042E115 /* UIKit.framework in Frameworks */, + 88DB218E17BB36D00042E115 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88DB21A817BB36D00042E115 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88DB21AD17BB36D00042E115 /* XCTest.framework in Frameworks */, + 88DB21AF17BB36D00042E115 /* UIKit.framework in Frameworks */, + 88DB21AE17BB36D00042E115 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88DB218117BB36D00042E115 = { + isa = PBXGroup; + children = ( + 88DB219317BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew */, + 88DB21B217BB36D00042E115 /* Recipe 8-1: Sharing content with the Activity VIewTests */, + 88DB218C17BB36D00042E115 /* Frameworks */, + 88DB218B17BB36D00042E115 /* Products */, + ); + sourceTree = ""; + }; + 88DB218B17BB36D00042E115 /* Products */ = { + isa = PBXGroup; + children = ( + 88DB218A17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew.app */, + 88DB21AB17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIewTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88DB218C17BB36D00042E115 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CF861F17BC942E003D7C86 /* Social.framework */, + 88DB218D17BB36D00042E115 /* Foundation.framework */, + 88DB218F17BB36D00042E115 /* CoreGraphics.framework */, + 88DB219117BB36D00042E115 /* UIKit.framework */, + 88DB21AC17BB36D00042E115 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88DB219317BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew */ = { + isa = PBXGroup; + children = ( + 88DB219C17BB36D00042E115 /* AppDelegate.h */, + 88DB219D17BB36D00042E115 /* AppDelegate.m */, + 88DB219F17BB36D00042E115 /* Main.storyboard */, + 88DB21A217BB36D00042E115 /* ViewController.h */, + 88DB21A317BB36D00042E115 /* ViewController.m */, + 88DB21C217BC74360042E115 /* MyLogActivity.h */, + 88DB21C317BC74360042E115 /* MyLogActivity.m */, + 88DB21A517BB36D00042E115 /* Images.xcassets */, + 88DB219417BB36D00042E115 /* Supporting Files */, + ); + name = "Recipe 8-1 Sharing content with the Activity VIew"; + path = "Recipe 8-1: Sharing content with the Activity VIew"; + sourceTree = ""; + }; + 88DB219417BB36D00042E115 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88DB219517BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew-Info.plist */, + 88DB219617BB36D00042E115 /* InfoPlist.strings */, + 88DB219917BB36D00042E115 /* main.m */, + 88DB219B17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88DB21B217BB36D00042E115 /* Recipe 8-1: Sharing content with the Activity VIewTests */ = { + isa = PBXGroup; + children = ( + 88DB21B817BB36D00042E115 /* Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m */, + 88DB21B317BB36D00042E115 /* Supporting Files */, + ); + path = "Recipe 8-1: Sharing content with the Activity VIewTests"; + sourceTree = ""; + }; + 88DB21B317BB36D00042E115 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88DB21B417BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist */, + 88DB21B517BB36D00042E115 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88DB218917BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88DB21BC17BB36D00042E115 /* Build configuration list for PBXNativeTarget "Recipe 8-1 Sharing content with the Activity VIew" */; + buildPhases = ( + 88DB218617BB36D00042E115 /* Sources */, + 88DB218717BB36D00042E115 /* Frameworks */, + 88DB218817BB36D00042E115 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 8-1 Sharing content with the Activity VIew"; + productName = "Recipe 8-1: Sharing content with the Activity VIew"; + productReference = 88DB218A17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew.app */; + productType = "com.apple.product-type.application"; + }; + 88DB21AA17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIewTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88DB21BF17BB36D00042E115 /* Build configuration list for PBXNativeTarget "Recipe 8-1 Sharing content with the Activity VIewTests" */; + buildPhases = ( + 88DB21A717BB36D00042E115 /* Sources */, + 88DB21A817BB36D00042E115 /* Frameworks */, + 88DB21A917BB36D00042E115 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88DB21B117BB36D00042E115 /* PBXTargetDependency */, + ); + name = "Recipe 8-1 Sharing content with the Activity VIewTests"; + productName = "Recipe 8-1: Sharing content with the Activity VIewTests"; + productReference = 88DB21AB17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIewTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88DB218217BB36D00042E115 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88DB21AA17BB36D00042E115 = { + TestTargetID = 88DB218917BB36D00042E115; + }; + }; + }; + buildConfigurationList = 88DB218517BB36D00042E115 /* Build configuration list for PBXProject "Recipe 8-1 Sharing content with the Activity VIew" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88DB218117BB36D00042E115; + productRefGroup = 88DB218B17BB36D00042E115 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88DB218917BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew */, + 88DB21AA17BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIewTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88DB218817BB36D00042E115 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88DB21A617BB36D00042E115 /* Images.xcassets in Resources */, + 88DB219817BB36D00042E115 /* InfoPlist.strings in Resources */, + 88DB21A117BB36D00042E115 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88DB21A917BB36D00042E115 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88DB21B717BB36D00042E115 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88DB218617BB36D00042E115 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88DB21A417BB36D00042E115 /* ViewController.m in Sources */, + 88DB219E17BB36D00042E115 /* AppDelegate.m in Sources */, + 88DB219A17BB36D00042E115 /* main.m in Sources */, + 88DB21C417BC74360042E115 /* MyLogActivity.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88DB21A717BB36D00042E115 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88DB21B917BB36D00042E115 /* Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88DB21B117BB36D00042E115 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88DB218917BB36D00042E115 /* Recipe 8-1 Sharing content with the Activity VIew */; + targetProxy = 88DB21B017BB36D00042E115 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88DB219617BB36D00042E115 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88DB219717BB36D00042E115 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88DB219F17BB36D00042E115 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88DB21A017BB36D00042E115 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88DB21B517BB36D00042E115 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88DB21B617BB36D00042E115 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88DB21BA17BB36D00042E115 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88DB21BB17BB36D00042E115 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88DB21BD17BB36D00042E115 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-1: Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-1: Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Info.plist"; + PRODUCT_NAME = "Recipe 8-1 Sharing content with the Activity VIew"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88DB21BE17BB36D00042E115 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-1: Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-1: Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Info.plist"; + PRODUCT_NAME = "Recipe 8-1 Sharing content with the Activity VIew"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88DB21C017BB36D00042E115 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 8-1: Sharing content with the Activity VIew.app/Recipe 8-1: Sharing content with the Activity VIew"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-1: Sharing content with the Activity VIew/Recipe 8-1: Sharing content with the Activity VIew-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 8-1: Sharing content with the Activity VIewTests/Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist"; + PRODUCT_NAME = "Recipe 8-1 Sharing content with the Activity VIewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88DB21C117BB36D00042E115 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 8-1: Sharing content with the Activity VIew.app/Recipe 8-1: Sharing content with the Activity VIew"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-1: Sharing content with the Activity VIew/Recipe 8-1: Sharing content with the Activity VIew-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-1: Sharing content with the Activity VIewTests/Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist"; + PRODUCT_NAME = "Recipe 8-1 Sharing content with the Activity VIewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88DB218517BB36D00042E115 /* Build configuration list for PBXProject "Recipe 8-1 Sharing content with the Activity VIew" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88DB21BA17BB36D00042E115 /* Debug */, + 88DB21BB17BB36D00042E115 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88DB21BC17BB36D00042E115 /* Build configuration list for PBXNativeTarget "Recipe 8-1 Sharing content with the Activity VIew" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88DB21BD17BB36D00042E115 /* Debug */, + 88DB21BE17BB36D00042E115 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88DB21BF17BB36D00042E115 /* Build configuration list for PBXNativeTarget "Recipe 8-1 Sharing content with the Activity VIewTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88DB21C017BB36D00042E115 /* Debug */, + 88DB21C117BB36D00042E115 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88DB218217BB36D00042E115 /* Project object */; +} diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3e0a712 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/AppDelegate.h b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/AppDelegate.h new file mode 100644 index 0000000..08d237a --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 8-1: Sharing content with the Activity VIew +// +// Created by joseph hoffman on 8/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/AppDelegate.m b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/AppDelegate.m new file mode 100644 index 0000000..fcc6342 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 8-1: Sharing content with the Activity VIew +// +// Created by joseph hoffman on 8/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Base.lproj/Main.storyboard b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Base.lproj/Main.storyboard new file mode 100644 index 0000000..65f00a6 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Base.lproj/Main.storyboard @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/AppIcon.appiconset/Contents.json b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/nscup.imageset/Contents.json b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/nscup.imageset/Contents.json new file mode 100644 index 0000000..dbd0796 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/nscup.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "nscup.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/nscup.imageset/nscup.png b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/nscup.imageset/nscup.png new file mode 100644 index 0000000..ec0f9b6 Binary files /dev/null and b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Images.xcassets/nscup.imageset/nscup.png differ diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/MyLogActivity.h b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/MyLogActivity.h new file mode 100644 index 0000000..da99b5b --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/MyLogActivity.h @@ -0,0 +1,15 @@ +// +// MyLogActivity.h +// Recipe 8-1: Sharing content with the Activity VIew +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface MyLogActivity : UIActivity + +@property (strong,nonatomic)NSString *logMessage; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/MyLogActivity.m b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/MyLogActivity.m new file mode 100644 index 0000000..d251438 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/MyLogActivity.m @@ -0,0 +1,61 @@ +// +// MyLogActivity.m +// Recipe 8-1: Sharing content with the Activity VIew +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MyLogActivity.h" + +@implementation MyLogActivity + + +-(NSString *)activityType +{ + return @"MyLogActivity"; +} + +-(NSString *)activityTitle +{ + return @"Log"; +} + +-(UIImage *)activityImage +{ + // Replace the file name with the one of the file you imported into your project + return [UIImage imageNamed:@"nscup.png"]; +} + +-(BOOL)canPerformWithActivityItems:(NSArray *)activityItems +{ + for (NSObject *item in activityItems) + { + if (![item isKindOfClass:[NSString class]] && ![item isKindOfClass:[NSURL class]]) + { + return NO; + } + } + return YES; +} + +-(void)prepareWithActivityItems:(NSArray *)activityItems +{ + self.logMessage = @""; + for (NSObject *item in activityItems) + { + self.logMessage = [NSString stringWithFormat:@"%@\n%@", + self.logMessage, item]; + } +} + +-(void)performActivity +{ + NSLog(@"%@", self.logMessage); + [self activityDidFinish:YES]; +} + + + + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Info.plist b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/Recipe 8-1 Sharing content with the Activity VIew-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/ViewController.h b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/ViewController.h new file mode 100644 index 0000000..8c2d653 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/ViewController.h @@ -0,0 +1,20 @@ +// +// ViewController.h +// Recipe 8-1: Sharing content with the Activity VIew +// +// Created by joseph hoffman on 8/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextView *messageTextView; +@property (weak, nonatomic) IBOutlet UITextField *urlTextField; + +- (IBAction)shareContent:(id)sender; +- (IBAction)shareOnFacebook:(id)sender; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/ViewController.m b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/ViewController.m new file mode 100644 index 0000000..4e63ead --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/ViewController.m @@ -0,0 +1,61 @@ +// +// ViewController.m +// Recipe 8-1: Sharing content with the Activity VIew +// +// Created by joseph hoffman on 8/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" +#import "MyLogActivity.h" + + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)shareContent:(id)sender { + + NSString *text = self.messageTextView.text; + NSURL *url = [NSURL URLWithString:self.urlTextField.text]; + NSArray *items = @[text, url]; + MyLogActivity *myLogService = [[MyLogActivity alloc] init]; + NSArray *customServices = @[myLogService]; + + + UIActivityViewController *vc = [[UIActivityViewController alloc] + initWithActivityItems:items applicationActivities:customServices]; + vc.excludedActivityTypes = @[UIActivityTypeMail, UIActivityTypeCopyToPasteboard]; + [self presentViewController:vc animated:YES completion:nil]; +} + +- (IBAction)shareOnFacebook:(id)sender { + NSString *text = self.messageTextView.text; + NSURL *url = [NSURL URLWithString:self.urlTextField.text]; + + SLComposeViewController *cv = + [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; + [cv setInitialText:text]; + [cv addURL:url]; + + [self presentViewController:cv animated:YES completion:nil]; +} + + + + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/en.lproj/InfoPlist.strings b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/main.m b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/main.m new file mode 100644 index 0000000..f96f286 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIew/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 8-1: Sharing content with the Activity VIew +// +// Created by joseph hoffman on 8/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/Recipe 8-1 Sharing content with the Activity VIewTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m new file mode 100644 index 0000000..7045066 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m @@ -0,0 +1,34 @@ +// +// Recipe_8_1__Sharing_content_with_the_Activity_VIewTests.m +// Recipe 8-1: Sharing content with the Activity VIewTests +// +// Created by joseph hoffman on 8/13/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_8_1__Sharing_content_with_the_Activity_VIewTests : XCTestCase + +@end + +@implementation Recipe_8_1__Sharing_content_with_the_Activity_VIewTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/en.lproj/InfoPlist.strings b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-1 to 8-2_ Sharing content with the Activity VIew/Recipe 8-1_ Sharing content with the Activity VIewTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.pbxproj b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ce01efd --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF862E17BC97F6003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF862D17BC97F6003D7C86 /* Foundation.framework */; }; + 88CF863017BC97F6003D7C86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF862F17BC97F6003D7C86 /* CoreGraphics.framework */; }; + 88CF863217BC97F6003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF863117BC97F6003D7C86 /* UIKit.framework */; }; + 88CF863817BC97F6003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF863617BC97F6003D7C86 /* InfoPlist.strings */; }; + 88CF863A17BC97F6003D7C86 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF863917BC97F6003D7C86 /* main.m */; }; + 88CF863E17BC97F6003D7C86 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF863D17BC97F6003D7C86 /* AppDelegate.m */; }; + 88CF864117BC97F6003D7C86 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CF863F17BC97F6003D7C86 /* Main.storyboard */; }; + 88CF864417BC97F6003D7C86 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF864317BC97F6003D7C86 /* ViewController.m */; }; + 88CF864617BC97F6003D7C86 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CF864517BC97F6003D7C86 /* Images.xcassets */; }; + 88CF864D17BC97F6003D7C86 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF864C17BC97F6003D7C86 /* XCTest.framework */; }; + 88CF864E17BC97F6003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF862D17BC97F6003D7C86 /* Foundation.framework */; }; + 88CF864F17BC97F6003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF863117BC97F6003D7C86 /* UIKit.framework */; }; + 88CF865717BC97F6003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF865517BC97F6003D7C86 /* InfoPlist.strings */; }; + 88CF865917BC97F6003D7C86 /* Recipe_8_3__Sharing_Content_Using_SLRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF865817BC97F6003D7C86 /* Recipe_8_3__Sharing_Content_Using_SLRequestTests.m */; }; + 88CF866317BC9849003D7C86 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF866217BC9849003D7C86 /* Social.framework */; }; + 88CF866517BC9856003D7C86 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF866417BC9855003D7C86 /* Accounts.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF865017BC97F6003D7C86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF862217BC97F6003D7C86 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF862917BC97F6003D7C86; + remoteInfo = "Recipe 8-3: Sharing Content Using SLRequest"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF862A17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 8-3 Sharing Content Using SLRequest.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF862D17BC97F6003D7C86 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF862F17BC97F6003D7C86 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF863117BC97F6003D7C86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF863517BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 8-3 Sharing Content Using SLRequest-Info.plist"; sourceTree = ""; }; + 88CF863717BC97F6003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF863917BC97F6003D7C86 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF863B17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch"; sourceTree = ""; }; + 88CF863C17BC97F6003D7C86 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CF863D17BC97F6003D7C86 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CF864017BC97F6003D7C86 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CF864217BC97F6003D7C86 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CF864317BC97F6003D7C86 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CF864517BC97F6003D7C86 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CF864B17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 8-3 Sharing Content Using SLRequestTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF864C17BC97F6003D7C86 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF865417BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist"; sourceTree = ""; }; + 88CF865617BC97F6003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF865817BC97F6003D7C86 /* Recipe_8_3__Sharing_Content_Using_SLRequestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_8_3__Sharing_Content_Using_SLRequestTests.m; sourceTree = ""; }; + 88CF866217BC9849003D7C86 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; + 88CF866417BC9855003D7C86 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF862717BC97F6003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF866517BC9856003D7C86 /* Accounts.framework in Frameworks */, + 88CF866317BC9849003D7C86 /* Social.framework in Frameworks */, + 88CF863017BC97F6003D7C86 /* CoreGraphics.framework in Frameworks */, + 88CF863217BC97F6003D7C86 /* UIKit.framework in Frameworks */, + 88CF862E17BC97F6003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF864817BC97F6003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF864D17BC97F6003D7C86 /* XCTest.framework in Frameworks */, + 88CF864F17BC97F6003D7C86 /* UIKit.framework in Frameworks */, + 88CF864E17BC97F6003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF862117BC97F6003D7C86 = { + isa = PBXGroup; + children = ( + 88CF863317BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest */, + 88CF865217BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests */, + 88CF862C17BC97F6003D7C86 /* Frameworks */, + 88CF862B17BC97F6003D7C86 /* Products */, + ); + sourceTree = ""; + }; + 88CF862B17BC97F6003D7C86 /* Products */ = { + isa = PBXGroup; + children = ( + 88CF862A17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest.app */, + 88CF864B17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF862C17BC97F6003D7C86 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CF866417BC9855003D7C86 /* Accounts.framework */, + 88CF866217BC9849003D7C86 /* Social.framework */, + 88CF862D17BC97F6003D7C86 /* Foundation.framework */, + 88CF862F17BC97F6003D7C86 /* CoreGraphics.framework */, + 88CF863117BC97F6003D7C86 /* UIKit.framework */, + 88CF864C17BC97F6003D7C86 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF863317BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest */ = { + isa = PBXGroup; + children = ( + 88CF863C17BC97F6003D7C86 /* AppDelegate.h */, + 88CF863D17BC97F6003D7C86 /* AppDelegate.m */, + 88CF863F17BC97F6003D7C86 /* Main.storyboard */, + 88CF864217BC97F6003D7C86 /* ViewController.h */, + 88CF864317BC97F6003D7C86 /* ViewController.m */, + 88CF864517BC97F6003D7C86 /* Images.xcassets */, + 88CF863417BC97F6003D7C86 /* Supporting Files */, + ); + name = "Recipe 8-3 Sharing Content Using SLRequest"; + path = "Recipe 8-3: Sharing Content Using SLRequest"; + sourceTree = ""; + }; + 88CF863417BC97F6003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF863517BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest-Info.plist */, + 88CF863617BC97F6003D7C86 /* InfoPlist.strings */, + 88CF863917BC97F6003D7C86 /* main.m */, + 88CF863B17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF865217BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests */ = { + isa = PBXGroup; + children = ( + 88CF865817BC97F6003D7C86 /* Recipe_8_3__Sharing_Content_Using_SLRequestTests.m */, + 88CF865317BC97F6003D7C86 /* Supporting Files */, + ); + name = "Recipe 8-3 Sharing Content Using SLRequestTests"; + path = "Recipe 8-3: Sharing Content Using SLRequestTests"; + sourceTree = ""; + }; + 88CF865317BC97F6003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF865417BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist */, + 88CF865517BC97F6003D7C86 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF862917BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF865C17BC97F6003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-3 Sharing Content Using SLRequest" */; + buildPhases = ( + 88CF862617BC97F6003D7C86 /* Sources */, + 88CF862717BC97F6003D7C86 /* Frameworks */, + 88CF862817BC97F6003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 8-3 Sharing Content Using SLRequest"; + productName = "Recipe 8-3: Sharing Content Using SLRequest"; + productReference = 88CF862A17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest.app */; + productType = "com.apple.product-type.application"; + }; + 88CF864A17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF865F17BC97F6003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-3 Sharing Content Using SLRequestTests" */; + buildPhases = ( + 88CF864717BC97F6003D7C86 /* Sources */, + 88CF864817BC97F6003D7C86 /* Frameworks */, + 88CF864917BC97F6003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF865117BC97F6003D7C86 /* PBXTargetDependency */, + ); + name = "Recipe 8-3 Sharing Content Using SLRequestTests"; + productName = "Recipe 8-3: Sharing Content Using SLRequestTests"; + productReference = 88CF864B17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF862217BC97F6003D7C86 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF864A17BC97F6003D7C86 = { + TestTargetID = 88CF862917BC97F6003D7C86; + }; + }; + }; + buildConfigurationList = 88CF862517BC97F6003D7C86 /* Build configuration list for PBXProject "Recipe 8-3 Sharing Content Using SLRequest" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CF862117BC97F6003D7C86; + productRefGroup = 88CF862B17BC97F6003D7C86 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF862917BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest */, + 88CF864A17BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequestTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF862817BC97F6003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF864617BC97F6003D7C86 /* Images.xcassets in Resources */, + 88CF863817BC97F6003D7C86 /* InfoPlist.strings in Resources */, + 88CF864117BC97F6003D7C86 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF864917BC97F6003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF865717BC97F6003D7C86 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF862617BC97F6003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF864417BC97F6003D7C86 /* ViewController.m in Sources */, + 88CF863E17BC97F6003D7C86 /* AppDelegate.m in Sources */, + 88CF863A17BC97F6003D7C86 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF864717BC97F6003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF865917BC97F6003D7C86 /* Recipe_8_3__Sharing_Content_Using_SLRequestTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF865117BC97F6003D7C86 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF862917BC97F6003D7C86 /* Recipe 8-3 Sharing Content Using SLRequest */; + targetProxy = 88CF865017BC97F6003D7C86 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF863617BC97F6003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF863717BC97F6003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF863F17BC97F6003D7C86 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CF864017BC97F6003D7C86 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CF865517BC97F6003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF865617BC97F6003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF865A17BC97F6003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF865B17BC97F6003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF865D17BC97F6003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-3: Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-3: Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Info.plist"; + PRODUCT_NAME = "Recipe 8-3 Sharing Content Using SLRequest"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF865E17BC97F6003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-3: Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-3: Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Info.plist"; + PRODUCT_NAME = "Recipe 8-3 Sharing Content Using SLRequest"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF866017BC97F6003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 8-3: Sharing Content Using SLRequest.app/Recipe 8-3: Sharing Content Using SLRequest"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-3: Sharing Content Using SLRequest/Recipe 8-3: Sharing Content Using SLRequest-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 8-3: Sharing Content Using SLRequestTests/Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist"; + PRODUCT_NAME = "Recipe 8-3 Sharing Content Using SLRequestTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF866117BC97F6003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 8-3: Sharing Content Using SLRequest.app/Recipe 8-3: Sharing Content Using SLRequest"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-3: Sharing Content Using SLRequest/Recipe 8-3: Sharing Content Using SLRequest-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-3: Sharing Content Using SLRequestTests/Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist"; + PRODUCT_NAME = "Recipe 8-3 Sharing Content Using SLRequestTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF862517BC97F6003D7C86 /* Build configuration list for PBXProject "Recipe 8-3 Sharing Content Using SLRequest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF865A17BC97F6003D7C86 /* Debug */, + 88CF865B17BC97F6003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF865C17BC97F6003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-3 Sharing Content Using SLRequest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF865D17BC97F6003D7C86 /* Debug */, + 88CF865E17BC97F6003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF865F17BC97F6003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-3 Sharing Content Using SLRequestTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF866017BC97F6003D7C86 /* Debug */, + 88CF866117BC97F6003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF862217BC97F6003D7C86 /* Project object */; +} diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..558c174 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..8f94031 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ec421e2 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 8-3 Sharing Content Using SLRequest.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CF862917BC97F6003D7C86 + + primary + + + 88CF864A17BC97F6003D7C86 + + primary + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/AppDelegate.h b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/AppDelegate.h new file mode 100644 index 0000000..b9941ba --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 8-3: Sharing Content Using SLRequest +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/AppDelegate.m b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/AppDelegate.m new file mode 100644 index 0000000..1854e34 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 8-3: Sharing Content Using SLRequest +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Base.lproj/Main.storyboard b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Base.lproj/Main.storyboard new file mode 100644 index 0000000..58eefd4 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Base.lproj/Main.storyboard @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Images.xcassets/AppIcon.appiconset/Contents.json b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Info.plist b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3 Sharing Content Using SLRequest-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/ViewController.h b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/ViewController.h new file mode 100644 index 0000000..b8eff94 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/ViewController.h @@ -0,0 +1,25 @@ +// +// ViewController.h +// Recipe 8-3: Sharing Content Using SLRequest +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController +{ +@private + NSArray *availableTwitterAccounts; +} + +@property (weak, nonatomic) IBOutlet UITextView *textView; +@property (weak, nonatomic) IBOutlet UILabel *statusLabel; +@property (strong,nonatomic) ACAccountStore *accountStore; + +- (IBAction)shareOnTwitter:(id)sender; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/ViewController.m b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/ViewController.m new file mode 100644 index 0000000..01f7f10 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/ViewController.m @@ -0,0 +1,137 @@ +// +// ViewController.m +// Recipe 8-3: Sharing Content Using SLRequest +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)shareOnTwitter:(id)sender +{ + self.accountStore = [[ACAccountStore alloc] init]; + + ACAccountType *accountType = + [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; + + [self.accountStore requestAccessToAccountsWithType:accountType options:nil + completion:^(BOOL granted, NSError *error) + { + __block NSString *statusText = @""; + + if (granted) + { + availableTwitterAccounts = [self.accountStore accountsWithAccountType:accountType]; + + if (availableTwitterAccounts.count == 0) + { + statusText = @"No Twitter accounts available"; + } + if (availableTwitterAccounts.count == 1) + { + ACAccount *account = [availableTwitterAccounts objectAtIndex:0]; + [self sendText:self.textView.text toTwitterAccount:account]; + } + else if (availableTwitterAccounts.count > 1) + { + dispatch_async(dispatch_get_main_queue(), ^(void) + { + UIAlertView *alert = + [[UIAlertView alloc] initWithTitle:@"Select Twitter Account" + message:@"Select the Twitter account you want to use." + delegate:self + cancelButtonTitle:@"Cancel" + otherButtonTitles:nil]; + + for (ACAccount *twitterAccount in availableTwitterAccounts) + { + [alert addButtonWithTitle:twitterAccount.accountDescription]; + } + + [alert show]; + }); + } + } + else + { + statusText = @"Access to Twitter accounts was not granted"; + } + + dispatch_async(dispatch_get_main_queue(), ^(void) + { + self.statusLabel.text = statusText; + }); + }]; +} + + +- (void)sendText:(NSString *)text toTwitterAccount:(ACAccount *)twitterAccount +{ + NSURL *requestURL = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/update.json"]; + SLRequest *tweetRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter + requestMethod:SLRequestMethodPOST URL:requestURL + parameters:[NSDictionary dictionaryWithObject:text forKey:@"status"]]; + + [tweetRequest setAccount:twitterAccount]; + + [tweetRequest performRequestWithHandler: + ^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) + { + __block NSString *status; + + if ([urlResponse statusCode] == 200) + { + status = [NSString stringWithFormat:@"Tweeted successfully to %@", + twitterAccount.accountDescription]; + } + else + { + status = @"Error occurred!"; + NSLog(@"%@", error); + } + + dispatch_async(dispatch_get_main_queue(), ^(void) + { + self.statusLabel.text = status; + }); + + }]; + + + +} + +-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex == 0) + { + // User Canceled + return; + } + + NSInteger indexInAvailableTwitterAccountsArray = buttonIndex - 1; + ACAccount *selectedAccount = [availableTwitterAccounts + objectAtIndex:indexInAvailableTwitterAccountsArray]; + [self sendText:self.textView.text toTwitterAccount:selectedAccount]; +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/en.lproj/InfoPlist.strings b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/main.m b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/main.m new file mode 100644 index 0000000..6b642f6 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequest/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 8-3: Sharing Content Using SLRequest +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/Recipe 8-3 Sharing Content Using SLRequestTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/Recipe_8_3__Sharing_Content_Using_SLRequestTests.m b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/Recipe_8_3__Sharing_Content_Using_SLRequestTests.m new file mode 100644 index 0000000..f9cb264 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/Recipe_8_3__Sharing_Content_Using_SLRequestTests.m @@ -0,0 +1,34 @@ +// +// Recipe_8_3__Sharing_Content_Using_SLRequestTests.m +// Recipe 8-3: Sharing Content Using SLRequestTests +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_8_3__Sharing_Content_Using_SLRequestTests : XCTestCase + +@end + +@implementation Recipe_8_3__Sharing_Content_Using_SLRequestTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/en.lproj/InfoPlist.strings b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-3_ Sharing Content Using SLRequest/Recipe 8-3_ Sharing Content Using SLRequestTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/MainTableViewController.h b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/MainTableViewController.h new file mode 100644 index 0000000..be3e816 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/MainTableViewController.h @@ -0,0 +1,17 @@ +// +// MainTableViewController.h +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface MainTableViewController : UITableViewController + +@property (strong, nonatomic) ACAccountStore *accountStore; +@property (strong, nonatomic) NSArray *twitterAccounts; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/MainTableViewController.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/MainTableViewController.m new file mode 100644 index 0000000..5f72e4d --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/MainTableViewController.m @@ -0,0 +1,151 @@ +// +// MainTableViewController.m +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "MainTableViewController.h" +#import "TwitterFeedCell.h" +#import "TweetTableViewController.h" + +@interface MainTableViewController () + +@end + +@implementation MainTableViewController + +- (id)initWithStyle:(UITableViewStyle)style +{ + self = [super initWithStyle:style]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + + [self.tableView registerClass:TwitterFeedCell.class forCellReuseIdentifier:TwitterFeedCellId]; + + self.navigationItem.title = @"My Twitter Reader"; + self.accountStore = [[ACAccountStore alloc] init]; + [self retrieveAccounts]; +} + +- (void)retrieveAccounts +{ + ACAccountType *accountType = + [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; + + [self.accountStore requestAccessToAccountsWithType:accountType options:nil + completion:^(BOOL granted, NSError *error) + { + if (granted) + { + self.twitterAccounts = [self.accountStore accountsWithAccountType:accountType]; + dispatch_async(dispatch_get_main_queue(), ^(void) + { + [self.tableView reloadData]; + }); + } + }]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + return self.twitterAccounts.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + TwitterFeedCell *cell = [tableView dequeueReusableCellWithIdentifier:TwitterFeedCellId forIndexPath:indexPath]; + // Configure the cell... + + cell.twitterAccount = [self.twitterAccounts objectAtIndex:indexPath.row]; + + + return cell; +} + +/* + // Override to support conditional editing of the table view. + - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath + { + // Return NO if you do not want the specified item to be editable. + return YES; + } + */ + +/* + // Override to support editing the table view. + - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath + { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } + else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } + } + */ + +/* + // Override to support rearranging the table view. + - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath + { + } + */ + +/* + // Override to support conditional rearranging of the table view. + - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath + { + // Return NO if you do not want the item to be re-orderable. + return YES; + } + */ + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Navigation logic may go here. Create and push another view controller. + ACAccount *account = nil; + + account = [self.twitterAccounts objectAtIndex:indexPath.row]; + + TweetTableViewController *detailViewController = [[TweetTableViewController alloc] initWithTwitterAccount:account]; + // ... + // Pass the selected object to the new view controller. + [self.navigationController pushViewController:detailViewController animated:YES]; +} + + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.pbxproj b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7376c60 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.pbxproj @@ -0,0 +1,496 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF867317BCA184003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF867217BCA184003D7C86 /* Foundation.framework */; }; + 88CF867517BCA184003D7C86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF867417BCA184003D7C86 /* CoreGraphics.framework */; }; + 88CF867717BCA184003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF867617BCA184003D7C86 /* UIKit.framework */; }; + 88CF867D17BCA184003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF867B17BCA184003D7C86 /* InfoPlist.strings */; }; + 88CF867F17BCA184003D7C86 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF867E17BCA184003D7C86 /* main.m */; }; + 88CF868317BCA184003D7C86 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF868217BCA184003D7C86 /* AppDelegate.m */; }; + 88CF868517BCA184003D7C86 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CF868417BCA184003D7C86 /* Images.xcassets */; }; + 88CF868C17BCA184003D7C86 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF868B17BCA184003D7C86 /* XCTest.framework */; }; + 88CF868D17BCA184003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF867217BCA184003D7C86 /* Foundation.framework */; }; + 88CF868E17BCA184003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF867617BCA184003D7C86 /* UIKit.framework */; }; + 88CF869617BCA184003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF869417BCA184003D7C86 /* InfoPlist.strings */; }; + 88CF869817BCA184003D7C86 /* Recipe_8_4__Retrieving_TweetsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF869717BCA184003D7C86 /* Recipe_8_4__Retrieving_TweetsTests.m */; }; + 88CF86A217BCA195003D7C86 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF86A117BCA195003D7C86 /* Social.framework */; }; + 88CF86A417BCA1A3003D7C86 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF86A317BCA1A3003D7C86 /* Accounts.framework */; }; + 88CF86A717BCA24A003D7C86 /* MainTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF86A617BCA24A003D7C86 /* MainTableViewController.m */; }; + 88CF86AA17BCA4F8003D7C86 /* TwitterFeedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF86A917BCA4F8003D7C86 /* TwitterFeedCell.m */; }; + 88CF86B017BCAA53003D7C86 /* TweetCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF86AF17BCAA53003D7C86 /* TweetCell.m */; }; + 88CF86B417BD5475003D7C86 /* TweetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF86B217BD5475003D7C86 /* TweetViewController.m */; }; + 88CF86B517BD5475003D7C86 /* TweetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88CF86B317BD5475003D7C86 /* TweetViewController.xib */; }; + 88CF86B817BD5614003D7C86 /* TweetTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF86B717BD5614003D7C86 /* TweetTableViewController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF868F17BCA184003D7C86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF866717BCA184003D7C86 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF866E17BCA184003D7C86; + remoteInfo = "Recipe 8-4: Retrieving Tweets"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF866F17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 8-4 Retrieving Tweets.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF867217BCA184003D7C86 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF867417BCA184003D7C86 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF867617BCA184003D7C86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF867A17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 8-4 Retrieving Tweets-Info.plist"; sourceTree = ""; }; + 88CF867C17BCA184003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF867E17BCA184003D7C86 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF868017BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 8-4 Retrieving Tweets-Prefix.pch"; sourceTree = ""; }; + 88CF868117BCA184003D7C86 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CF868217BCA184003D7C86 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CF868417BCA184003D7C86 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CF868A17BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 8-4 Retrieving TweetsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF868B17BCA184003D7C86 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF869317BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 8-4 Retrieving TweetsTests-Info.plist"; sourceTree = ""; }; + 88CF869517BCA184003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF869717BCA184003D7C86 /* Recipe_8_4__Retrieving_TweetsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_8_4__Retrieving_TweetsTests.m; sourceTree = ""; }; + 88CF86A117BCA195003D7C86 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; + 88CF86A317BCA1A3003D7C86 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; }; + 88CF86A517BCA24A003D7C86 /* MainTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MainTableViewController.h; path = ../MainTableViewController.h; sourceTree = ""; }; + 88CF86A617BCA24A003D7C86 /* MainTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MainTableViewController.m; path = ../MainTableViewController.m; sourceTree = ""; }; + 88CF86A817BCA4F8003D7C86 /* TwitterFeedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwitterFeedCell.h; sourceTree = ""; }; + 88CF86A917BCA4F8003D7C86 /* TwitterFeedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TwitterFeedCell.m; sourceTree = ""; }; + 88CF86AE17BCAA53003D7C86 /* TweetCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweetCell.h; sourceTree = ""; }; + 88CF86AF17BCAA53003D7C86 /* TweetCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweetCell.m; sourceTree = ""; }; + 88CF86B117BD5475003D7C86 /* TweetViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweetViewController.h; sourceTree = ""; }; + 88CF86B217BD5475003D7C86 /* TweetViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweetViewController.m; sourceTree = ""; }; + 88CF86B317BD5475003D7C86 /* TweetViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TweetViewController.xib; sourceTree = ""; }; + 88CF86B617BD5614003D7C86 /* TweetTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweetTableViewController.h; sourceTree = ""; }; + 88CF86B717BD5614003D7C86 /* TweetTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweetTableViewController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF866C17BCA184003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF86A417BCA1A3003D7C86 /* Accounts.framework in Frameworks */, + 88CF86A217BCA195003D7C86 /* Social.framework in Frameworks */, + 88CF867517BCA184003D7C86 /* CoreGraphics.framework in Frameworks */, + 88CF867717BCA184003D7C86 /* UIKit.framework in Frameworks */, + 88CF867317BCA184003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF868717BCA184003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF868C17BCA184003D7C86 /* XCTest.framework in Frameworks */, + 88CF868E17BCA184003D7C86 /* UIKit.framework in Frameworks */, + 88CF868D17BCA184003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF866617BCA184003D7C86 = { + isa = PBXGroup; + children = ( + 88CF867817BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets */, + 88CF869117BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests */, + 88CF867117BCA184003D7C86 /* Frameworks */, + 88CF867017BCA184003D7C86 /* Products */, + ); + sourceTree = ""; + }; + 88CF867017BCA184003D7C86 /* Products */ = { + isa = PBXGroup; + children = ( + 88CF866F17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets.app */, + 88CF868A17BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF867117BCA184003D7C86 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CF86A317BCA1A3003D7C86 /* Accounts.framework */, + 88CF86A117BCA195003D7C86 /* Social.framework */, + 88CF867217BCA184003D7C86 /* Foundation.framework */, + 88CF867417BCA184003D7C86 /* CoreGraphics.framework */, + 88CF867617BCA184003D7C86 /* UIKit.framework */, + 88CF868B17BCA184003D7C86 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF867817BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets */ = { + isa = PBXGroup; + children = ( + 88CF868117BCA184003D7C86 /* AppDelegate.h */, + 88CF868217BCA184003D7C86 /* AppDelegate.m */, + 88CF86A517BCA24A003D7C86 /* MainTableViewController.h */, + 88CF86A617BCA24A003D7C86 /* MainTableViewController.m */, + 88CF86B617BD5614003D7C86 /* TweetTableViewController.h */, + 88CF86B717BD5614003D7C86 /* TweetTableViewController.m */, + 88CF86AE17BCAA53003D7C86 /* TweetCell.h */, + 88CF86AF17BCAA53003D7C86 /* TweetCell.m */, + 88CF86B117BD5475003D7C86 /* TweetViewController.h */, + 88CF86B217BD5475003D7C86 /* TweetViewController.m */, + 88CF86B317BD5475003D7C86 /* TweetViewController.xib */, + 88CF86A817BCA4F8003D7C86 /* TwitterFeedCell.h */, + 88CF86A917BCA4F8003D7C86 /* TwitterFeedCell.m */, + 88CF868417BCA184003D7C86 /* Images.xcassets */, + 88CF867917BCA184003D7C86 /* Supporting Files */, + ); + name = "Recipe 8-4 Retrieving Tweets"; + path = "Recipe 8-4: Retrieving Tweets"; + sourceTree = ""; + }; + 88CF867917BCA184003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF867A17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets-Info.plist */, + 88CF867B17BCA184003D7C86 /* InfoPlist.strings */, + 88CF867E17BCA184003D7C86 /* main.m */, + 88CF868017BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF869117BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests */ = { + isa = PBXGroup; + children = ( + 88CF869717BCA184003D7C86 /* Recipe_8_4__Retrieving_TweetsTests.m */, + 88CF869217BCA184003D7C86 /* Supporting Files */, + ); + name = "Recipe 8-4 Retrieving TweetsTests"; + path = "Recipe 8-4: Retrieving TweetsTests"; + sourceTree = ""; + }; + 88CF869217BCA184003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF869317BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests-Info.plist */, + 88CF869417BCA184003D7C86 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF866E17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF869B17BCA184003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-4 Retrieving Tweets" */; + buildPhases = ( + 88CF866B17BCA184003D7C86 /* Sources */, + 88CF866C17BCA184003D7C86 /* Frameworks */, + 88CF866D17BCA184003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 8-4 Retrieving Tweets"; + productName = "Recipe 8-4: Retrieving Tweets"; + productReference = 88CF866F17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets.app */; + productType = "com.apple.product-type.application"; + }; + 88CF868917BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF869E17BCA184003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-4 Retrieving TweetsTests" */; + buildPhases = ( + 88CF868617BCA184003D7C86 /* Sources */, + 88CF868717BCA184003D7C86 /* Frameworks */, + 88CF868817BCA184003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF869017BCA184003D7C86 /* PBXTargetDependency */, + ); + name = "Recipe 8-4 Retrieving TweetsTests"; + productName = "Recipe 8-4: Retrieving TweetsTests"; + productReference = 88CF868A17BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF866717BCA184003D7C86 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF868917BCA184003D7C86 = { + TestTargetID = 88CF866E17BCA184003D7C86; + }; + }; + }; + buildConfigurationList = 88CF866A17BCA184003D7C86 /* Build configuration list for PBXProject "Recipe 8-4 Retrieving Tweets" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 88CF866617BCA184003D7C86; + productRefGroup = 88CF867017BCA184003D7C86 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF866E17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets */, + 88CF868917BCA184003D7C86 /* Recipe 8-4 Retrieving TweetsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF866D17BCA184003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF867D17BCA184003D7C86 /* InfoPlist.strings in Resources */, + 88CF868517BCA184003D7C86 /* Images.xcassets in Resources */, + 88CF86B517BD5475003D7C86 /* TweetViewController.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF868817BCA184003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF869617BCA184003D7C86 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF866B17BCA184003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF86B817BD5614003D7C86 /* TweetTableViewController.m in Sources */, + 88CF86B417BD5475003D7C86 /* TweetViewController.m in Sources */, + 88CF868317BCA184003D7C86 /* AppDelegate.m in Sources */, + 88CF867F17BCA184003D7C86 /* main.m in Sources */, + 88CF86B017BCAA53003D7C86 /* TweetCell.m in Sources */, + 88CF86A717BCA24A003D7C86 /* MainTableViewController.m in Sources */, + 88CF86AA17BCA4F8003D7C86 /* TwitterFeedCell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF868617BCA184003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF869817BCA184003D7C86 /* Recipe_8_4__Retrieving_TweetsTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF869017BCA184003D7C86 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF866E17BCA184003D7C86 /* Recipe 8-4 Retrieving Tweets */; + targetProxy = 88CF868F17BCA184003D7C86 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF867B17BCA184003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF867C17BCA184003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF869417BCA184003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF869517BCA184003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF869917BCA184003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF869A17BCA184003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF869C17BCA184003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-4: Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-4: Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Info.plist"; + PRODUCT_NAME = "Recipe 8-4 Retrieving Tweets"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF869D17BCA184003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-4: Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-4: Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Info.plist"; + PRODUCT_NAME = "Recipe 8-4 Retrieving Tweets"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF869F17BCA184003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 8-4: Retrieving Tweets.app/Recipe 8-4: Retrieving Tweets"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-4: Retrieving Tweets/Recipe 8-4: Retrieving Tweets-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 8-4: Retrieving TweetsTests/Recipe 8-4 Retrieving TweetsTests-Info.plist"; + PRODUCT_NAME = "Recipe 8-4 Retrieving TweetsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF86A017BCA184003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 8-4: Retrieving Tweets.app/Recipe 8-4: Retrieving Tweets"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 8-4: Retrieving Tweets/Recipe 8-4: Retrieving Tweets-Prefix.pch"; + INFOPLIST_FILE = "Recipe 8-4: Retrieving TweetsTests/Recipe 8-4 Retrieving TweetsTests-Info.plist"; + PRODUCT_NAME = "Recipe 8-4 Retrieving TweetsTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF866A17BCA184003D7C86 /* Build configuration list for PBXProject "Recipe 8-4 Retrieving Tweets" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF869917BCA184003D7C86 /* Debug */, + 88CF869A17BCA184003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF869B17BCA184003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-4 Retrieving Tweets" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF869C17BCA184003D7C86 /* Debug */, + 88CF869D17BCA184003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF869E17BCA184003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 8-4 Retrieving TweetsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF869F17BCA184003D7C86 /* Debug */, + 88CF86A017BCA184003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF866717BCA184003D7C86 /* Project object */; +} diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6257486 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..a1cf7e7 Binary files /dev/null and b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..282c383 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 8-4 Retrieving Tweets.xcscheme b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 8-4 Retrieving Tweets.xcscheme new file mode 100644 index 0000000..81fe3f2 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 8-4 Retrieving Tweets.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..2357e2c --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 8-4 Retrieving Tweets.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CF866E17BCA184003D7C86 + + primary + + + 88CF868917BCA184003D7C86 + + primary + + + + + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/.DS_Store b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/.DS_Store differ diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/AppDelegate.h b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/AppDelegate.h new file mode 100644 index 0000000..7f639d1 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/AppDelegate.h @@ -0,0 +1,16 @@ +// +// AppDelegate.h +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; +@property (strong, nonatomic) UINavigationController *navigationController; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/AppDelegate.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/AppDelegate.m new file mode 100644 index 0000000..9d155d0 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/AppDelegate.m @@ -0,0 +1,54 @@ +// +// AppDelegate.m +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" +#import "MainTableViewController.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + + UITableViewController *mainViewController = [[MainTableViewController alloc] initWithStyle:UITableViewStyleGrouped]; + self.navigationController = + [[UINavigationController alloc] initWithRootViewController:mainViewController]; + self.window.rootViewController = self.navigationController; + self.window.backgroundColor = [UIColor whiteColor]; + [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/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Images.xcassets/AppIcon.appiconset/Contents.json b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Info.plist b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Info.plist new file mode 100644 index 0000000..6c23e04 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${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/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Prefix.pch b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Prefix.pch new file mode 100644 index 0000000..743435c --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/Recipe 8-4 Retrieving Tweets-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetCell.h b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetCell.h new file mode 100644 index 0000000..0fb5bfc --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetCell.h @@ -0,0 +1,17 @@ +// +// TweetCell.h +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +extern NSString * const TweetCellId; + +@interface TweetCell : UITableViewCell + +@property (strong, nonatomic)NSDictionary *tweetData; + +@end \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetCell.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetCell.m new file mode 100644 index 0000000..f08e919 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetCell.m @@ -0,0 +1,46 @@ +// +// TweetCell.m +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "TweetCell.h" + +@implementation TweetCell + +NSString * const TweetCellId = @"TweetCell"; + +-(void)setTweetData:(NSDictionary *)tweetData +{ + _tweetData = tweetData; + [self updateCell]; +} + +-(void)updateCell +{ + NSDictionary *userData = [self.tweetData objectForKey:@"user"]; + self.textLabel.text = [userData objectForKey:@"name"]; + self.detailTextLabel.text = [self.tweetData objectForKey:@"text"]; +} + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetTableViewController.h b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetTableViewController.h new file mode 100644 index 0000000..358fa3e --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetTableViewController.h @@ -0,0 +1,20 @@ +// +// RecentTweetsTableViewController.h +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface TweetTableViewController : UITableViewController + +@property (strong, nonatomic) ACAccount *twitterAccount; +@property (strong, nonatomic) NSMutableArray *tweets; + +-(id)initWithTwitterAccount:(ACAccount *)account; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetTableViewController.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetTableViewController.m new file mode 100644 index 0000000..6a6aa6d --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetTableViewController.m @@ -0,0 +1,177 @@ +// +// RecentTweetsTableViewController.m +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "TweetTableViewController.h" +#import "TweetViewController.h" +#import "TweetCell.h" + +@interface TweetTableViewController () + +@end + +@implementation TweetTableViewController + +- (id)initWithStyle:(UITableViewStyle)style +{ + self = [super initWithStyle:style]; + if (self) { + // Custom initialization + self.tweets = [[NSMutableArray alloc] initWithCapacity:50]; + } + return self; +} + +-(id)initWithTwitterAccount:(ACAccount *)account +{ + self = [self initWithStyle:UITableViewStylePlain]; + if (self) { + self.twitterAccount = account; + } + return self; +} + +-(void)retrieveTweets +{ + [self.tweets removeAllObjects]; + + SLRequest *request; + + if (self.twitterAccount) + { + NSURL *requestURL = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/home_timeline.json"]; + request = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:requestURL parameters:nil]; + [request setAccount:self.twitterAccount]; + } + else + { + NSURL *requestURL = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/public_timeline.json"]; + request = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:requestURL parameters:nil]; + } + + [request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) + { + if ([urlResponse statusCode] == 200) + { + NSError *jsonParsingError; + self.tweets = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&jsonParsingError]; + } + else + { + NSLog(@"HTTP response status: %i\n", [urlResponse statusCode]); + } + dispatch_async(dispatch_get_main_queue(), ^(void) + { + [self.tableView reloadData]; + }); + }]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + + [self.tableView registerClass:TweetCell.class forCellReuseIdentifier:TweetCellId]; + + if (self.twitterAccount) + { + self.navigationItem.title = self.twitterAccount.accountDescription; + } + else + { + self.navigationItem.title = @"Public Tweets"; + } + [self retrieveTweets]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + return self.tweets.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + TweetCell *cell = [tableView dequeueReusableCellWithIdentifier:TweetCellId forIndexPath:indexPath]; + // Configure the cell... + cell.tweetData = [self.tweets objectAtIndex:indexPath.row]; + + return cell; +} + +/* + // Override to support conditional editing of the table view. + - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath + { + // Return NO if you do not want the specified item to be editable. + return YES; + } + */ + +/* + // Override to support editing the table view. + - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath + { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } + else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } + } + */ + +/* + // Override to support rearranging the table view. + - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath + { + } + */ + +/* + // Override to support conditional rearranging of the table view. + - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath + { + // Return NO if you do not want the item to be re-orderable. + return YES; + } + */ + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Navigation logic may go here. Create and push another view controller. + NSDictionary *tweetData = [self.tweets objectAtIndex:indexPath.row]; + TweetViewController *detailViewController = [[TweetViewController alloc] initWithTweetData:tweetData]; + // ... + // Pass the selected object to the new view controller. + [self.navigationController pushViewController:detailViewController animated:YES]; +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.h b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.h new file mode 100644 index 0000000..468d15f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.h @@ -0,0 +1,24 @@ +// +// TweetViewController.h +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface TweetViewController : UIViewController +@property (weak, nonatomic) IBOutlet UIImageView *userImageView; +@property (weak, nonatomic) IBOutlet UILabel *userNameLabel; +@property (weak, nonatomic) IBOutlet UILabel *userScreenNameLabel; +@property (weak, nonatomic) IBOutlet UILabel *userDescriptionLabel; +@property (weak, nonatomic) IBOutlet UITextView *tweetTextView; +@property (weak, nonatomic) IBOutlet UILabel *retweetCountLabel; + +@property (strong, nonatomic) NSDictionary *tweetData; + +-(id)initWithTweetData:(NSDictionary *)tweetData; + +@end + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.m new file mode 100644 index 0000000..64c6846 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.m @@ -0,0 +1,65 @@ +// +// TweetViewController.m +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/15/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "TweetViewController.h" + +@interface TweetViewController () + +@end + +@implementation TweetViewController + +-(id)initWithTweetData:(NSDictionary *)tweetData +{ + self = [super initWithNibName:nil bundle:nil]; + if (self) { + _tweetData = tweetData; + } + return self; +} + +-(void)setTweetData:(NSDictionary *)tweetData +{ + _tweetData = tweetData; + [self updateView]; +} + +-(void)updateView +{ + NSDictionary *userData = [self.tweetData objectForKey:@"user"]; + + NSLog(@"Data For User: %@", userData); + + NSString *imageURLString = [userData objectForKey:@"profile_image_url"]; + NSURL *imageURL = [NSURL URLWithString:imageURLString]; + NSData *imageData = [NSData dataWithContentsOfURL:imageURL]; + self.userImageView.image = [UIImage imageWithData:imageData]; + + self.userNameLabel.text = [userData objectForKey:@"name"]; + self.userScreenNameLabel.text = [userData objectForKey:@"screen_name"]; + self.userDescriptionLabel.text = [userData objectForKey:@"description"]; + + self.tweetTextView.text = [self.tweetData objectForKey:@"text"]; + self.retweetCountLabel.text = [NSString stringWithFormat:@"Retweet Count: %@", [self.tweetData objectForKey:@"retweet_count"]]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + self.navigationItem.title = @"Tweet"; + [self updateView]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.xib b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.xib new file mode 100644 index 0000000..02af4f2 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TweetViewController.xib @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + \ No newline at end of file diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TwitterFeedCell.h b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TwitterFeedCell.h new file mode 100644 index 0000000..43439d1 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TwitterFeedCell.h @@ -0,0 +1,18 @@ +// +// TwitterFeedCell.h +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +extern NSString * const TwitterFeedCellId; + +@interface TwitterFeedCell : UITableViewCell + +@property (strong, nonatomic)ACAccount *twitterAccount; + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TwitterFeedCell.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TwitterFeedCell.m new file mode 100644 index 0000000..54bdce0 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/TwitterFeedCell.m @@ -0,0 +1,45 @@ +// +// TwitterFeedCell.m +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "TwitterFeedCell.h" + +NSString * const TwitterFeedCellId = @"TwitterFeedCell"; + +@implementation TwitterFeedCell + +- (void)setTwitterAccount:(ACAccount *)account +{ + _twitterAccount = account; + if (_twitterAccount) + { + self.textLabel.text = _twitterAccount.accountDescription; + } + else + { + NSLog(@"No Twitter Account Given!"); + } +} + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Initialization code + self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/en.lproj/InfoPlist.strings b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/main.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/main.m new file mode 100644 index 0000000..43d401f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving Tweets/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 8-4: Retrieving Tweets +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/Recipe 8-4 Retrieving TweetsTests-Info.plist b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/Recipe 8-4 Retrieving TweetsTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/Recipe 8-4 Retrieving TweetsTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/Recipe_8_4__Retrieving_TweetsTests.m b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/Recipe_8_4__Retrieving_TweetsTests.m new file mode 100644 index 0000000..5e18847 --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/Recipe_8_4__Retrieving_TweetsTests.m @@ -0,0 +1,34 @@ +// +// Recipe_8_4__Retrieving_TweetsTests.m +// Recipe 8-4: Retrieving TweetsTests +// +// Created by joseph hoffman on 8/14/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_8_4__Retrieving_TweetsTests : XCTestCase + +@end + +@implementation Recipe_8_4__Retrieving_TweetsTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/en.lproj/InfoPlist.strings b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH8 - Social Network Recipes/Recipe 8-4_ Retrieving Tweets/Recipe 8-4_ Retrieving TweetsTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6404244 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */; }; + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF871317C59DBF003D7C86 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871217C59DBF003D7C86 /* main.m */; }; + 88CF871717C59DBF003D7C86 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871617C59DBF003D7C86 /* AppDelegate.m */; }; + 88CF871A17C59DBF003D7C86 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CF871817C59DBF003D7C86 /* Main.storyboard */; }; + 88CF871D17C59DBF003D7C86 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871C17C59DBF003D7C86 /* ViewController.m */; }; + 88CF871F17C59DBF003D7C86 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CF871E17C59DBF003D7C86 /* Images.xcassets */; }; + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF872517C59DBF003D7C86 /* XCTest.framework */; }; + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF86FB17C59DBF003D7C86 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF870217C59DBF003D7C86; + remoteInfo = "Recipe 9-1: Taking Pictures"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF870317C59DBF003D7C86 /* Recipe 9-1: Taking Pictures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-1: Taking Pictures.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF870617C59DBF003D7C86 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF870A17C59DBF003D7C86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF870E17C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-1: Taking Pictures-Info.plist"; sourceTree = ""; }; + 88CF871017C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF871217C59DBF003D7C86 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF871417C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-1: Taking Pictures-Prefix.pch"; sourceTree = ""; }; + 88CF871517C59DBF003D7C86 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CF871617C59DBF003D7C86 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CF871917C59DBF003D7C86 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CF871B17C59DBF003D7C86 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CF871C17C59DBF003D7C86 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CF871E17C59DBF003D7C86 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CF872417C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-1: Taking PicturesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF872517C59DBF003D7C86 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF872D17C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-1: Taking PicturesTests-Info.plist"; sourceTree = ""; }; + 88CF872F17C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_1__Taking_PicturesTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF870017C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */, + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872117C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */, + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF86FA17C59DBF003D7C86 = { + isa = PBXGroup; + children = ( + 88CF870C17C59DBF003D7C86 /* Recipe 9-1 Taking Pictures */, + 88CF872B17C59DBF003D7C86 /* Recipe 9-1 Taking PicturesTests */, + 88CF870517C59DBF003D7C86 /* Frameworks */, + 88CF870417C59DBF003D7C86 /* Products */, + ); + sourceTree = ""; + }; + 88CF870417C59DBF003D7C86 /* Products */ = { + isa = PBXGroup; + children = ( + 88CF870317C59DBF003D7C86 /* Recipe 9-1: Taking Pictures.app */, + 88CF872417C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF870517C59DBF003D7C86 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88CF870617C59DBF003D7C86 /* Foundation.framework */, + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */, + 88CF870A17C59DBF003D7C86 /* UIKit.framework */, + 88CF872517C59DBF003D7C86 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF870C17C59DBF003D7C86 /* Recipe 9-1 Taking Pictures */ = { + isa = PBXGroup; + children = ( + 88CF871517C59DBF003D7C86 /* AppDelegate.h */, + 88CF871617C59DBF003D7C86 /* AppDelegate.m */, + 88CF871817C59DBF003D7C86 /* Main.storyboard */, + 88CF871B17C59DBF003D7C86 /* ViewController.h */, + 88CF871C17C59DBF003D7C86 /* ViewController.m */, + 88CF871E17C59DBF003D7C86 /* Images.xcassets */, + 88CF870D17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-1 Taking Pictures"; + path = "Recipe 9-1: Taking Pictures"; + sourceTree = ""; + }; + 88CF870D17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF870E17C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Info.plist */, + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */, + 88CF871217C59DBF003D7C86 /* main.m */, + 88CF871417C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF872B17C59DBF003D7C86 /* Recipe 9-1 Taking PicturesTests */ = { + isa = PBXGroup; + children = ( + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */, + 88CF872C17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-1 Taking PicturesTests"; + path = "Recipe 9-1: Taking PicturesTests"; + sourceTree = ""; + }; + 88CF872C17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF872D17C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests-Info.plist */, + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF870217C59DBF003D7C86 /* Recipe 9-1: Taking Pictures */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-1: Taking Pictures" */; + buildPhases = ( + 88CF86FF17C59DBF003D7C86 /* Sources */, + 88CF870017C59DBF003D7C86 /* Frameworks */, + 88CF870117C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-1: Taking Pictures"; + productName = "Recipe 9-1: Taking Pictures"; + productReference = 88CF870317C59DBF003D7C86 /* Recipe 9-1: Taking Pictures.app */; + productType = "com.apple.product-type.application"; + }; + 88CF872317C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-1: Taking PicturesTests" */; + buildPhases = ( + 88CF872017C59DBF003D7C86 /* Sources */, + 88CF872117C59DBF003D7C86 /* Frameworks */, + 88CF872217C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */, + ); + name = "Recipe 9-1: Taking PicturesTests"; + productName = "Recipe 9-1: Taking PicturesTests"; + productReference = 88CF872417C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF86FB17C59DBF003D7C86 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF872317C59DBF003D7C86 = { + TestTargetID = 88CF870217C59DBF003D7C86; + }; + }; + }; + buildConfigurationList = 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-1: Taking Pictures" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CF86FA17C59DBF003D7C86; + productRefGroup = 88CF870417C59DBF003D7C86 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF870217C59DBF003D7C86 /* Recipe 9-1: Taking Pictures */, + 88CF872317C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF870117C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF871F17C59DBF003D7C86 /* Images.xcassets in Resources */, + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */, + 88CF871A17C59DBF003D7C86 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872217C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF86FF17C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF871D17C59DBF003D7C86 /* ViewController.m in Sources */, + 88CF871717C59DBF003D7C86 /* AppDelegate.m in Sources */, + 88CF871317C59DBF003D7C86 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872017C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF870217C59DBF003D7C86 /* Recipe 9-1: Taking Pictures */; + targetProxy = 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF871017C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF871817C59DBF003D7C86 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CF871917C59DBF003D7C86 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF872F17C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF873317C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF873417C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF873617C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF873717C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF873917C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-1: Taking PicturesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF873A17C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-1: Taking PicturesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-1: Taking Pictures" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873317C59DBF003D7C86 /* Debug */, + 88CF873417C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-1: Taking Pictures" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873617C59DBF003D7C86 /* Debug */, + 88CF873717C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-1: Taking PicturesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873917C59DBF003D7C86 /* Debug */, + 88CF873A17C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF86FB17C59DBF003D7C86 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..45dcc79 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..931bfc7 Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-1_ Taking Pictures.xcscheme b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-1_ Taking Pictures.xcscheme new file mode 100644 index 0000000..3615d41 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-1_ Taking Pictures.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..a4e0b34 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-1: Taking Pictures.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CF870217C59DBF003D7C86 + + primary + + + 88CF872317C59DBF003D7C86 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/AppDelegate.h new file mode 100644 index 0000000..09b511a --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-1: Taking Pictures +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/AppDelegate.m new file mode 100644 index 0000000..2b317cc --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-1: Taking Pictures +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e84449a --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Info.plist b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Info.plist new file mode 100644 index 0000000..6b35e8d --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Info.plist @@ -0,0 +1,42 @@ + + + + + NSPhotoLibraryUsageDescription + Testing the Camera + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/ViewController.h b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/ViewController.h new file mode 100644 index 0000000..118291c --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/ViewController.h @@ -0,0 +1,20 @@ +// +// ViewController.h +// Recipe 9-1: Taking Pictures +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *cameraButton; +@property (strong, nonatomic) UIImagePickerController *imagePicker; + +- (IBAction)takePicture:(id)sender; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/ViewController.m b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/ViewController.m new file mode 100644 index 0000000..a986a92 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/ViewController.m @@ -0,0 +1,70 @@ +// +// ViewController.m +// Recipe 9-1: Taking Pictures +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)takePicture:(id)sender { + // Make sure camera is available + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO) + { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" + message:@"Camera Unavailable" + delegate:self + cancelButtonTitle:@"Cancel" + otherButtonTitles:nil, nil]; + [alert show]; + return; + } + if (self.imagePicker == nil) + { + self.imagePicker = [[UIImagePickerController alloc] init]; + self.imagePicker.delegate = self; + self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; + self.imagePicker.allowsEditing = YES; + } + [self presentViewController:self.imagePicker animated:YES completion:NULL]; +} + +#pragma mark - delegate methods + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage]; + UIImageWriteToSavedPhotosAlbum (image, nil, nil , nil); + self.imageView.image = image; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker +{ + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/main.m b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/main.m new file mode 100644 index 0000000..50e5381 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-1: Taking Pictures +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/Recipe 9-1_ Taking PicturesTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/Recipe 9-1_ Taking PicturesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/Recipe 9-1_ Taking PicturesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m new file mode 100644 index 0000000..f88f1c9 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_1__Taking_PicturesTests.m +// Recipe 9-1: Taking PicturesTests +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_1__Taking_PicturesTests : XCTestCase + +@end + +@implementation Recipe_9_1__Taking_PicturesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/AppDelegate.h new file mode 100644 index 0000000..a19aafd --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-2 Recording videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/AppDelegate.m new file mode 100644 index 0000000..9a1d458 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-2 Recording videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8c1090e --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Recipe 9-2 Recording Video-Info.plist b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Recipe 9-2 Recording Video-Info.plist new file mode 100644 index 0000000..cfb3dc5 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Recipe 9-2 Recording Video-Info.plist @@ -0,0 +1,42 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSPhotoLibraryUsageDescription + Testing the Camera + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Recipe 9-2 Recording Video-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Recipe 9-2 Recording Video-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/Recipe 9-2 Recording Video-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/ViewController.h b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/ViewController.h new file mode 100644 index 0000000..d82826a --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Recipe 9-2 Recording videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *cameraButton; +@property (strong, nonatomic) UIImagePickerController *imagePicker; +@property (strong, nonatomic) NSString *pathToRecordedVideo; + +- (IBAction)takePicture:(id)sender; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/ViewController.m b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/ViewController.m new file mode 100644 index 0000000..fffd161 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/ViewController.m @@ -0,0 +1,86 @@ +// +// ViewController.m +// Recipe 9-2 Recording videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)takePicture:(id)sender { + // Make sure camera is available + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO) + { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" + message:@"Camera Unavailable" + delegate:self + cancelButtonTitle:@"Cancel" + otherButtonTitles:nil, nil]; + [alert show]; + return; + } + if (self.imagePicker == nil) + { + self.imagePicker = [[UIImagePickerController alloc] init]; + self.imagePicker.delegate = self; + self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; + self.imagePicker.mediaTypes = [UIImagePickerController + availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera]; + self.imagePicker.allowsEditing = YES; + } + [self presentViewController:self.imagePicker animated:YES completion:NULL]; +} + +- (IBAction)editVideo:(id)sender { +} + +#pragma mark - delegate methods + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType]; + + if (CFStringCompare((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) + { + NSString *moviePath = (NSString *)[[info objectForKey: UIImagePickerControllerMediaURL] path]; + + if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) + { + UISaveVideoAtPathToSavedPhotosAlbum (moviePath, nil, nil, nil); + } + } + UIImage *image = (UIImage *)[info objectForKey:UIImagePickerControllerEditedImage]; + UIImageWriteToSavedPhotosAlbum (image, nil, nil , nil); + self.imageView.image = image; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker +{ + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/main.m b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/main.m new file mode 100644 index 0000000..520ad84 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking Pictures/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-2: Recording Videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/Recipe 9-2 Recording VideoTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/Recipe 9-2 Recording VideoTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/Recipe 9-2 Recording VideoTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m new file mode 100644 index 0000000..f88f1c9 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_1__Taking_PicturesTests.m +// Recipe 9-1: Taking PicturesTests +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_1__Taking_PicturesTests : XCTestCase + +@end + +@implementation Recipe_9_1__Taking_PicturesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.pbxproj new file mode 100644 index 0000000..376a11d --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.pbxproj @@ -0,0 +1,461 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8857D5CD180672120099F026 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8857D5CA180672120099F026 /* AppDelegate.m */; }; + 8857D5CE180672120099F026 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8857D5CC180672120099F026 /* ViewController.m */; }; + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */; }; + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF871317C59DBF003D7C86 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871217C59DBF003D7C86 /* main.m */; }; + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF872517C59DBF003D7C86 /* XCTest.framework */; }; + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */; }; + 88E23D0217C6A7CD00A097E6 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF86FB17C59DBF003D7C86 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF870217C59DBF003D7C86; + remoteInfo = "Recipe 9-1: Taking Pictures"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8857D5C9180672120099F026 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8857D5CA180672120099F026 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8857D5CB180672120099F026 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8857D5CC180672120099F026 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CF870317C59DBF003D7C86 /* Recipe 9-2 Recording Video.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-2 Recording Video.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF870617C59DBF003D7C86 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF870A17C59DBF003D7C86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF870E17C59DBF003D7C86 /* Recipe 9-2 Recording Video-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-2 Recording Video-Info.plist"; sourceTree = ""; }; + 88CF871017C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF871217C59DBF003D7C86 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF871417C59DBF003D7C86 /* Recipe 9-2 Recording Video-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-2 Recording Video-Prefix.pch"; sourceTree = ""; }; + 88CF872417C59DBF003D7C86 /* Recipe 9-2 Recording VideoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-2 Recording VideoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF872517C59DBF003D7C86 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF872D17C59DBF003D7C86 /* Recipe 9-2 Recording VideoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-2 Recording VideoTests-Info.plist"; sourceTree = ""; }; + 88CF872F17C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_1__Taking_PicturesTests.m; sourceTree = ""; }; + 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF870017C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D0217C6A7CD00A097E6 /* MobileCoreServices.framework in Frameworks */, + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */, + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872117C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */, + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF86FA17C59DBF003D7C86 = { + isa = PBXGroup; + children = ( + 88CF870C17C59DBF003D7C86 /* Recipe 9-2 Recording Videos */, + 88CF872B17C59DBF003D7C86 /* Recipe 9-2 Recording Videos Test */, + 88CF870517C59DBF003D7C86 /* Frameworks */, + 88CF870417C59DBF003D7C86 /* Products */, + ); + sourceTree = ""; + }; + 88CF870417C59DBF003D7C86 /* Products */ = { + isa = PBXGroup; + children = ( + 88CF870317C59DBF003D7C86 /* Recipe 9-2 Recording Video.app */, + 88CF872417C59DBF003D7C86 /* Recipe 9-2 Recording VideoTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF870517C59DBF003D7C86 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */, + 88CF870617C59DBF003D7C86 /* Foundation.framework */, + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */, + 88CF870A17C59DBF003D7C86 /* UIKit.framework */, + 88CF872517C59DBF003D7C86 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF870C17C59DBF003D7C86 /* Recipe 9-2 Recording Videos */ = { + isa = PBXGroup; + children = ( + 8857D5C9180672120099F026 /* AppDelegate.h */, + 8857D5CA180672120099F026 /* AppDelegate.m */, + 8857D5CB180672120099F026 /* ViewController.h */, + 8857D5CC180672120099F026 /* ViewController.m */, + 88CF870D17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-2 Recording Videos"; + path = "Recipe 9-1: Taking Pictures"; + sourceTree = ""; + }; + 88CF870D17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF870E17C59DBF003D7C86 /* Recipe 9-2 Recording Video-Info.plist */, + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */, + 88CF871217C59DBF003D7C86 /* main.m */, + 88CF871417C59DBF003D7C86 /* Recipe 9-2 Recording Video-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF872B17C59DBF003D7C86 /* Recipe 9-2 Recording Videos Test */ = { + isa = PBXGroup; + children = ( + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */, + 88CF872C17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-2 Recording Videos Test"; + path = "Recipe 9-1: Taking PicturesTests"; + sourceTree = ""; + }; + 88CF872C17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF872D17C59DBF003D7C86 /* Recipe 9-2 Recording VideoTests-Info.plist */, + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF870217C59DBF003D7C86 /* Recipe 9-2 Recording Video */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-2 Recording Video" */; + buildPhases = ( + 88CF86FF17C59DBF003D7C86 /* Sources */, + 88CF870017C59DBF003D7C86 /* Frameworks */, + 88CF870117C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-2 Recording Video"; + productName = "Recipe 9-1: Taking Pictures"; + productReference = 88CF870317C59DBF003D7C86 /* Recipe 9-2 Recording Video.app */; + productType = "com.apple.product-type.application"; + }; + 88CF872317C59DBF003D7C86 /* Recipe 9-2 Recording VideoTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-2 Recording VideoTests" */; + buildPhases = ( + 88CF872017C59DBF003D7C86 /* Sources */, + 88CF872117C59DBF003D7C86 /* Frameworks */, + 88CF872217C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */, + ); + name = "Recipe 9-2 Recording VideoTests"; + productName = "Recipe 9-1: Taking PicturesTests"; + productReference = 88CF872417C59DBF003D7C86 /* Recipe 9-2 Recording VideoTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF86FB17C59DBF003D7C86 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF872317C59DBF003D7C86 = { + TestTargetID = 88CF870217C59DBF003D7C86; + }; + }; + }; + buildConfigurationList = 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-2 Recording Video" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CF86FA17C59DBF003D7C86; + productRefGroup = 88CF870417C59DBF003D7C86 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF870217C59DBF003D7C86 /* Recipe 9-2 Recording Video */, + 88CF872317C59DBF003D7C86 /* Recipe 9-2 Recording VideoTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF870117C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872217C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF86FF17C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8857D5CE180672120099F026 /* ViewController.m in Sources */, + 8857D5CD180672120099F026 /* AppDelegate.m in Sources */, + 88CF871317C59DBF003D7C86 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872017C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF870217C59DBF003D7C86 /* Recipe 9-2 Recording Video */; + targetProxy = 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF871017C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF872F17C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF873317C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF873417C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF873617C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-2 Recording Video-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-2 Recording Video-Info.plist"; + PRODUCT_NAME = "Recipe 9-2 Recording Video"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF873717C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-2 Recording Video-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-2 Recording Video-Info.plist"; + PRODUCT_NAME = "Recipe 9-2 Recording Video"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF873917C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-2 Recording VideoTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-2 Recording VideoTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF873A17C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-2 Recording VideoTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-2 Recording VideoTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-2 Recording Video" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873317C59DBF003D7C86 /* Debug */, + 88CF873417C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-2 Recording Video" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873617C59DBF003D7C86 /* Debug */, + 88CF873717C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-2 Recording VideoTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873917C59DBF003D7C86 /* Debug */, + 88CF873A17C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF86FB17C59DBF003D7C86 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..33ca0a6 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2d44e16 Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..c6c48c4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-2 Recording Videos.xcscheme b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-2 Recording Videos.xcscheme new file mode 100644 index 0000000..873be5f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-2 Recording Videos.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..cc462fd --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-2_ Recording Video/Recipe 9-2 Recording Video.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-2 Recording Videos.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CF870217C59DBF003D7C86 + + primary + + + 88CF872317C59DBF003D7C86 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/AppDelegate.h new file mode 100644 index 0000000..97b9f92 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-3 Editing Videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/AppDelegate.m new file mode 100644 index 0000000..9555b6b --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-3 Editing Videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard new file mode 100644 index 0000000..25de4bf --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Recipe 9-3 Editing Videos-Info.plist b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Recipe 9-3 Editing Videos-Info.plist new file mode 100644 index 0000000..6b35e8d --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Recipe 9-3 Editing Videos-Info.plist @@ -0,0 +1,42 @@ + + + + + NSPhotoLibraryUsageDescription + Testing the Camera + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Recipe 9-3 Editing Videos-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Recipe 9-3 Editing Videos-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/Recipe 9-3 Editing Videos-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/ViewController.h b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/ViewController.h new file mode 100644 index 0000000..7d24947 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/ViewController.h @@ -0,0 +1,23 @@ +// +// ViewController.h +// Recipe 9-3 Editing Videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *cameraButton; +@property (strong, nonatomic) UIImagePickerController *imagePicker; +@property (strong, nonatomic) NSString *pathToRecordedVideo; + +- (IBAction)takePicture:(id)sender; +- (IBAction)editVideo:(id)sender; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/ViewController.m b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/ViewController.m new file mode 100644 index 0000000..2ca5859 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/ViewController.m @@ -0,0 +1,122 @@ +// +// ViewController.m +// Recipe 9-3 Editing Videos +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)takePicture:(id)sender { + // Make sure camera is available + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO) + { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" + message:@"Camera Unavailable" + delegate:self + cancelButtonTitle:@"Cancel" + otherButtonTitles:nil, nil]; + [alert show]; + return; + } + if (self.imagePicker == nil) + { + self.imagePicker = [[UIImagePickerController alloc] init]; + self.imagePicker.delegate = self; + self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; + self.imagePicker.mediaTypes = [UIImagePickerController + availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera]; + self.imagePicker.allowsEditing = YES; + //optional set the video quality + //self.imagePicker.videoQuality = UIImagePickerControllerQualityTypeHigh; + } + [self presentViewController:self.imagePicker animated:YES completion:NULL]; +} + +- (IBAction)editVideo:(id)sender +{ + if (self.pathToRecordedVideo) + { + UIVideoEditorController *editor = [[UIVideoEditorController alloc] init]; + editor.videoPath = self.pathToRecordedVideo; + editor.delegate = self; + [self presentViewController:editor animated:YES completion:NULL]; + } + else + { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" + message:@"No Video Recorded Yet" + delegate:self + cancelButtonTitle:@"Cancel" + otherButtonTitles:nil, nil]; + [alert show]; + } + +} + +#pragma mark - delegate methods + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType]; + + if (CFStringCompare((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) + { + NSString *moviePath = (NSString *)[[info objectForKey: UIImagePickerControllerMediaURL] path]; + self.pathToRecordedVideo = moviePath; + + if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) + { + UISaveVideoAtPathToSavedPhotosAlbum (moviePath, nil, nil, nil); + } + } + UIImage *image = (UIImage *)[info objectForKey:UIImagePickerControllerEditedImage]; + UIImageWriteToSavedPhotosAlbum (image, nil, nil , nil); + self.imageView.image = image; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker +{ + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(void)videoEditorController:(UIVideoEditorController *)editor didSaveEditedVideoToPath:(NSString *)editedVideoPath +{ + self.pathToRecordedVideo = editedVideoPath; + if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (editedVideoPath)) + { + UISaveVideoAtPathToSavedPhotosAlbum (editedVideoPath, nil, nil, nil); + } + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(void)videoEditorControllerDidCancel:(UIVideoEditorController *)editor +{ + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/main.m b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/main.m new file mode 100644 index 0000000..50e5381 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking Pictures/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-1: Taking Pictures +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/Recipe 9-3 Editing VideosTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/Recipe 9-3 Editing VideosTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/Recipe 9-3 Editing VideosTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m new file mode 100644 index 0000000..f88f1c9 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_1__Taking_PicturesTests.m +// Recipe 9-1: Taking PicturesTests +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_1__Taking_PicturesTests : XCTestCase + +@end + +@implementation Recipe_9_1__Taking_PicturesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.pbxproj new file mode 100644 index 0000000..498b455 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */; }; + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF871317C59DBF003D7C86 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871217C59DBF003D7C86 /* main.m */; }; + 88CF871717C59DBF003D7C86 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871617C59DBF003D7C86 /* AppDelegate.m */; }; + 88CF871A17C59DBF003D7C86 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CF871817C59DBF003D7C86 /* Main.storyboard */; }; + 88CF871D17C59DBF003D7C86 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871C17C59DBF003D7C86 /* ViewController.m */; }; + 88CF871F17C59DBF003D7C86 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CF871E17C59DBF003D7C86 /* Images.xcassets */; }; + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF872517C59DBF003D7C86 /* XCTest.framework */; }; + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */; }; + 88E23D0217C6A7CD00A097E6 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF86FB17C59DBF003D7C86 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF870217C59DBF003D7C86; + remoteInfo = "Recipe 9-1: Taking Pictures"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF870317C59DBF003D7C86 /* Recipe 9-3 Editing Videos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-3 Editing Videos.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF870617C59DBF003D7C86 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF870A17C59DBF003D7C86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF870E17C59DBF003D7C86 /* Recipe 9-3 Editing Videos-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-3 Editing Videos-Info.plist"; sourceTree = ""; }; + 88CF871017C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF871217C59DBF003D7C86 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF871417C59DBF003D7C86 /* Recipe 9-3 Editing Videos-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-3 Editing Videos-Prefix.pch"; sourceTree = ""; }; + 88CF871517C59DBF003D7C86 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CF871617C59DBF003D7C86 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CF871917C59DBF003D7C86 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CF871B17C59DBF003D7C86 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CF871C17C59DBF003D7C86 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CF871E17C59DBF003D7C86 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CF872417C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-3 Editing VideosTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF872517C59DBF003D7C86 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF872D17C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-3 Editing VideosTests-Info.plist"; sourceTree = ""; }; + 88CF872F17C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_1__Taking_PicturesTests.m; sourceTree = ""; }; + 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF870017C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D0217C6A7CD00A097E6 /* MobileCoreServices.framework in Frameworks */, + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */, + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872117C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */, + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF86FA17C59DBF003D7C86 = { + isa = PBXGroup; + children = ( + 88CF870C17C59DBF003D7C86 /* Recipe 9-3 Editing Videos */, + 88CF872B17C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests */, + 88CF870517C59DBF003D7C86 /* Frameworks */, + 88CF870417C59DBF003D7C86 /* Products */, + ); + sourceTree = ""; + }; + 88CF870417C59DBF003D7C86 /* Products */ = { + isa = PBXGroup; + children = ( + 88CF870317C59DBF003D7C86 /* Recipe 9-3 Editing Videos.app */, + 88CF872417C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF870517C59DBF003D7C86 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */, + 88CF870617C59DBF003D7C86 /* Foundation.framework */, + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */, + 88CF870A17C59DBF003D7C86 /* UIKit.framework */, + 88CF872517C59DBF003D7C86 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF870C17C59DBF003D7C86 /* Recipe 9-3 Editing Videos */ = { + isa = PBXGroup; + children = ( + 88CF871517C59DBF003D7C86 /* AppDelegate.h */, + 88CF871617C59DBF003D7C86 /* AppDelegate.m */, + 88CF871817C59DBF003D7C86 /* Main.storyboard */, + 88CF871B17C59DBF003D7C86 /* ViewController.h */, + 88CF871C17C59DBF003D7C86 /* ViewController.m */, + 88CF871E17C59DBF003D7C86 /* Images.xcassets */, + 88CF870D17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-3 Editing Videos"; + path = "Recipe 9-1: Taking Pictures"; + sourceTree = ""; + }; + 88CF870D17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF870E17C59DBF003D7C86 /* Recipe 9-3 Editing Videos-Info.plist */, + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */, + 88CF871217C59DBF003D7C86 /* main.m */, + 88CF871417C59DBF003D7C86 /* Recipe 9-3 Editing Videos-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF872B17C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests */ = { + isa = PBXGroup; + children = ( + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */, + 88CF872C17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-3 Editing VideosTests"; + path = "Recipe 9-1: Taking PicturesTests"; + sourceTree = ""; + }; + 88CF872C17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF872D17C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests-Info.plist */, + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF870217C59DBF003D7C86 /* Recipe 9-3 Editing Videos */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-3 Editing Videos" */; + buildPhases = ( + 88CF86FF17C59DBF003D7C86 /* Sources */, + 88CF870017C59DBF003D7C86 /* Frameworks */, + 88CF870117C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-3 Editing Videos"; + productName = "Recipe 9-1: Taking Pictures"; + productReference = 88CF870317C59DBF003D7C86 /* Recipe 9-3 Editing Videos.app */; + productType = "com.apple.product-type.application"; + }; + 88CF872317C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-3 Editing VideosTests" */; + buildPhases = ( + 88CF872017C59DBF003D7C86 /* Sources */, + 88CF872117C59DBF003D7C86 /* Frameworks */, + 88CF872217C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */, + ); + name = "Recipe 9-3 Editing VideosTests"; + productName = "Recipe 9-1: Taking PicturesTests"; + productReference = 88CF872417C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF86FB17C59DBF003D7C86 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF872317C59DBF003D7C86 = { + TestTargetID = 88CF870217C59DBF003D7C86; + }; + }; + }; + buildConfigurationList = 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-3 Editing Videos" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CF86FA17C59DBF003D7C86; + productRefGroup = 88CF870417C59DBF003D7C86 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF870217C59DBF003D7C86 /* Recipe 9-3 Editing Videos */, + 88CF872317C59DBF003D7C86 /* Recipe 9-3 Editing VideosTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF870117C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF871F17C59DBF003D7C86 /* Images.xcassets in Resources */, + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */, + 88CF871A17C59DBF003D7C86 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872217C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF86FF17C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF871D17C59DBF003D7C86 /* ViewController.m in Sources */, + 88CF871717C59DBF003D7C86 /* AppDelegate.m in Sources */, + 88CF871317C59DBF003D7C86 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872017C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF870217C59DBF003D7C86 /* Recipe 9-3 Editing Videos */; + targetProxy = 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF871017C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF871817C59DBF003D7C86 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CF871917C59DBF003D7C86 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF872F17C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF873317C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF873417C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF873617C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-3 Editing Videos-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-3 Editing Videos-Info.plist"; + PRODUCT_NAME = "Recipe 9-3 Editing Videos"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF873717C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-3 Editing Videos-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-3 Editing Videos-Info.plist"; + PRODUCT_NAME = "Recipe 9-3 Editing Videos"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF873917C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-3 Editing VideosTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-3 Editing VideosTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF873A17C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-3 Editing VideosTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-3 Editing VideosTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-3 Editing Videos" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873317C59DBF003D7C86 /* Debug */, + 88CF873417C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-3 Editing Videos" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873617C59DBF003D7C86 /* Debug */, + 88CF873717C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-3 Editing VideosTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873917C59DBF003D7C86 /* Debug */, + 88CF873A17C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF86FB17C59DBF003D7C86 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..d3c9d82 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..9ec1a9d Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..24af910 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-3 Editing Videos.xcscheme b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-3 Editing Videos.xcscheme new file mode 100644 index 0000000..faf4331 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-3 Editing Videos.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..653eb80 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-3_ Editing Videos/Recipe 9-3 Editing Videos.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-3 Editing Videos.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CF870217C59DBF003D7C86 + + primary + + + 88CF872317C59DBF003D7C86 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/AppDelegate.h new file mode 100644 index 0000000..846576f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-4 Using Custom Camera Overlays +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/AppDelegate.m new file mode 100644 index 0000000..2328794 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-4 Using Custom Camera Overlays +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard new file mode 100644 index 0000000..25de4bf --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Base.lproj/Main.storyboard @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Info.plist b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Info.plist new file mode 100644 index 0000000..6b35e8d --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Info.plist @@ -0,0 +1,42 @@ + + + + + NSPhotoLibraryUsageDescription + Testing the Camera + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/Recipe 9-1_ Taking Pictures-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/ViewController.h b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/ViewController.h new file mode 100644 index 0000000..ab91e8f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/ViewController.h @@ -0,0 +1,23 @@ +// +// ViewController.h +// Recipe 9-4 Using Custom Camera Overlays +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIImageView *imageView; +@property (weak, nonatomic) IBOutlet UIButton *cameraButton; +@property (strong, nonatomic) UIImagePickerController *imagePicker; +@property (strong, nonatomic) NSString *pathToRecordedVideo; + +- (IBAction)takePicture:(id)sender; +- (IBAction)editVideo:(id)sender; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/ViewController.m b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/ViewController.m new file mode 100644 index 0000000..6a1b084 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/ViewController.m @@ -0,0 +1,196 @@ +// +// ViewController.m +// Recipe 9-4 Using Custom Camera Overlays +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - actions + +- (IBAction)takePicture:(id)sender { + // Make sure camera is available + if ([UIImagePickerController + isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO) + { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" + message:@"Camera Unavailable" + delegate:self + cancelButtonTitle:@"Cancel" + otherButtonTitles:nil, nil]; + [alert show]; + return; + } + if (self.imagePicker == nil) + { + self.imagePicker = [[UIImagePickerController alloc] init]; + self.imagePicker.delegate = self; + self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; + self.imagePicker.mediaTypes = [UIImagePickerController + availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera]; + // self.imagePicker.allowsEditing = YES; + self.imagePicker.showsCameraControls = NO; + self.imagePicker.cameraOverlayView = + [self customViewForImagePicker:self.imagePicker]; + } + [self presentViewController:self.imagePicker animated:YES completion:NULL]; +} + +- (IBAction)editVideo:(id)sender +{ + if (self.pathToRecordedVideo) + { + UIVideoEditorController *editor = [[UIVideoEditorController alloc] init]; + editor.videoPath = self.pathToRecordedVideo; + editor.delegate = self; + [self presentViewController:editor animated:YES completion:NULL]; + } + else + { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" + message:@"No Video Recorded Yet" + delegate:self + cancelButtonTitle:@"Cancel" + otherButtonTitles:nil, nil]; + [alert show]; + } + +} + +#pragma mark - delegate methods + +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType]; + + if (CFStringCompare((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) + { + NSString *moviePath = (NSString *)[[info objectForKey: UIImagePickerControllerMediaURL] path]; + self.pathToRecordedVideo = moviePath; + + if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) + { + UISaveVideoAtPathToSavedPhotosAlbum (moviePath, nil, nil, nil); + } + } + UIImage *image = (UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage]; + UIImageWriteToSavedPhotosAlbum (image, nil, nil , nil); + self.imageView.image = image; + self.imageView.contentMode = UIViewContentModeScaleAspectFill; + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker +{ + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(void)videoEditorController:(UIVideoEditorController *)editor didSaveEditedVideoToPath:(NSString *)editedVideoPath +{ + self.pathToRecordedVideo = editedVideoPath; + if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (editedVideoPath)) + { + UISaveVideoAtPathToSavedPhotosAlbum (editedVideoPath, nil, nil, nil); + } + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(void)videoEditorControllerDidCancel:(UIVideoEditorController *)editor +{ + [self dismissViewControllerAnimated:YES completion:NULL]; +} + +-(UIView *)customViewForImagePicker:(UIImagePickerController *)imagePicker; +{ + UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 20, 280, 480)]; + view.backgroundColor = [UIColor clearColor]; + + UIButton *flashButton = + [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 120, 44)]; + flashButton.backgroundColor = [UIColor colorWithRed:.5 green:.5 blue:.5 alpha:.5]; + [flashButton setTitle:@"Flash Auto" forState:UIControlStateNormal]; + [flashButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + flashButton.layer.cornerRadius = 10.0; + + UIButton *changeCameraButton = + [[UIButton alloc] initWithFrame:CGRectMake(190, 10, 120, 44)]; + changeCameraButton.backgroundColor = + [UIColor colorWithRed:.5 green:.5 blue:.5 alpha:.5]; + [changeCameraButton setTitle:@"Rear Camera" forState:UIControlStateNormal]; + [changeCameraButton setTitleColor:[UIColor whiteColor] + forState:UIControlStateNormal]; + changeCameraButton.layer.cornerRadius = 10.0; + + UIButton *takePictureButton = + [[UIButton alloc] initWithFrame:CGRectMake(100, 432, 120, 44)]; + takePictureButton.backgroundColor = + [UIColor colorWithRed:.5 green:.5 blue:.5 alpha:.5]; + [takePictureButton setTitle:@"Click!" forState:UIControlStateNormal]; + [takePictureButton setTitleColor:[UIColor whiteColor] + forState:UIControlStateNormal]; + takePictureButton.layer.cornerRadius = 10.0; + + [flashButton addTarget:self action:@selector(toggleFlash:) + forControlEvents:UIControlEventTouchUpInside]; + [changeCameraButton addTarget:self action:@selector(toggleCamera:) + forControlEvents:UIControlEventTouchUpInside]; + [takePictureButton addTarget:imagePicker action:@selector(takePicture) + forControlEvents:UIControlEventTouchUpInside]; + + [view addSubview:flashButton]; + [view addSubview:changeCameraButton]; + [view addSubview:takePictureButton]; + + return view; +} + +-(void)toggleFlash:(UIButton *)sender +{ + if (self.imagePicker.cameraFlashMode == UIImagePickerControllerCameraFlashModeOff) + { + self.imagePicker.cameraFlashMode = UIImagePickerControllerCameraFlashModeOn; + [sender setTitle:@"Flash On" forState:UIControlStateNormal]; + } + else + { + self.imagePicker.cameraFlashMode = UIImagePickerControllerCameraFlashModeOff; + [sender setTitle:@"Flash Off" forState:UIControlStateNormal]; + } +} + +-(void)toggleCamera:(UIButton *)sender +{ + if (self.imagePicker.cameraDevice == UIImagePickerControllerCameraDeviceRear) + { + self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront; + [sender setTitle:@"Front Camera" forState:UIControlStateNormal]; + } + else + { + self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceRear; + [sender setTitle:@"Rear Camera" forState:UIControlStateNormal]; + } +} + + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/main.m b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/main.m new file mode 100644 index 0000000..50e5381 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking Pictures/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-1: Taking Pictures +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/Recipe 9-1_ Taking PicturesTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/Recipe 9-1_ Taking PicturesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/Recipe 9-1_ Taking PicturesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m new file mode 100644 index 0000000..f88f1c9 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/Recipe_9_1__Taking_PicturesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_1__Taking_PicturesTests.m +// Recipe 9-1: Taking PicturesTests +// +// Created by joseph hoffman on 8/21/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_1__Taking_PicturesTests : XCTestCase + +@end + +@implementation Recipe_9_1__Taking_PicturesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-1_ Taking PicturesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0ab28fb --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */; }; + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF871317C59DBF003D7C86 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871217C59DBF003D7C86 /* main.m */; }; + 88CF871717C59DBF003D7C86 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871617C59DBF003D7C86 /* AppDelegate.m */; }; + 88CF871A17C59DBF003D7C86 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88CF871817C59DBF003D7C86 /* Main.storyboard */; }; + 88CF871D17C59DBF003D7C86 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF871C17C59DBF003D7C86 /* ViewController.m */; }; + 88CF871F17C59DBF003D7C86 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88CF871E17C59DBF003D7C86 /* Images.xcassets */; }; + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF872517C59DBF003D7C86 /* XCTest.framework */; }; + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870617C59DBF003D7C86 /* Foundation.framework */; }; + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CF870A17C59DBF003D7C86 /* UIKit.framework */; }; + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */; }; + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */; }; + 88E23D0217C6A7CD00A097E6 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88CF86FB17C59DBF003D7C86 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88CF870217C59DBF003D7C86; + remoteInfo = "Recipe 9-1: Taking Pictures"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 88CF870317C59DBF003D7C86 /* Recipe 9-1:Taking Pictures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "Recipe 9-1:Taking Pictures.app"; path = "Recipe 9-4 Taking Pictures.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF870617C59DBF003D7C86 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88CF870A17C59DBF003D7C86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88CF870E17C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-1: Taking Pictures-Info.plist"; sourceTree = ""; }; + 88CF871017C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF871217C59DBF003D7C86 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88CF871417C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-1: Taking Pictures-Prefix.pch"; sourceTree = ""; }; + 88CF871517C59DBF003D7C86 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88CF871617C59DBF003D7C86 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88CF871917C59DBF003D7C86 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88CF871B17C59DBF003D7C86 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88CF871C17C59DBF003D7C86 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88CF871E17C59DBF003D7C86 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88CF872417C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-1: Taking PicturesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88CF872517C59DBF003D7C86 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88CF872D17C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-1: Taking PicturesTests-Info.plist"; sourceTree = ""; }; + 88CF872F17C59DBF003D7C86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_1__Taking_PicturesTests.m; sourceTree = ""; }; + 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88CF870017C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D0217C6A7CD00A097E6 /* MobileCoreServices.framework in Frameworks */, + 88CF870917C59DBF003D7C86 /* CoreGraphics.framework in Frameworks */, + 88CF870B17C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF870717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872117C59DBF003D7C86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF872617C59DBF003D7C86 /* XCTest.framework in Frameworks */, + 88CF872817C59DBF003D7C86 /* UIKit.framework in Frameworks */, + 88CF872717C59DBF003D7C86 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88CF86FA17C59DBF003D7C86 = { + isa = PBXGroup; + children = ( + 88CF870C17C59DBF003D7C86 /* Recipe 9-4 Using Custom Camera Overlays */, + 88CF872B17C59DBF003D7C86 /* Recipe 9-4 Using Custom Camera Overlays */, + 88CF870517C59DBF003D7C86 /* Frameworks */, + 88CF870417C59DBF003D7C86 /* Products */, + ); + sourceTree = ""; + }; + 88CF870417C59DBF003D7C86 /* Products */ = { + isa = PBXGroup; + children = ( + 88CF870317C59DBF003D7C86 /* Recipe 9-1:Taking Pictures.app */, + 88CF872417C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88CF870517C59DBF003D7C86 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88E23D0117C6A7CD00A097E6 /* MobileCoreServices.framework */, + 88CF870617C59DBF003D7C86 /* Foundation.framework */, + 88CF870817C59DBF003D7C86 /* CoreGraphics.framework */, + 88CF870A17C59DBF003D7C86 /* UIKit.framework */, + 88CF872517C59DBF003D7C86 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88CF870C17C59DBF003D7C86 /* Recipe 9-4 Using Custom Camera Overlays */ = { + isa = PBXGroup; + children = ( + 88CF871517C59DBF003D7C86 /* AppDelegate.h */, + 88CF871617C59DBF003D7C86 /* AppDelegate.m */, + 88CF871817C59DBF003D7C86 /* Main.storyboard */, + 88CF871B17C59DBF003D7C86 /* ViewController.h */, + 88CF871C17C59DBF003D7C86 /* ViewController.m */, + 88CF871E17C59DBF003D7C86 /* Images.xcassets */, + 88CF870D17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-4 Using Custom Camera Overlays"; + path = "Recipe 9-1: Taking Pictures"; + sourceTree = ""; + }; + 88CF870D17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF870E17C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Info.plist */, + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */, + 88CF871217C59DBF003D7C86 /* main.m */, + 88CF871417C59DBF003D7C86 /* Recipe 9-1: Taking Pictures-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88CF872B17C59DBF003D7C86 /* Recipe 9-4 Using Custom Camera Overlays */ = { + isa = PBXGroup; + children = ( + 88CF873117C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m */, + 88CF872C17C59DBF003D7C86 /* Supporting Files */, + ); + name = "Recipe 9-4 Using Custom Camera Overlays"; + path = "Recipe 9-1: Taking PicturesTests"; + sourceTree = ""; + }; + 88CF872C17C59DBF003D7C86 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88CF872D17C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests-Info.plist */, + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88CF870217C59DBF003D7C86 /* Recipe 9-4 Taking Pictures */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-4 Taking Pictures" */; + buildPhases = ( + 88CF86FF17C59DBF003D7C86 /* Sources */, + 88CF870017C59DBF003D7C86 /* Frameworks */, + 88CF870117C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-4 Taking Pictures"; + productName = "Recipe 9-1: Taking Pictures"; + productReference = 88CF870317C59DBF003D7C86 /* Recipe 9-1:Taking Pictures.app */; + productType = "com.apple.product-type.application"; + }; + 88CF872317C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-1: Taking PicturesTests" */; + buildPhases = ( + 88CF872017C59DBF003D7C86 /* Sources */, + 88CF872117C59DBF003D7C86 /* Frameworks */, + 88CF872217C59DBF003D7C86 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */, + ); + name = "Recipe 9-1: Taking PicturesTests"; + productName = "Recipe 9-1: Taking PicturesTests"; + productReference = 88CF872417C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88CF86FB17C59DBF003D7C86 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88CF872317C59DBF003D7C86 = { + TestTargetID = 88CF870217C59DBF003D7C86; + }; + }; + }; + buildConfigurationList = 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-4 Using Custom Camera Overlays" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88CF86FA17C59DBF003D7C86; + productRefGroup = 88CF870417C59DBF003D7C86 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88CF870217C59DBF003D7C86 /* Recipe 9-4 Taking Pictures */, + 88CF872317C59DBF003D7C86 /* Recipe 9-1: Taking PicturesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88CF870117C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF871F17C59DBF003D7C86 /* Images.xcassets in Resources */, + 88CF871117C59DBF003D7C86 /* InfoPlist.strings in Resources */, + 88CF871A17C59DBF003D7C86 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872217C59DBF003D7C86 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873017C59DBF003D7C86 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88CF86FF17C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF871D17C59DBF003D7C86 /* ViewController.m in Sources */, + 88CF871717C59DBF003D7C86 /* AppDelegate.m in Sources */, + 88CF871317C59DBF003D7C86 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88CF872017C59DBF003D7C86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88CF873217C59DBF003D7C86 /* Recipe_9_1__Taking_PicturesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88CF872A17C59DBF003D7C86 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88CF870217C59DBF003D7C86 /* Recipe 9-4 Taking Pictures */; + targetProxy = 88CF872917C59DBF003D7C86 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88CF870F17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF871017C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88CF871817C59DBF003D7C86 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88CF871917C59DBF003D7C86 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88CF872E17C59DBF003D7C86 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88CF872F17C59DBF003D7C86 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88CF873317C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88CF873417C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88CF873617C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88CF873717C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88CF873917C59DBF003D7C86 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-1: Taking PicturesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88CF873A17C59DBF003D7C86 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-1: Taking Pictures.app/Recipe 9-1: Taking Pictures"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-1: Taking Pictures/Recipe 9-1: Taking Pictures-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-1: Taking PicturesTests/Recipe 9-1: Taking PicturesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88CF86FE17C59DBF003D7C86 /* Build configuration list for PBXProject "Recipe 9-4 Using Custom Camera Overlays" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873317C59DBF003D7C86 /* Debug */, + 88CF873417C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873517C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-4 Taking Pictures" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873617C59DBF003D7C86 /* Debug */, + 88CF873717C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88CF873817C59DBF003D7C86 /* Build configuration list for PBXNativeTarget "Recipe 9-1: Taking PicturesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88CF873917C59DBF003D7C86 /* Debug */, + 88CF873A17C59DBF003D7C86 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88CF86FB17C59DBF003D7C86 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f72148c --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2e5ea09 Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..bfffcfe --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..3135e8a --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-1 Using Custom Camera Overlays.xcscheme b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-1 Using Custom Camera Overlays.xcscheme new file mode 100644 index 0000000..3387802 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-1 Using Custom Camera Overlays.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f02c298 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-4_ Using Custom Camera Overlays/Recipe 9-4 Using Custom Camera Overlays.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-1 Using Custom Camera Overlays.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88CF870217C59DBF003D7C86 + + primary + + + 88CF872317C59DBF003D7C86 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fbc3413 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD317C70169001EFB3D /* AVFoundation.framework */; }; + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */; }; + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */; }; + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1B17C6CE0A00A097E6 /* main.m */; }; + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */; }; + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2117C6CE0A00A097E6 /* Main.storyboard */; }; + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D2517C6CE0A00A097E6 /* ViewController.m */; }; + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2717C6CE0A00A097E6 /* Images.xcassets */; }; + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */; }; + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88E23D0417C6CE0A00A097E6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E23D0B17C6CE0A00A097E6; + remoteInfo = "Recipe 9-5: Displaying Camera Preview"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 882E7BD317C70169001EFB3D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-5 Displaying Camera Preview.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88E23D1717C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-5 Displaying Camera Preview-Info.plist"; sourceTree = ""; }; + 88E23D1917C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D1B17C6CE0A00A097E6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-5 Displaying Camera Preview-Prefix.pch"; sourceTree = ""; }; + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88E23D2217C6CE0A00A097E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88E23D2417C6CE0A00A097E6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88E23D2517C6CE0A00A097E6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-5 Displaying Camera PreviewTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88E23D3617C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-5 Displaying Camera PreviewTests-Info.plist"; sourceTree = ""; }; + 88E23D3817C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_5__Displaying_Camera_PreviewTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88E23D0917C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */, + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */, + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */, + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2A17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */, + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88E23D0317C6CE0A00A097E6 = { + isa = PBXGroup; + children = ( + 88E23D1517C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview */, + 88E23D3417C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests */, + 88E23D0E17C6CE0A00A097E6 /* Frameworks */, + 88E23D0D17C6CE0A00A097E6 /* Products */, + ); + sourceTree = ""; + }; + 88E23D0D17C6CE0A00A097E6 /* Products */ = { + isa = PBXGroup; + children = ( + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview.app */, + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88E23D0E17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */, + 882E7BD317C70169001EFB3D /* AVFoundation.framework */, + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */, + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */, + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */, + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88E23D1517C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview */ = { + isa = PBXGroup; + children = ( + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */, + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */, + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */, + 88E23D2417C6CE0A00A097E6 /* ViewController.h */, + 88E23D2517C6CE0A00A097E6 /* ViewController.m */, + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */, + 88E23D1617C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-5 Displaying Camera Preview"; + path = "Recipe 9-5: Displaying Camera Preview"; + sourceTree = ""; + }; + 88E23D1617C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D1717C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview-Info.plist */, + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */, + 88E23D1B17C6CE0A00A097E6 /* main.m */, + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88E23D3417C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests */ = { + isa = PBXGroup; + children = ( + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */, + 88E23D3517C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-5 Displaying Camera PreviewTests"; + path = "Recipe 9-5: Displaying Camera PreviewTests"; + sourceTree = ""; + }; + 88E23D3517C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D3617C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests-Info.plist */, + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-5 Displaying Camera Preview" */; + buildPhases = ( + 88E23D0817C6CE0A00A097E6 /* Sources */, + 88E23D0917C6CE0A00A097E6 /* Frameworks */, + 88E23D0A17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-5 Displaying Camera Preview"; + productName = "Recipe 9-5: Displaying Camera Preview"; + productReference = 88E23D0C17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview.app */; + productType = "com.apple.product-type.application"; + }; + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-5 Displaying Camera PreviewTests" */; + buildPhases = ( + 88E23D2917C6CE0A00A097E6 /* Sources */, + 88E23D2A17C6CE0A00A097E6 /* Frameworks */, + 88E23D2B17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */, + ); + name = "Recipe 9-5 Displaying Camera PreviewTests"; + productName = "Recipe 9-5: Displaying Camera PreviewTests"; + productReference = 88E23D2D17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88E23D0417C6CE0A00A097E6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88E23D2C17C6CE0A00A097E6 = { + TestTargetID = 88E23D0B17C6CE0A00A097E6; + }; + }; + }; + buildConfigurationList = 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-5 Displaying Camera Preview" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88E23D0317C6CE0A00A097E6; + productRefGroup = 88E23D0D17C6CE0A00A097E6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview */, + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera PreviewTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88E23D0A17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */, + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2B17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88E23D0817C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */, + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */, + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2917C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88E23D0B17C6CE0A00A097E6 /* Recipe 9-5 Displaying Camera Preview */; + targetProxy = 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D1917C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88E23D2217C6CE0A00A097E6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D3817C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88E23D3C17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88E23D3D17C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88E23D3F17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Info.plist"; + PRODUCT_NAME = "Recipe 9-5 Displaying Camera Preview"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88E23D4017C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Info.plist"; + PRODUCT_NAME = "Recipe 9-5 Displaying Camera Preview"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88E23D4217C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-5 Displaying Camera PreviewTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-5 Displaying Camera PreviewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88E23D4317C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-5 Displaying Camera PreviewTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-5 Displaying Camera PreviewTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-5 Displaying Camera Preview" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3C17C6CE0A00A097E6 /* Debug */, + 88E23D3D17C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-5 Displaying Camera Preview" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3F17C6CE0A00A097E6 /* Debug */, + 88E23D4017C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-5 Displaying Camera PreviewTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D4217C6CE0A00A097E6 /* Debug */, + 88E23D4317C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88E23D0417C6CE0A00A097E6 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..e97cc42 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c2495ac Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-5 Displaying Camera Preview.xcscheme b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-5 Displaying Camera Preview.xcscheme new file mode 100644 index 0000000..e4dd461 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-5 Displaying Camera Preview.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..b15fa60 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-5 Displaying Camera Preview.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88E23D0B17C6CE0A00A097E6 + + primary + + + 88E23D2C17C6CE0A00A097E6 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h new file mode 100644 index 0000000..aeaf555 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-5 Displaying Camera Preview +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m new file mode 100644 index 0000000..267f50f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-5 Displaying Camera Previewwith AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bbd837d --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Info.plist b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Info.plist new file mode 100644 index 0000000..714bf22 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Info.plist @@ -0,0 +1,42 @@ + + + + + NSPhotoLibraryUsageDescription + Testing AVCaptureSession + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5 Displaying Camera Preview-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/ViewController.h b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/ViewController.h new file mode 100644 index 0000000..f6bc270 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/ViewController.h @@ -0,0 +1,18 @@ +// +// ViewController.h +// Recipe 9-5 Displaying Camera Preview +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + + +@interface ViewController : UIViewController + +@property (strong, nonatomic) AVCaptureSession *captureSession; +@property (strong, nonatomic) AVCaptureDeviceInput *videoInput; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/ViewController.m b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/ViewController.m new file mode 100644 index 0000000..a8a042a --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/ViewController.m @@ -0,0 +1,59 @@ +// +// ViewController.m +// Recipe 9-5 Displaying Camera Preview +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + self.captureSession = [[AVCaptureSession alloc] init]; + //Optional: self.captureSession.sessionPreset = AVCaptureSessionPresetMedium; + + AVCaptureDevice *device = + [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + + NSError *error = nil; + self.videoInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error]; + if (self.videoInput) + { + [self.captureSession addInput:self.videoInput]; + } + else + { + NSLog(@"Input Error: %@", error); + } + + AVCaptureVideoPreviewLayer *previewLayer = + [AVCaptureVideoPreviewLayer layerWithSession:self.captureSession]; + UIView *aView = self.view; + previewLayer.frame = + CGRectMake(0, 0, self.view.frame.size.width, + self.view.frame.size.height-70); + [aView.layer addSublayer:previewLayer]; +} +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self.captureSession startRunning]; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self.captureSession stopRunning]; +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/main.m b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/main.m new file mode 100644 index 0000000..6103b98 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera Preview/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-5: Displaying Camera Preview +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-5 Displaying Camera PreviewTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-5 Displaying Camera PreviewTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-5 Displaying Camera PreviewTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m new file mode 100644 index 0000000..7ea7e54 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_5__Displaying_Camera_PreviewTests.m +// Recipe 9-5: Displaying Camera PreviewTests +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_5__Displaying_Camera_PreviewTests : XCTestCase + +@end + +@implementation Recipe_9_5__Displaying_Camera_PreviewTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-5_ Displaying Camera Preview/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h new file mode 100644 index 0000000..2f58de7 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-6 Capturing Still Images with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m new file mode 100644 index 0000000..8c58c0f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-6 Capturing Still Images with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard new file mode 100644 index 0000000..d131321 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist new file mode 100644 index 0000000..714bf22 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist @@ -0,0 +1,42 @@ + + + + + NSPhotoLibraryUsageDescription + Testing AVCaptureSession + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/ViewController.h b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/ViewController.h new file mode 100644 index 0000000..f204252 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/ViewController.h @@ -0,0 +1,21 @@ +// +// ViewController.h +// Recipe 9-6 Capturing Still Images with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) AVCaptureSession *captureSession; +@property (strong, nonatomic) AVCaptureDeviceInput *videoInput; +@property (strong, nonatomic) AVCaptureStillImageOutput *stillImageOutput; + +- (IBAction)capture:(id)sender; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/ViewController.m b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/ViewController.m new file mode 100644 index 0000000..fc47e8f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/ViewController.m @@ -0,0 +1,126 @@ +// +// ViewController.m +// Recipe 9-6 Capturing Still Images with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + self.captureSession = [[AVCaptureSession alloc] init]; + //Optional: self.captureSession.sessionPreset = AVCaptureSessionPresetMedium; + + AVCaptureDevice *device = + [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + + NSError *error = nil; + self.videoInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error]; + if (self.videoInput) + { + [self.captureSession addInput:self.videoInput]; + } + else + { + NSLog(@"Input Error: %@", error); + } + + self.stillImageOutput = [[AVCaptureStillImageOutput alloc] init]; + NSDictionary *stillImageOutputSettings = + [[NSDictionary alloc] initWithObjectsAndKeys: + AVVideoCodecJPEG, AVVideoCodecKey, nil]; + [self.stillImageOutput setOutputSettings:stillImageOutputSettings]; + [self.captureSession addOutput:self.stillImageOutput]; + + AVCaptureVideoPreviewLayer *previewLayer = + [AVCaptureVideoPreviewLayer layerWithSession:self.captureSession]; + UIView *aView = self.view; + previewLayer.frame = + CGRectMake(0, 20, self.view.frame.size.width, + self.view.frame.size.height-70); + [aView.layer addSublayer:previewLayer]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self.captureSession startRunning]; +} +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self.captureSession stopRunning]; +} + + +- (IBAction)capture:(id)sender { + [self captureStillImage]; +} + +- (void) captureStillImage +{ + AVCaptureConnection *stillImageConnection = + [self.stillImageOutput.connections objectAtIndex:0]; + if ([stillImageConnection isVideoOrientationSupported]) + [stillImageConnection setVideoOrientation:AVCaptureVideoOrientationPortrait]; + + [self.stillImageOutput + captureStillImageAsynchronouslyFromConnection:stillImageConnection + completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) + { + if (imageDataSampleBuffer != NULL) + { + NSData *imageData = [AVCaptureStillImageOutput + jpegStillImageNSDataRepresentation:imageDataSampleBuffer]; + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + UIImage *image = [[UIImage alloc] initWithData:imageData]; + [library writeImageToSavedPhotosAlbum:[image CGImage] + orientation:(ALAssetOrientation)[image imageOrientation] + completionBlock:^(NSURL *assetURL, NSError *error) + { + UIAlertView *alert; + if (!error) + { + alert = [[UIAlertView alloc] initWithTitle:@"Photo Saved" + message:@"The photo was successfully saved to your photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + else + { + alert = [[UIAlertView alloc] initWithTitle:@"Error Saving Photo" + message:@"The photo was not saved to you photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + + [alert show]; + } + ]; + } + else + { + NSLog(@"Error capturing still image: %@", error); + } + } + ]; +} +@end diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/main.m b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/main.m new file mode 100644 index 0000000..6103b98 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera Preview/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-5: Displaying Camera Preview +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m new file mode 100644 index 0000000..7ea7e54 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_5__Displaying_Camera_PreviewTests.m +// Recipe 9-5: Displaying Camera PreviewTests +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_5__Displaying_Camera_PreviewTests : XCTestCase + +@end + +@implementation Recipe_9_5__Displaying_Camera_PreviewTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.pbxproj new file mode 100644 index 0000000..07e82f0 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD317C70169001EFB3D /* AVFoundation.framework */; }; + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */; }; + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */; }; + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1B17C6CE0A00A097E6 /* main.m */; }; + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */; }; + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2117C6CE0A00A097E6 /* Main.storyboard */; }; + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D2517C6CE0A00A097E6 /* ViewController.m */; }; + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2717C6CE0A00A097E6 /* Images.xcassets */; }; + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */; }; + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88E23D0417C6CE0A00A097E6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E23D0B17C6CE0A00A097E6; + remoteInfo = "Recipe 9-5: Displaying Camera Preview"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 882E7BD317C70169001EFB3D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-6 Capturing Still Images with AVCaptureSession.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88E23D1717C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist"; sourceTree = ""; }; + 88E23D1917C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D1B17C6CE0A00A097E6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch"; sourceTree = ""; }; + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88E23D2217C6CE0A00A097E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88E23D2417C6CE0A00A097E6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88E23D2517C6CE0A00A097E6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88E23D3617C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist"; sourceTree = ""; }; + 88E23D3817C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_5__Displaying_Camera_PreviewTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88E23D0917C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */, + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */, + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */, + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2A17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */, + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88E23D0317C6CE0A00A097E6 = { + isa = PBXGroup; + children = ( + 88E23D1517C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession */, + 88E23D3417C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests */, + 88E23D0E17C6CE0A00A097E6 /* Frameworks */, + 88E23D0D17C6CE0A00A097E6 /* Products */, + ); + sourceTree = ""; + }; + 88E23D0D17C6CE0A00A097E6 /* Products */ = { + isa = PBXGroup; + children = ( + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession.app */, + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88E23D0E17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */, + 882E7BD317C70169001EFB3D /* AVFoundation.framework */, + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */, + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */, + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */, + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88E23D1517C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession */ = { + isa = PBXGroup; + children = ( + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */, + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */, + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */, + 88E23D2417C6CE0A00A097E6 /* ViewController.h */, + 88E23D2517C6CE0A00A097E6 /* ViewController.m */, + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */, + 88E23D1617C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-6 Capturing Still Images with AVCaptureSession"; + path = "Recipe 9-5: Displaying Camera Preview"; + sourceTree = ""; + }; + 88E23D1617C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D1717C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist */, + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */, + 88E23D1B17C6CE0A00A097E6 /* main.m */, + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88E23D3417C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests */ = { + isa = PBXGroup; + children = ( + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */, + 88E23D3517C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests"; + path = "Recipe 9-5: Displaying Camera PreviewTests"; + sourceTree = ""; + }; + 88E23D3517C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D3617C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist */, + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-6 Capturing Still Images with AVCaptureSession" */; + buildPhases = ( + 88E23D0817C6CE0A00A097E6 /* Sources */, + 88E23D0917C6CE0A00A097E6 /* Frameworks */, + 88E23D0A17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-6 Capturing Still Images with AVCaptureSession"; + productName = "Recipe 9-5: Displaying Camera Preview"; + productReference = 88E23D0C17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession.app */; + productType = "com.apple.product-type.application"; + }; + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests" */; + buildPhases = ( + 88E23D2917C6CE0A00A097E6 /* Sources */, + 88E23D2A17C6CE0A00A097E6 /* Frameworks */, + 88E23D2B17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */, + ); + name = "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests"; + productName = "Recipe 9-5: Displaying Camera PreviewTests"; + productReference = 88E23D2D17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88E23D0417C6CE0A00A097E6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88E23D2C17C6CE0A00A097E6 = { + TestTargetID = 88E23D0B17C6CE0A00A097E6; + }; + }; + }; + buildConfigurationList = 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-6 Capturing Still Images with AVCaptureSession" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88E23D0317C6CE0A00A097E6; + productRefGroup = 88E23D0D17C6CE0A00A097E6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession */, + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSessionTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88E23D0A17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */, + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2B17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88E23D0817C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */, + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */, + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2917C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88E23D0B17C6CE0A00A097E6 /* Recipe 9-6 Capturing Still Images with AVCaptureSession */; + targetProxy = 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D1917C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88E23D2217C6CE0A00A097E6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D3817C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88E23D3C17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88E23D3D17C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88E23D3F17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist"; + PRODUCT_NAME = "Recipe 9-6 Capturing Still Images with AVCaptureSession"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88E23D4017C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-6 Capturing Still Images with AVCaptureSession-Info.plist"; + PRODUCT_NAME = "Recipe 9-6 Capturing Still Images with AVCaptureSession"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88E23D4217C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88E23D4317C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-6 Capturing Still Images with AVCaptureSessionTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-6 Capturing Still Images with AVCaptureSession" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3C17C6CE0A00A097E6 /* Debug */, + 88E23D3D17C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-6 Capturing Still Images with AVCaptureSession" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3F17C6CE0A00A097E6 /* Debug */, + 88E23D4017C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-6 Capturing Still Images with AVCaptureSessionTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D4217C6CE0A00A097E6 /* Debug */, + 88E23D4317C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88E23D0417C6CE0A00A097E6 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0fcc84f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..9158d07 Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..32311f6 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-6_ Capturing Still Images/Recipe 9-6 Capturing Still Images with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-6 Capturing Still Images with AVCaptureSession.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88E23D0B17C6CE0A00A097E6 + + primary + + + 88E23D2C17C6CE0A00A097E6 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h new file mode 100644 index 0000000..c59034b --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-7 Capturing Video with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m new file mode 100644 index 0000000..42fa38d --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-7 Capturing Video with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard new file mode 100644 index 0000000..6cad121 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist new file mode 100644 index 0000000..714bf22 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist @@ -0,0 +1,42 @@ + + + + + NSPhotoLibraryUsageDescription + Testing AVCaptureSession + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/ViewController.h b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/ViewController.h new file mode 100644 index 0000000..6d29061 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/ViewController.h @@ -0,0 +1,28 @@ +// +// ViewController.h +// Recipe 9-7 Capturing Video with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) AVCaptureSession *captureSession; +@property (strong, nonatomic) AVCaptureDeviceInput *videoInput; +@property (strong, nonatomic) AVCaptureDeviceInput *audioInput; +@property (strong, nonatomic) AVCaptureStillImageOutput *stillImageOutput; +@property (strong, nonatomic) AVCaptureMovieFileOutput *movieOutput; + +@property (weak, nonatomic) IBOutlet UIButton *captureButton; +@property (weak, nonatomic) IBOutlet UISegmentedControl *modeControl; + + +- (IBAction)capture:(id)sender; +- (IBAction)updateMode:(id)sender; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/ViewController.m b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/ViewController.m new file mode 100644 index 0000000..811ee1e --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/ViewController.m @@ -0,0 +1,277 @@ +// +// ViewController.m +// Recipe 9-7 Capturing Video with AVCaptureSession +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + + [super viewDidLoad]; + self.captureSession = [[AVCaptureSession alloc] init]; + //Optional: self.captureSession.sessionPreset = AVCaptureSessionPresetMedium; + + AVCaptureDevice *videoDevice = + [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + AVCaptureDevice *audioDevice = + [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; + + NSLog(@"%@",videoDevice.description); + + NSError *error = nil; + + self.videoInput = + [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:&error]; + self.audioInput = + [[AVCaptureDeviceInput alloc] initWithDevice:audioDevice error:&error]; + + + if (self.videoInput) + { + + self.stillImageOutput = [[AVCaptureStillImageOutput alloc] init]; + NSDictionary *stillImageOutputSettings = [[NSDictionary alloc] + initWithObjectsAndKeys:AVVideoCodecJPEG, AVVideoCodecKey, nil]; + [self.stillImageOutput setOutputSettings:stillImageOutputSettings]; + + self.movieOutput = [[AVCaptureMovieFileOutput alloc] init]; + + // Setup capture session for taking pictures + [self.captureSession addInput:self.videoInput]; + [self.captureSession addOutput:self.stillImageOutput]; + } + else + { + NSLog(@"Video Input Error: %@", error); + } + if (!self.videoInput) + { + NSLog(@"Audio Input Error: %@", error); + } + + + + + + AVCaptureVideoPreviewLayer *previewLayer = + [AVCaptureVideoPreviewLayer layerWithSession:self.captureSession]; + UIView *aView = self.view; + previewLayer.frame = + CGRectMake(0, 70, self.view.frame.size.width, self.view.frame.size.height-140); + [aView.layer addSublayer:previewLayer]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self.captureSession startRunning]; +} +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self.captureSession stopRunning]; +} + + +- (IBAction)capture:(id)sender +{ + if(self.modeControl.selectedSegmentIndex == 0) + { + //picture mode + [self captureStillImage]; + + } + else + { + //Video Mode + if (self.movieOutput.isRecording == YES) + { + [self.captureButton setTitle:@"Capture" forState:UIControlStateNormal]; + [self.movieOutput stopRecording]; + } + else + { + [self.captureButton setTitle:@"Stop" forState:UIControlStateNormal]; + [self.movieOutput startRecordingToOutputFileURL:[self tempFileURL] + recordingDelegate:self]; + } + } +} + +- (IBAction)updateMode:(id)sender +{ + [self.captureSession stopRunning]; + if (self.modeControl.selectedSegmentIndex == 0) + { + // Still Image Mode + if (self.movieOutput.isRecording == YES) + { + [self.movieOutput stopRecording]; + } + [self.captureSession removeInput:self.audioInput]; + [self.captureSession removeOutput:self.movieOutput]; + [self.captureSession addOutput:self.stillImageOutput]; + } + else + { + if([self.captureSession canAddInput:self.audioInput]) + { + // Video Mode + [self.captureSession removeOutput:self.stillImageOutput]; + [self.captureSession addInput:self.audioInput]; + [self.captureSession addOutput:self.movieOutput]; + + // Set orientation of capture connections to portrait + NSArray *array = [[self.captureSession.outputs objectAtIndex:0] connections]; + for (AVCaptureConnection *connection in array) + { + connection.videoOrientation = AVCaptureVideoOrientationPortrait; + } + } + else + { + self.modeControl.selectedSegmentIndex = 0; + NSLog(@"User turned off access to microphone"); + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Can't Access Audio" message:@"Verify microphone access is turned on in Settings->Privacy->Microphone" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + + } + } + [self.captureButton setTitle:@"Capture" forState:UIControlStateNormal]; + + [self.captureSession startRunning]; +} + +- (void) captureStillImage +{ + AVCaptureConnection *stillImageConnection = + [self.stillImageOutput.connections objectAtIndex:0]; + if ([stillImageConnection isVideoOrientationSupported]) + [stillImageConnection setVideoOrientation:AVCaptureVideoOrientationPortrait]; + + [self.stillImageOutput + captureStillImageAsynchronouslyFromConnection:stillImageConnection + completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) + { + if (imageDataSampleBuffer != NULL) + { + NSData *imageData = [AVCaptureStillImageOutput + jpegStillImageNSDataRepresentation:imageDataSampleBuffer]; + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + UIImage *image = [[UIImage alloc] initWithData:imageData]; + [library writeImageToSavedPhotosAlbum:[image CGImage] + orientation:(ALAssetOrientation)[image imageOrientation] + completionBlock:^(NSURL *assetURL, NSError *error) + { + UIAlertView *alert; + if (!error) + { + alert = [[UIAlertView alloc] initWithTitle:@"Photo Saved" + message:@"The photo was successfully saved to your photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + else + { + alert = [[UIAlertView alloc] initWithTitle:@"Error Saving Photo" + message:@"The photo was not saved to you photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + + [alert show]; + } + ]; + } + else + { + NSLog(@"Error capturing still image: %@", error); + } + } + ]; +} + +- (NSURL *) tempFileURL +{ + NSString *outputPath = [[NSString alloc] initWithFormat:@"%@%@", + NSTemporaryDirectory(), @"output.mov"]; + NSURL *outputURL = [[NSURL alloc] initFileURLWithPath:outputPath]; + NSFileManager *manager = [[NSFileManager alloc] init]; + if ([manager fileExistsAtPath:outputPath]) + { + [manager removeItemAtPath:outputPath error:nil]; + } + return outputURL; +} + +#pragma mark - Delegate Methods + +- (void)captureOutput:(AVCaptureFileOutput *)captureOutput +didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL + fromConnections:(NSArray *)connections + error:(NSError *)error +{ + BOOL recordedSuccessfully = YES; + if ([error code] != noErr) + { + // A problem occurred: Find out if the recording was successful. + id value = [[error userInfo] + objectForKey:AVErrorRecordingSuccessfullyFinishedKey]; + if (value) + recordedSuccessfully = [value boolValue]; + // Logging the problem anyway: + NSLog(@"A problem occurred while recording: %@", error); + } + if (recordedSuccessfully) + { + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + + [library writeVideoAtPathToSavedPhotosAlbum:outputFileURL + completionBlock:^(NSURL *assetURL, NSError *error) + { + UIAlertView *alert; + if (!error) + { + alert = [[UIAlertView alloc] initWithTitle:@"Video Saved" + message:@"The movie was successfully saved to you photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + else + { + alert = [[UIAlertView alloc] initWithTitle:@"Error Saving Video" + message:@"The movie was not saved to you photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + + [alert show]; + } + ]; + } +} + + + + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/main.m b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/main.m new file mode 100644 index 0000000..6103b98 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera Preview/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-5: Displaying Camera Preview +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m new file mode 100644 index 0000000..7ea7e54 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_5__Displaying_Camera_PreviewTests.m +// Recipe 9-5: Displaying Camera PreviewTests +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_5__Displaying_Camera_PreviewTests : XCTestCase + +@end + +@implementation Recipe_9_5__Displaying_Camera_PreviewTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9a2c0d5 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD317C70169001EFB3D /* AVFoundation.framework */; }; + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */; }; + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */; }; + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1B17C6CE0A00A097E6 /* main.m */; }; + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */; }; + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2117C6CE0A00A097E6 /* Main.storyboard */; }; + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D2517C6CE0A00A097E6 /* ViewController.m */; }; + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2717C6CE0A00A097E6 /* Images.xcassets */; }; + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */; }; + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88E23D0417C6CE0A00A097E6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E23D0B17C6CE0A00A097E6; + remoteInfo = "Recipe 9-5: Displaying Camera Preview"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 882E7BD317C70169001EFB3D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-7 Capturing Video with AVCaptureSession.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88E23D1717C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist"; sourceTree = ""; }; + 88E23D1917C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D1B17C6CE0A00A097E6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch"; sourceTree = ""; }; + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88E23D2217C6CE0A00A097E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88E23D2417C6CE0A00A097E6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88E23D2517C6CE0A00A097E6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-7 Capturing Video with AVCaptureSessionTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88E23D3617C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist"; sourceTree = ""; }; + 88E23D3817C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_5__Displaying_Camera_PreviewTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88E23D0917C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */, + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */, + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */, + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2A17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */, + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88E23D0317C6CE0A00A097E6 = { + isa = PBXGroup; + children = ( + 88E23D1517C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession */, + 88E23D3417C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests */, + 88E23D0E17C6CE0A00A097E6 /* Frameworks */, + 88E23D0D17C6CE0A00A097E6 /* Products */, + ); + sourceTree = ""; + }; + 88E23D0D17C6CE0A00A097E6 /* Products */ = { + isa = PBXGroup; + children = ( + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession.app */, + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88E23D0E17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */, + 882E7BD317C70169001EFB3D /* AVFoundation.framework */, + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */, + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */, + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */, + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88E23D1517C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession */ = { + isa = PBXGroup; + children = ( + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */, + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */, + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */, + 88E23D2417C6CE0A00A097E6 /* ViewController.h */, + 88E23D2517C6CE0A00A097E6 /* ViewController.m */, + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */, + 88E23D1617C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-7 Capturing Video with AVCaptureSession"; + path = "Recipe 9-5: Displaying Camera Preview"; + sourceTree = ""; + }; + 88E23D1617C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D1717C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist */, + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */, + 88E23D1B17C6CE0A00A097E6 /* main.m */, + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88E23D3417C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests */ = { + isa = PBXGroup; + children = ( + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */, + 88E23D3517C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-7 Capturing Video with AVCaptureSessionTests"; + path = "Recipe 9-5: Displaying Camera PreviewTests"; + sourceTree = ""; + }; + 88E23D3517C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D3617C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist */, + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-7 Capturing Video with AVCaptureSession" */; + buildPhases = ( + 88E23D0817C6CE0A00A097E6 /* Sources */, + 88E23D0917C6CE0A00A097E6 /* Frameworks */, + 88E23D0A17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-7 Capturing Video with AVCaptureSession"; + productName = "Recipe 9-5: Displaying Camera Preview"; + productReference = 88E23D0C17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession.app */; + productType = "com.apple.product-type.application"; + }; + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-7 Capturing Video with AVCaptureSessionTests" */; + buildPhases = ( + 88E23D2917C6CE0A00A097E6 /* Sources */, + 88E23D2A17C6CE0A00A097E6 /* Frameworks */, + 88E23D2B17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */, + ); + name = "Recipe 9-7 Capturing Video with AVCaptureSessionTests"; + productName = "Recipe 9-5: Displaying Camera PreviewTests"; + productReference = 88E23D2D17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88E23D0417C6CE0A00A097E6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88E23D2C17C6CE0A00A097E6 = { + TestTargetID = 88E23D0B17C6CE0A00A097E6; + }; + }; + }; + buildConfigurationList = 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-7 Capturing Video with AVCaptureSession" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88E23D0317C6CE0A00A097E6; + productRefGroup = 88E23D0D17C6CE0A00A097E6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession */, + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSessionTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88E23D0A17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */, + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2B17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88E23D0817C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */, + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */, + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2917C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88E23D0B17C6CE0A00A097E6 /* Recipe 9-7 Capturing Video with AVCaptureSession */; + targetProxy = 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D1917C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88E23D2217C6CE0A00A097E6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D3817C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88E23D3C17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88E23D3D17C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88E23D3F17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist"; + PRODUCT_NAME = "Recipe 9-7 Capturing Video with AVCaptureSession"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88E23D4017C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-7 Capturing Video with AVCaptureSession-Info.plist"; + PRODUCT_NAME = "Recipe 9-7 Capturing Video with AVCaptureSession"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88E23D4217C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-7 Capturing Video with AVCaptureSessionTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88E23D4317C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-7 Capturing Video with AVCaptureSessionTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-7 Capturing Video with AVCaptureSessionTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-7 Capturing Video with AVCaptureSession" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3C17C6CE0A00A097E6 /* Debug */, + 88E23D3D17C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-7 Capturing Video with AVCaptureSession" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3F17C6CE0A00A097E6 /* Debug */, + 88E23D4017C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-7 Capturing Video with AVCaptureSessionTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D4217C6CE0A00A097E6 /* Debug */, + 88E23D4317C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88E23D0417C6CE0A00A097E6 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..d664c33 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..9574d78 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8005525 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-7_ Capturing Video with AVCaptureSession/Recipe 9-7 Capturing Video with AVCaptureSession.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-5: Displaying Camera Preview.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88E23D0B17C6CE0A00A097E6 + + primary + + + 88E23D2C17C6CE0A00A097E6 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h new file mode 100644 index 0000000..dbc346d --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Recipe 9-8 Capturing Video Frames +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m new file mode 100644 index 0000000..255fb54 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-8 Capturing Video Frames +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard new file mode 100644 index 0000000..62f2f03 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Base.lproj/Main.storyboard @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Info.plist b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Info.plist new file mode 100644 index 0000000..2864f95 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Info.plist @@ -0,0 +1,42 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSPhotoLibraryUsageDescription + Testing AVCaptureSession + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/ViewController.h b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/ViewController.h new file mode 100644 index 0000000..d75b159 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/ViewController.h @@ -0,0 +1,29 @@ +// +// ViewController.h +// Recipe 9-8 Capturing Video Frames +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) AVCaptureSession *captureSession; +@property (strong, nonatomic) AVCaptureDeviceInput *videoInput; +@property (strong, nonatomic) AVCaptureDeviceInput *audioInput; +@property (strong, nonatomic) AVCaptureStillImageOutput *stillImageOutput; +@property (strong, nonatomic) AVCaptureMovieFileOutput *movieOutput; +@property (weak, nonatomic) IBOutlet UIImageView *thumbnailImageView; + +@property (weak, nonatomic) IBOutlet UIButton *captureButton; +@property (weak, nonatomic) IBOutlet UISegmentedControl *modeControl; + + +- (IBAction)capture:(id)sender; +- (IBAction)updateMode:(id)sender; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/ViewController.m b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/ViewController.m new file mode 100644 index 0000000..8e7a9b1 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/ViewController.m @@ -0,0 +1,304 @@ +// +// ViewController.m +// Recipe 9-8 Capturing Video Frames +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + + [super viewDidLoad]; + self.captureSession = [[AVCaptureSession alloc] init]; + //Optional: self.captureSession.sessionPreset = AVCaptureSessionPresetMedium; + + AVCaptureDevice *videoDevice = + [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + AVCaptureDevice *audioDevice = + [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; + + NSLog(@"%@",videoDevice.description); + + NSError *error = nil; + + self.videoInput = + [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:&error]; + self.audioInput = + [[AVCaptureDeviceInput alloc] initWithDevice:audioDevice error:&error]; + + + if (self.videoInput) + { + + self.stillImageOutput = [[AVCaptureStillImageOutput alloc] init]; + NSDictionary *stillImageOutputSettings = [[NSDictionary alloc] + initWithObjectsAndKeys:AVVideoCodecJPEG, AVVideoCodecKey, nil]; + [self.stillImageOutput setOutputSettings:stillImageOutputSettings]; + + self.movieOutput = [[AVCaptureMovieFileOutput alloc] init]; + + // Setup capture session for taking pictures + [self.captureSession addInput:self.videoInput]; + [self.captureSession addOutput:self.stillImageOutput]; + } + else + { + NSLog(@"Video Input Error: %@", error); + } + if (!self.videoInput) + { + NSLog(@"Audio Input Error: %@", error); + } + + + + + + AVCaptureVideoPreviewLayer *previewLayer = + [AVCaptureVideoPreviewLayer layerWithSession:self.captureSession]; + UIView *aView = self.view; + previewLayer.frame = + CGRectMake(0, 90, self.view.frame.size.width, self.view.frame.size.height-170); + [aView.layer addSublayer:previewLayer]; + +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self.captureSession startRunning]; +} +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self.captureSession stopRunning]; +} + + +- (IBAction)capture:(id)sender +{ + if(self.modeControl.selectedSegmentIndex == 0) + { + //picture mode + [self captureStillImage]; + + } + else + { + //Video Mode + if (self.movieOutput.isRecording == YES) + { + [self.captureButton setTitle:@"Capture" forState:UIControlStateNormal]; + [self.movieOutput stopRecording]; + } + else + { + [self.captureButton setTitle:@"Stop" forState:UIControlStateNormal]; + [self.movieOutput startRecordingToOutputFileURL:[self tempFileURL] + recordingDelegate:self]; + } + } +} + +- (IBAction)updateMode:(id)sender +{ + [self.captureSession stopRunning]; + if (self.modeControl.selectedSegmentIndex == 0) + { + // Still Image Mode + if (self.movieOutput.isRecording == YES) + { + [self.movieOutput stopRecording]; + } + [self.captureSession removeInput:self.audioInput]; + [self.captureSession removeOutput:self.movieOutput]; + [self.captureSession addOutput:self.stillImageOutput]; + } + else + { + if([self.captureSession canAddInput:self.audioInput]) + { + // Video Mode + [self.captureSession removeOutput:self.stillImageOutput]; + [self.captureSession addInput:self.audioInput]; + [self.captureSession addOutput:self.movieOutput]; + + // Set orientation of capture connections to portrait + NSArray *array = [[self.captureSession.outputs objectAtIndex:0] connections]; + for (AVCaptureConnection *connection in array) + { + connection.videoOrientation = AVCaptureVideoOrientationPortrait; + } + } + else + { + self.modeControl.selectedSegmentIndex = 0; + NSLog(@"User turned off access to microphone"); + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Can't Access Audio" message:@"Verify microphone access is turned on in Settings->Privacy->Microphone" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + + } + } + [self.captureButton setTitle:@"Capture" forState:UIControlStateNormal]; + + [self.captureSession startRunning]; +} + +- (void) captureStillImage +{ + AVCaptureConnection *stillImageConnection = + [self.stillImageOutput.connections objectAtIndex:0]; + if ([stillImageConnection isVideoOrientationSupported]) + [stillImageConnection setVideoOrientation:AVCaptureVideoOrientationPortrait]; + + [self.stillImageOutput + captureStillImageAsynchronouslyFromConnection:stillImageConnection + completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) + { + if (imageDataSampleBuffer != NULL) + { + NSData *imageData = [AVCaptureStillImageOutput + jpegStillImageNSDataRepresentation:imageDataSampleBuffer]; + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + UIImage *image = [[UIImage alloc] initWithData:imageData]; + [library writeImageToSavedPhotosAlbum:[image CGImage] + orientation:(ALAssetOrientation)[image imageOrientation] + completionBlock:^(NSURL *assetURL, NSError *error) + { + UIAlertView *alert; + if (!error) + { + alert = [[UIAlertView alloc] initWithTitle:@"Photo Saved" + message:@"The photo was successfully saved to your photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + else + { + alert = [[UIAlertView alloc] initWithTitle:@"Error Saving Photo" + message:@"The photo was not saved to you photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + + [alert show]; + } + ]; + } + else + { + NSLog(@"Error capturing still image: %@", error); + } + } + ]; +} + +- (NSURL *) tempFileURL +{ + NSString *outputPath = [[NSString alloc] initWithFormat:@"%@%@", + NSTemporaryDirectory(), @"output.mov"]; + NSURL *outputURL = [[NSURL alloc] initFileURLWithPath:outputPath]; + NSFileManager *manager = [[NSFileManager alloc] init]; + if ([manager fileExistsAtPath:outputPath]) + { + [manager removeItemAtPath:outputPath error:nil]; + } + return outputURL; +} + +#pragma mark - Delegate Methods + +- (void)captureOutput:(AVCaptureFileOutput *)captureOutput +didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL + fromConnections:(NSArray *)connections + error:(NSError *)error +{ + BOOL recordedSuccessfully = YES; + if ([error code] != noErr) + { + // A problem occurred: Find out if the recording was successful. + id value = [[error userInfo] + objectForKey:AVErrorRecordingSuccessfullyFinishedKey]; + if (value) + recordedSuccessfully = [value boolValue]; + // Logging the problem anyway: + NSLog(@"A problem occurred while recording: %@", error); + } + if (recordedSuccessfully) + { + [self createThumbnailForVideoURL:outputFileURL]; + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + + [library writeVideoAtPathToSavedPhotosAlbum:outputFileURL + completionBlock:^(NSURL *assetURL, NSError *error) + { + UIAlertView *alert; + if (!error) + { + alert = [[UIAlertView alloc] initWithTitle:@"Video Saved" + message:@"The movie was successfully saved to you photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + else + { + alert = [[UIAlertView alloc] initWithTitle:@"Error Saving Video" + message:@"The movie was not saved to you photos library" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil, nil]; + } + + [alert show]; + } + ]; + } +} + +-(void)createThumbnailForVideoURL:(NSURL *)videoURL +{ + AVURLAsset *myAsset = [[AVURLAsset alloc] initWithURL:videoURL options:[NSDictionary dictionaryWithObject:@"YES" forKey:AVURLAssetPreferPreciseDurationAndTimingKey]]; + + AVAssetImageGenerator *imageGenerator = + [AVAssetImageGenerator assetImageGeneratorWithAsset:myAsset]; + //Make sure images are correctly rotated. + imageGenerator.appliesPreferredTrackTransform = YES; + Float64 durationSeconds = CMTimeGetSeconds([myAsset duration]); + CMTime half = CMTimeMakeWithSeconds(durationSeconds/2.0, 600); + NSArray *times = [NSArray arrayWithObjects: [NSValue valueWithCMTime:half], nil]; + + [imageGenerator generateCGImagesAsynchronouslyForTimes:times + completionHandler:^(CMTime requestedTime, CGImageRef image, CMTime actualTime, + AVAssetImageGeneratorResult result, NSError *error) + { + if (result == AVAssetImageGeneratorSucceeded) + { + self.thumbnailImageView.image = [UIImage imageWithCGImage:image]; + } + else if (result == AVAssetImageGeneratorFailed) + { + NSLog(@"Failed with error: %@", [error localizedDescription]); + } + } + ]; +} + + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/main.m b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/main.m new file mode 100644 index 0000000..6103b98 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera Preview/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-5: Displaying Camera Preview +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-8 Capturing Video FramesTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-8 Capturing Video FramesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/Recipe 9-8 Capturing Video FramesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m new file mode 100644 index 0000000..7ea7e54 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/Recipe_9_5__Displaying_Camera_PreviewTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_5__Displaying_Camera_PreviewTests.m +// Recipe 9-5: Displaying Camera PreviewTests +// +// Created by joseph hoffman on 8/22/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_5__Displaying_Camera_PreviewTests : XCTestCase + +@end + +@implementation Recipe_9_5__Displaying_Camera_PreviewTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-5_ Displaying Camera PreviewTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.pbxproj new file mode 100644 index 0000000..17e73e0 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD317C70169001EFB3D /* AVFoundation.framework */; }; + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */; }; + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */; }; + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1B17C6CE0A00A097E6 /* main.m */; }; + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */; }; + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2117C6CE0A00A097E6 /* Main.storyboard */; }; + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D2517C6CE0A00A097E6 /* ViewController.m */; }; + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D2717C6CE0A00A097E6 /* Images.xcassets */; }; + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */; }; + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */; }; + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E23D1317C6CE0A00A097E6 /* UIKit.framework */; }; + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */; }; + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 88E23D0417C6CE0A00A097E6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E23D0B17C6CE0A00A097E6; + remoteInfo = "Recipe 9-5: Displaying Camera Preview"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 882E7BD317C70169001EFB3D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-8 Capturing Video Frames.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 88E23D1717C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-8 Capturing Video Frames-Info.plist"; sourceTree = ""; }; + 88E23D1917C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D1B17C6CE0A00A097E6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-8 Capturing Video Frames-Prefix.pch"; sourceTree = ""; }; + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 88E23D2217C6CE0A00A097E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 88E23D2417C6CE0A00A097E6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 88E23D2517C6CE0A00A097E6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-8 Capturing Video FramesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 88E23D3617C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-8 Capturing Video FramesTests-Info.plist"; sourceTree = ""; }; + 88E23D3817C6CE0A00A097E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_5__Displaying_Camera_PreviewTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 88E23D0917C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 882E7BD617C70519001EFB3D /* AssetsLibrary.framework in Frameworks */, + 882E7BD417C70169001EFB3D /* AVFoundation.framework in Frameworks */, + 88E23D1217C6CE0A00A097E6 /* CoreGraphics.framework in Frameworks */, + 88E23D1417C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D1017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2A17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2F17C6CE0A00A097E6 /* XCTest.framework in Frameworks */, + 88E23D3117C6CE0A00A097E6 /* UIKit.framework in Frameworks */, + 88E23D3017C6CE0A00A097E6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 88E23D0317C6CE0A00A097E6 = { + isa = PBXGroup; + children = ( + 88E23D1517C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames */, + 88E23D3417C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests */, + 88E23D0E17C6CE0A00A097E6 /* Frameworks */, + 88E23D0D17C6CE0A00A097E6 /* Products */, + ); + sourceTree = ""; + }; + 88E23D0D17C6CE0A00A097E6 /* Products */ = { + isa = PBXGroup; + children = ( + 88E23D0C17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames.app */, + 88E23D2D17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 88E23D0E17C6CE0A00A097E6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 882E7BD517C70519001EFB3D /* AssetsLibrary.framework */, + 882E7BD317C70169001EFB3D /* AVFoundation.framework */, + 88E23D0F17C6CE0A00A097E6 /* Foundation.framework */, + 88E23D1117C6CE0A00A097E6 /* CoreGraphics.framework */, + 88E23D1317C6CE0A00A097E6 /* UIKit.framework */, + 88E23D2E17C6CE0A00A097E6 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 88E23D1517C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames */ = { + isa = PBXGroup; + children = ( + 88E23D1E17C6CE0A00A097E6 /* AppDelegate.h */, + 88E23D1F17C6CE0A00A097E6 /* AppDelegate.m */, + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */, + 88E23D2417C6CE0A00A097E6 /* ViewController.h */, + 88E23D2517C6CE0A00A097E6 /* ViewController.m */, + 88E23D2717C6CE0A00A097E6 /* Images.xcassets */, + 88E23D1617C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-8 Capturing Video Frames"; + path = "Recipe 9-5: Displaying Camera Preview"; + sourceTree = ""; + }; + 88E23D1617C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D1717C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames-Info.plist */, + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */, + 88E23D1B17C6CE0A00A097E6 /* main.m */, + 88E23D1D17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 88E23D3417C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests */ = { + isa = PBXGroup; + children = ( + 88E23D3A17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m */, + 88E23D3517C6CE0A00A097E6 /* Supporting Files */, + ); + name = "Recipe 9-8 Capturing Video FramesTests"; + path = "Recipe 9-5: Displaying Camera PreviewTests"; + sourceTree = ""; + }; + 88E23D3517C6CE0A00A097E6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 88E23D3617C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests-Info.plist */, + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-8 Capturing Video Frames" */; + buildPhases = ( + 88E23D0817C6CE0A00A097E6 /* Sources */, + 88E23D0917C6CE0A00A097E6 /* Frameworks */, + 88E23D0A17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-8 Capturing Video Frames"; + productName = "Recipe 9-5: Displaying Camera Preview"; + productReference = 88E23D0C17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames.app */; + productType = "com.apple.product-type.application"; + }; + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-8 Capturing Video FramesTests" */; + buildPhases = ( + 88E23D2917C6CE0A00A097E6 /* Sources */, + 88E23D2A17C6CE0A00A097E6 /* Frameworks */, + 88E23D2B17C6CE0A00A097E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */, + ); + name = "Recipe 9-8 Capturing Video FramesTests"; + productName = "Recipe 9-5: Displaying Camera PreviewTests"; + productReference = 88E23D2D17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 88E23D0417C6CE0A00A097E6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 88E23D2C17C6CE0A00A097E6 = { + TestTargetID = 88E23D0B17C6CE0A00A097E6; + }; + }; + }; + buildConfigurationList = 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-8 Capturing Video Frames" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 88E23D0317C6CE0A00A097E6; + productRefGroup = 88E23D0D17C6CE0A00A097E6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E23D0B17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames */, + 88E23D2C17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video FramesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 88E23D0A17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2817C6CE0A00A097E6 /* Images.xcassets in Resources */, + 88E23D1A17C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + 88E23D2317C6CE0A00A097E6 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2B17C6CE0A00A097E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3917C6CE0A00A097E6 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 88E23D0817C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D2617C6CE0A00A097E6 /* ViewController.m in Sources */, + 88E23D2017C6CE0A00A097E6 /* AppDelegate.m in Sources */, + 88E23D1C17C6CE0A00A097E6 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 88E23D2917C6CE0A00A097E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 88E23D3B17C6CE0A00A097E6 /* Recipe_9_5__Displaying_Camera_PreviewTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 88E23D3317C6CE0A00A097E6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 88E23D0B17C6CE0A00A097E6 /* Recipe 9-8 Capturing Video Frames */; + targetProxy = 88E23D3217C6CE0A00A097E6 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 88E23D1817C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D1917C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 88E23D2117C6CE0A00A097E6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 88E23D2217C6CE0A00A097E6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 88E23D3717C6CE0A00A097E6 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 88E23D3817C6CE0A00A097E6 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 88E23D3C17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 88E23D3D17C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 88E23D3F17C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Info.plist"; + PRODUCT_NAME = "Recipe 9-8 Capturing Video Frames"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 88E23D4017C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera Preview/Recipe 9-8 Capturing Video Frames-Info.plist"; + PRODUCT_NAME = "Recipe 9-8 Capturing Video Frames"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 88E23D4217C6CE0A00A097E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-8 Capturing Video FramesTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-8 Capturing Video FramesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 88E23D4317C6CE0A00A097E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-5: Displaying Camera Preview.app/Recipe 9-5: Displaying Camera Preview"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-5: Displaying Camera Preview/Recipe 9-5: Displaying Camera Preview-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-5: Displaying Camera PreviewTests/Recipe 9-8 Capturing Video FramesTests-Info.plist"; + PRODUCT_NAME = "Recipe 9-8 Capturing Video FramesTests"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 88E23D0717C6CE0A00A097E6 /* Build configuration list for PBXProject "Recipe 9-8 Capturing Video Frames" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3C17C6CE0A00A097E6 /* Debug */, + 88E23D3D17C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D3E17C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-8 Capturing Video Frames" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D3F17C6CE0A00A097E6 /* Debug */, + 88E23D4017C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 88E23D4117C6CE0A00A097E6 /* Build configuration list for PBXNativeTarget "Recipe 9-8 Capturing Video FramesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 88E23D4217C6CE0A00A097E6 /* Debug */, + 88E23D4317C6CE0A00A097E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 88E23D0417C6CE0A00A097E6 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..d65e8e2 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..f204f5d Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..9574d78 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-8 Capturing Video Frames.xcscheme b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-8 Capturing Video Frames.xcscheme new file mode 100644 index 0000000..5740a71 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/Recipe 9-8 Capturing Video Frames.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..3c0d0fa --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-8_ Capturing Video Frames/Recipe 9-8 Capturing Video Frames.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-8 Capturing Video Frames.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 88E23D0B17C6CE0A00A097E6 + + primary + + + 88E23D2C17C6CE0A00A097E6 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.pbxproj b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.pbxproj new file mode 100644 index 0000000..537ecd6 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.pbxproj @@ -0,0 +1,477 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 885F847F17CACC4600590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F847E17CACC4600590488 /* Foundation.framework */; }; + 885F848117CACC4600590488 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F848017CACC4600590488 /* CoreGraphics.framework */; }; + 885F848317CACC4600590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F848217CACC4600590488 /* UIKit.framework */; }; + 885F848917CACC4600590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F848717CACC4600590488 /* InfoPlist.strings */; }; + 885F848B17CACC4600590488 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F848A17CACC4600590488 /* main.m */; }; + 885F848F17CACC4600590488 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F848E17CACC4600590488 /* AppDelegate.m */; }; + 885F849217CACC4600590488 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 885F849017CACC4600590488 /* Main.storyboard */; }; + 885F849517CACC4600590488 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F849417CACC4600590488 /* ViewController.m */; }; + 885F849717CACC4600590488 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 885F849617CACC4600590488 /* Images.xcassets */; }; + 885F849E17CACC4700590488 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F849D17CACC4700590488 /* XCTest.framework */; }; + 885F849F17CACC4700590488 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F847E17CACC4600590488 /* Foundation.framework */; }; + 885F84A017CACC4700590488 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F848217CACC4600590488 /* UIKit.framework */; }; + 885F84A817CACC4700590488 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 885F84A617CACC4700590488 /* InfoPlist.strings */; }; + 885F84AA17CACC4700590488 /* Recipe_9_10_Capturing_Machine_Readable_CodesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 885F84A917CACC4700590488 /* Recipe_9_10_Capturing_Machine_Readable_CodesTests.m */; }; + 885F84B417CACE1F00590488 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84B317CACE1F00590488 /* AssetsLibrary.framework */; }; + 885F84B617CACE2700590488 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885F84B517CACE2700590488 /* AVFoundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 885F84A117CACC4700590488 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 885F847317CACC4600590488 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 885F847A17CACC4600590488; + remoteInfo = "Recipe 9-10 Capturing Machine Readable Codes"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 885F847B17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recipe 9-10 Capturing Machine Readable Codes.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F847E17CACC4600590488 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 885F848017CACC4600590488 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 885F848217CACC4600590488 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 885F848617CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-10 Capturing Machine Readable Codes-Info.plist"; sourceTree = ""; }; + 885F848817CACC4600590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F848A17CACC4600590488 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 885F848C17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch"; sourceTree = ""; }; + 885F848D17CACC4600590488 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 885F848E17CACC4600590488 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 885F849117CACC4600590488 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 885F849317CACC4600590488 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 885F849417CACC4600590488 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 885F849617CACC4600590488 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 885F849C17CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recipe 9-10 Capturing Machine Readable CodesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 885F849D17CACC4700590488 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 885F84A517CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist"; sourceTree = ""; }; + 885F84A717CACC4700590488 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 885F84A917CACC4700590488 /* Recipe_9_10_Capturing_Machine_Readable_CodesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Recipe_9_10_Capturing_Machine_Readable_CodesTests.m; sourceTree = ""; }; + 885F84B317CACE1F00590488 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; + 885F84B517CACE2700590488 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 885F847817CACC4600590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84B617CACE2700590488 /* AVFoundation.framework in Frameworks */, + 885F84B417CACE1F00590488 /* AssetsLibrary.framework in Frameworks */, + 885F848117CACC4600590488 /* CoreGraphics.framework in Frameworks */, + 885F848317CACC4600590488 /* UIKit.framework in Frameworks */, + 885F847F17CACC4600590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F849917CACC4700590488 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F849E17CACC4700590488 /* XCTest.framework in Frameworks */, + 885F84A017CACC4700590488 /* UIKit.framework in Frameworks */, + 885F849F17CACC4700590488 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 885F847217CACC4600590488 = { + isa = PBXGroup; + children = ( + 885F848417CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes */, + 885F84A317CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests */, + 885F847D17CACC4600590488 /* Frameworks */, + 885F847C17CACC4600590488 /* Products */, + ); + sourceTree = ""; + }; + 885F847C17CACC4600590488 /* Products */ = { + isa = PBXGroup; + children = ( + 885F847B17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes.app */, + 885F849C17CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 885F847D17CACC4600590488 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 885F84B517CACE2700590488 /* AVFoundation.framework */, + 885F84B317CACE1F00590488 /* AssetsLibrary.framework */, + 885F847E17CACC4600590488 /* Foundation.framework */, + 885F848017CACC4600590488 /* CoreGraphics.framework */, + 885F848217CACC4600590488 /* UIKit.framework */, + 885F849D17CACC4700590488 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 885F848417CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes */ = { + isa = PBXGroup; + children = ( + 885F848D17CACC4600590488 /* AppDelegate.h */, + 885F848E17CACC4600590488 /* AppDelegate.m */, + 885F849017CACC4600590488 /* Main.storyboard */, + 885F849317CACC4600590488 /* ViewController.h */, + 885F849417CACC4600590488 /* ViewController.m */, + 885F849617CACC4600590488 /* Images.xcassets */, + 885F848517CACC4600590488 /* Supporting Files */, + ); + path = "Recipe 9-10 Capturing Machine Readable Codes"; + sourceTree = ""; + }; + 885F848517CACC4600590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F848617CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes-Info.plist */, + 885F848717CACC4600590488 /* InfoPlist.strings */, + 885F848A17CACC4600590488 /* main.m */, + 885F848C17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 885F84A317CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests */ = { + isa = PBXGroup; + children = ( + 885F84A917CACC4700590488 /* Recipe_9_10_Capturing_Machine_Readable_CodesTests.m */, + 885F84A417CACC4700590488 /* Supporting Files */, + ); + path = "Recipe 9-10 Capturing Machine Readable CodesTests"; + sourceTree = ""; + }; + 885F84A417CACC4700590488 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 885F84A517CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist */, + 885F84A617CACC4700590488 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 885F847A17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F84AD17CACC4700590488 /* Build configuration list for PBXNativeTarget "Recipe 9-10 Capturing Machine Readable Codes" */; + buildPhases = ( + 885F847717CACC4600590488 /* Sources */, + 885F847817CACC4600590488 /* Frameworks */, + 885F847917CACC4600590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Recipe 9-10 Capturing Machine Readable Codes"; + productName = "Recipe 9-10 Capturing Machine Readable Codes"; + productReference = 885F847B17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes.app */; + productType = "com.apple.product-type.application"; + }; + 885F849B17CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 885F84B017CACC4700590488 /* Build configuration list for PBXNativeTarget "Recipe 9-10 Capturing Machine Readable CodesTests" */; + buildPhases = ( + 885F849817CACC4700590488 /* Sources */, + 885F849917CACC4700590488 /* Frameworks */, + 885F849A17CACC4700590488 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 885F84A217CACC4700590488 /* PBXTargetDependency */, + ); + name = "Recipe 9-10 Capturing Machine Readable CodesTests"; + productName = "Recipe 9-10 Capturing Machine Readable CodesTests"; + productReference = 885F849C17CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 885F847317CACC4600590488 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = NSCookbook; + TargetAttributes = { + 885F849B17CACC4700590488 = { + TestTargetID = 885F847A17CACC4600590488; + }; + }; + }; + buildConfigurationList = 885F847617CACC4600590488 /* Build configuration list for PBXProject "Recipe 9-10 Capturing Machine Readable Codes" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 885F847217CACC4600590488; + productRefGroup = 885F847C17CACC4600590488 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 885F847A17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes */, + 885F849B17CACC4700590488 /* Recipe 9-10 Capturing Machine Readable CodesTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 885F847917CACC4600590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F849717CACC4600590488 /* Images.xcassets in Resources */, + 885F848917CACC4600590488 /* InfoPlist.strings in Resources */, + 885F849217CACC4600590488 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F849A17CACC4700590488 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84A817CACC4700590488 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 885F847717CACC4600590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F849517CACC4600590488 /* ViewController.m in Sources */, + 885F848F17CACC4600590488 /* AppDelegate.m in Sources */, + 885F848B17CACC4600590488 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 885F849817CACC4700590488 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 885F84AA17CACC4700590488 /* Recipe_9_10_Capturing_Machine_Readable_CodesTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 885F84A217CACC4700590488 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 885F847A17CACC4600590488 /* Recipe 9-10 Capturing Machine Readable Codes */; + targetProxy = 885F84A117CACC4700590488 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 885F848717CACC4600590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F848817CACC4600590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 885F849017CACC4600590488 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 885F849117CACC4600590488 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 885F84A617CACC4700590488 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 885F84A717CACC4700590488 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 885F84AB17CACC4700590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 885F84AC17CACC4700590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 885F84AE17CACC4700590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 885F84AF17CACC4700590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 885F84B117CACC4700590488 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-10 Capturing Machine Readable Codes.app/Recipe 9-10 Capturing Machine Readable Codes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Recipe 9-10 Capturing Machine Readable CodesTests/Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 885F84B217CACC4700590488 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Recipe 9-10 Capturing Machine Readable Codes.app/Recipe 9-10 Capturing Machine Readable Codes"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch"; + INFOPLIST_FILE = "Recipe 9-10 Capturing Machine Readable CodesTests/Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 885F847617CACC4600590488 /* Build configuration list for PBXProject "Recipe 9-10 Capturing Machine Readable Codes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F84AB17CACC4700590488 /* Debug */, + 885F84AC17CACC4700590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 885F84AD17CACC4700590488 /* Build configuration list for PBXNativeTarget "Recipe 9-10 Capturing Machine Readable Codes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F84AE17CACC4700590488 /* Debug */, + 885F84AF17CACC4700590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 885F84B017CACC4700590488 /* Build configuration list for PBXNativeTarget "Recipe 9-10 Capturing Machine Readable CodesTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 885F84B117CACC4700590488 /* Debug */, + 885F84B217CACC4700590488 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 885F847317CACC4600590488 /* Project object */; +} diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..721243a --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..6c61873 Binary files /dev/null and b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/project.xcworkspace/xcuserdata/josephhoffman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..64f1d39 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..28151e2 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes.xcodeproj/xcuserdata/josephhoffman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Recipe 9-10 Capturing Machine Readable Codes.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 885F847A17CACC4600590488 + + primary + + + 885F849B17CACC4700590488 + + primary + + + + + diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/AppDelegate.h b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/AppDelegate.h new file mode 100644 index 0000000..5b088a8 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/AppDelegate.h @@ -0,0 +1,16 @@ +// +// AppDelegate.h +// Recipe 9-10 Capturing Machine Readable Codes +// +// Created by joseph hoffman on 8/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/AppDelegate.m b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/AppDelegate.m new file mode 100644 index 0000000..c5ec779 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// Recipe 9-10 Capturing Machine Readable Codes +// +// Created by joseph hoffman on 8/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Base.lproj/Main.storyboard b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bd16450 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Base.lproj/Main.storyboard @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Images.xcassets/AppIcon.appiconset/Contents.json b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Images.xcassets/LaunchImage.launchimage/Contents.json b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Info.plist b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Info.plist new file mode 100644 index 0000000..d014a4c --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/ViewController.h b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/ViewController.h new file mode 100644 index 0000000..810310c --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/ViewController.h @@ -0,0 +1,19 @@ +// +// ViewController.h +// Recipe 9-10 Capturing Machine Readable Codes +// +// Created by joseph hoffman on 8/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import +#import + +@interface ViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UILabel *codeLabel; +@property (strong, nonatomic) AVCaptureSession *captureSession; +@property (strong, nonatomic) AVCaptureDeviceInput *videoInput; +@property (strong, nonatomic) AVCaptureMetadataOutput *metadataOutput; + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/ViewController.m b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/ViewController.m new file mode 100644 index 0000000..9932ee5 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/ViewController.m @@ -0,0 +1,95 @@ +// +// ViewController.m +// Recipe 9-10 Capturing Machine Readable Codes +// +// Created by joseph hoffman on 8/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + self.captureSession = [[AVCaptureSession alloc] init]; + + + AVCaptureDevice *device = + [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + + NSError *error = nil; + self.videoInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error]; + if (self.videoInput) + { + [self.captureSession addInput:self.videoInput]; + } + else + { + NSLog(@"Input Error: %@", error); + } + + self.metadataOutput = [[AVCaptureMetadataOutput alloc] init]; + [self.captureSession addOutput:self.metadataOutput]; + + [self.metadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()]; + + self.metadataOutput.metadataObjectTypes = @[AVMetadataObjectTypeUPCECode, AVMetadataObjectTypeQRCode]; + + + AVCaptureVideoPreviewLayer *previewLayer = + [AVCaptureVideoPreviewLayer layerWithSession:self.captureSession]; + UIView *aView = self.view; + previewLayer.frame = + CGRectMake(0, 20, self.view.frame.size.width, + self.view.frame.size.height-100); + [aView.layer addSublayer:previewLayer]; + + +} +-(void)viewDidDisappear:(BOOL)animated +{ + [self.captureSession stopRunning]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self.captureSession startRunning]; +} +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self.captureSession stopRunning]; +} + + +#pragma mark - delegate methods + +- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection +{ + + for (AVMetadataMachineReadableCodeObject *object in metadataObjects) { + + + self.codeLabel.text = [NSString stringWithFormat:@" Type - %@: Value - %@",object.type,object.stringValue]; + } + + + +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/main.m b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/main.m new file mode 100644 index 0000000..93cd6ed --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable Codes/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Recipe 9-10 Capturing Machine Readable Codes +// +// Created by joseph hoffman on 8/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist new file mode 100644 index 0000000..72de0b3 --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/Recipe 9-10 Capturing Machine Readable CodesTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + NSCookbook.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/Recipe_9_10_Capturing_Machine_Readable_CodesTests.m b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/Recipe_9_10_Capturing_Machine_Readable_CodesTests.m new file mode 100644 index 0000000..35971fd --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/Recipe_9_10_Capturing_Machine_Readable_CodesTests.m @@ -0,0 +1,34 @@ +// +// Recipe_9_10_Capturing_Machine_Readable_CodesTests.m +// Recipe 9-10 Capturing Machine Readable CodesTests +// +// Created by joseph hoffman on 8/25/13. +// Copyright (c) 2013 NSCookbook. All rights reserved. +// + +#import + +@interface Recipe_9_10_Capturing_Machine_Readable_CodesTests : XCTestCase + +@end + +@implementation Recipe_9_10_Capturing_Machine_Readable_CodesTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/en.lproj/InfoPlist.strings b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/CH9 - Camera Recipes/Recipe 9-9 Capturing Machine Readable Codes/Recipe 9-10 Capturing Machine Readable CodesTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..ac74dbf --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Freeware License, some rights reserved + +Copyright (c) 2013 Hans-Eric Grnlund, Joseph Hoffman, Shawn Grimes, and Colin Francis + +Permission is hereby granted, free of charge, to anyone obtaining a copy +of this software and associated documentation files (the "Software"), +to work with the Software within the limits of freeware distribution and fair use. +This includes the rights to use, copy, and modify the Software for personal use. +Users are also allowed and encouraged to submit corrections and modifications +to the Software for the benefit of other users. + +It is not allowed to reuse, modify, or redistribute the Software for +commercial use in any way, or for a users educational materials such as books +or blog articles without prior permission from the copyright holder. + +The above copyright notice and this permission notice need to be included +in all copies or substantial portions of the software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..7f15ec7 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +#Apress Source Code + +This repository accompanies [*iOS 7 Development Recipes*](http://www.apress.com/9781430259596) by Hans-Eric Grnlund, Joseph Hoffman, Shawn Grimes, and Colin Francis (Apress, 2013). + +![Cover image](9781430259596.jpg) + +Download the files as a zip using the green button, or clone the repository to your machine using Git. + +##Releases + +Release v1.0 corresponds to the code in the published book, without corrections or updates. + +##Contributions + +See the file Contributing.md for more information on how you can contribute to this repository. diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..f6005ad --- /dev/null +++ b/contributing.md @@ -0,0 +1,14 @@ +# Contributing to Apress Source Code + +Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. + +## How to Contribute + +1. Make sure you have a GitHub account. +2. Fork the repository for the relevant book. +3. Create a new branch on which to make your change, e.g. +`git checkout -b my_code_contribution` +4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. +5. Submit a pull request. + +Thank you for your contribution! \ No newline at end of file