Skip to content

Commit

Permalink
Sample code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
subdigital committed Jan 10, 2013
1 parent 6f2dc26 commit e9f13af
Show file tree
Hide file tree
Showing 20 changed files with 736 additions and 0 deletions.
287 changes: 287 additions & 0 deletions 048-code-snippets/SnippetFun/SnippetFun.xcodeproj/project.pbxproj
@@ -0,0 +1,287 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
B5514511169A2A0900A81BF8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5514510169A2A0900A81BF8 /* UIKit.framework */; };
B5514513169A2A0900A81BF8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5514512169A2A0900A81BF8 /* Foundation.framework */; };
B5514515169A2A0900A81BF8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5514514169A2A0900A81BF8 /* CoreGraphics.framework */; };
B551451B169A2A0900A81BF8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B5514519169A2A0900A81BF8 /* InfoPlist.strings */; };
B551451D169A2A0900A81BF8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B551451C169A2A0900A81BF8 /* main.m */; };
B5514521169A2A0900A81BF8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B5514520169A2A0900A81BF8 /* AppDelegate.m */; };
B5514523169A2A0900A81BF8 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = B5514522169A2A0900A81BF8 /* Default.png */; };
B5514525169A2A0900A81BF8 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B5514524169A2A0900A81BF8 /* Default@2x.png */; };
B5514527169A2A0900A81BF8 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B5514526169A2A0900A81BF8 /* Default-568h@2x.png */; };
B551452F169A2A4700A81BF8 /* MyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B551452E169A2A4700A81BF8 /* MyViewController.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
B551450C169A2A0900A81BF8 /* SnippetFun.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SnippetFun.app; sourceTree = BUILT_PRODUCTS_DIR; };
B5514510169A2A0900A81BF8 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
B5514512169A2A0900A81BF8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
B5514514169A2A0900A81BF8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
B5514518169A2A0900A81BF8 /* SnippetFun-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SnippetFun-Info.plist"; sourceTree = "<group>"; };
B551451A169A2A0900A81BF8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
B551451C169A2A0900A81BF8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
B551451E169A2A0900A81BF8 /* SnippetFun-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SnippetFun-Prefix.pch"; sourceTree = "<group>"; };
B551451F169A2A0900A81BF8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
B5514520169A2A0900A81BF8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
B5514522169A2A0900A81BF8 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
B5514524169A2A0900A81BF8 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
B5514526169A2A0900A81BF8 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
B551452D169A2A4700A81BF8 /* MyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyViewController.h; sourceTree = "<group>"; };
B551452E169A2A4700A81BF8 /* MyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
B5514509169A2A0900A81BF8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B5514511169A2A0900A81BF8 /* UIKit.framework in Frameworks */,
B5514513169A2A0900A81BF8 /* Foundation.framework in Frameworks */,
B5514515169A2A0900A81BF8 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
B5514501169A2A0900A81BF8 = {
isa = PBXGroup;
children = (
B5514516169A2A0900A81BF8 /* SnippetFun */,
B551450F169A2A0900A81BF8 /* Frameworks */,
B551450D169A2A0900A81BF8 /* Products */,
);
sourceTree = "<group>";
};
B551450D169A2A0900A81BF8 /* Products */ = {
isa = PBXGroup;
children = (
B551450C169A2A0900A81BF8 /* SnippetFun.app */,
);
name = Products;
sourceTree = "<group>";
};
B551450F169A2A0900A81BF8 /* Frameworks */ = {
isa = PBXGroup;
children = (
B5514510169A2A0900A81BF8 /* UIKit.framework */,
B5514512169A2A0900A81BF8 /* Foundation.framework */,
B5514514169A2A0900A81BF8 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B5514516169A2A0900A81BF8 /* SnippetFun */ = {
isa = PBXGroup;
children = (
B551451F169A2A0900A81BF8 /* AppDelegate.h */,
B5514520169A2A0900A81BF8 /* AppDelegate.m */,
B5514517169A2A0900A81BF8 /* Supporting Files */,
B551452D169A2A4700A81BF8 /* MyViewController.h */,
B551452E169A2A4700A81BF8 /* MyViewController.m */,
);
path = SnippetFun;
sourceTree = "<group>";
};
B5514517169A2A0900A81BF8 /* Supporting Files */ = {
isa = PBXGroup;
children = (
B5514518169A2A0900A81BF8 /* SnippetFun-Info.plist */,
B5514519169A2A0900A81BF8 /* InfoPlist.strings */,
B551451C169A2A0900A81BF8 /* main.m */,
B551451E169A2A0900A81BF8 /* SnippetFun-Prefix.pch */,
B5514522169A2A0900A81BF8 /* Default.png */,
B5514524169A2A0900A81BF8 /* Default@2x.png */,
B5514526169A2A0900A81BF8 /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
B551450B169A2A0900A81BF8 /* SnippetFun */ = {
isa = PBXNativeTarget;
buildConfigurationList = B551452A169A2A0900A81BF8 /* Build configuration list for PBXNativeTarget "SnippetFun" */;
buildPhases = (
B5514508169A2A0900A81BF8 /* Sources */,
B5514509169A2A0900A81BF8 /* Frameworks */,
B551450A169A2A0900A81BF8 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SnippetFun;
productName = SnippetFun;
productReference = B551450C169A2A0900A81BF8 /* SnippetFun.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
B5514503169A2A0900A81BF8 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = nsscreencast;
};
buildConfigurationList = B5514506169A2A0900A81BF8 /* Build configuration list for PBXProject "SnippetFun" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = B5514501169A2A0900A81BF8;
productRefGroup = B551450D169A2A0900A81BF8 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
B551450B169A2A0900A81BF8 /* SnippetFun */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
B551450A169A2A0900A81BF8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B551451B169A2A0900A81BF8 /* InfoPlist.strings in Resources */,
B5514523169A2A0900A81BF8 /* Default.png in Resources */,
B5514525169A2A0900A81BF8 /* Default@2x.png in Resources */,
B5514527169A2A0900A81BF8 /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
B5514508169A2A0900A81BF8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B551451D169A2A0900A81BF8 /* main.m in Sources */,
B5514521169A2A0900A81BF8 /* AppDelegate.m in Sources */,
B551452F169A2A4700A81BF8 /* MyViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
B5514519169A2A0900A81BF8 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
B551451A169A2A0900A81BF8 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
B5514528169A2A0900A81BF8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
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;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
B5514529169A2A0900A81BF8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
B551452B169A2A0900A81BF8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SnippetFun/SnippetFun-Prefix.pch";
INFOPLIST_FILE = "SnippetFun/SnippetFun-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
B551452C169A2A0900A81BF8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SnippetFun/SnippetFun-Prefix.pch";
INFOPLIST_FILE = "SnippetFun/SnippetFun-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
B5514506169A2A0900A81BF8 /* Build configuration list for PBXProject "SnippetFun" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B5514528169A2A0900A81BF8 /* Debug */,
B5514529169A2A0900A81BF8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
B551452A169A2A0900A81BF8 /* Build configuration list for PBXNativeTarget "SnippetFun" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B551452B169A2A0900A81BF8 /* Debug */,
B551452C169A2A0900A81BF8 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = B5514503169A2A0900A81BF8 /* Project object */;
}
15 changes: 15 additions & 0 deletions 048-code-snippets/SnippetFun/SnippetFun/AppDelegate.h
@@ -0,0 +1,15 @@
//
// AppDelegate.h
// SnippetFun
//
// Created by ben on 1/6/13.
// Copyright (c) 2013 nsscreencast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end
49 changes: 49 additions & 0 deletions 048-code-snippets/SnippetFun/SnippetFun/AppDelegate.m
@@ -0,0 +1,49 @@
//
// AppDelegate.m
// SnippetFun
//
// Created by ben on 1/6/13.
// Copyright (c) 2013 nsscreencast. 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.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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions 048-code-snippets/SnippetFun/SnippetFun/MyViewController.h
@@ -0,0 +1,13 @@
//
// MyViewController.h
// SnippetFun
//
// Created by ben on 1/6/13.
// Copyright (c) 2013 nsscreencast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MyViewController : UIViewController

@end

0 comments on commit e9f13af

Please sign in to comment.