Skip to content

Commit

Permalink
finished updating examples for chapter 6
Browse files Browse the repository at this point in the history
  • Loading branch information
mattneub committed Aug 15, 2015
1 parent 9577432 commit 4c8108c
Show file tree
Hide file tree
Showing 145 changed files with 3,007 additions and 1,425 deletions.
Expand Up @@ -50,6 +50,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="374" y="117"/>
</scene>
<!--Child View Controller-->
<scene sceneID="iIU-6E-KtM">
Expand Down Expand Up @@ -83,7 +84,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ayv-vi-OrM" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1189" y="125"/>
<point key="canvasLocation" x="1256.5" y="31"/>
</scene>
<!--View Controller2-->
<scene sceneID="H5D-bH-Ng0">
Expand Down
Expand Up @@ -3,11 +3,8 @@
import UIKit

class ViewController: UIViewController {

}

class ChildViewController: UIViewController {
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
print("prepare")
if segue.identifier == "embed" {
NSLog("%@ %@ %@", segue.identifier!, segue.sourceViewController, segue.destinationViewController)
NSLog("%d", segue.destinationViewController.isViewLoaded())
Expand All @@ -20,13 +17,22 @@ class ChildViewController: UIViewController {
super.viewDidLoad()
NSLog("did load %@ %@", self.view, self.childViewControllers)
// NSLog(@"%d", [self.childViewControllers[0] isViewLoaded]);

}

override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
NSLog("did appear %@ %@", self.view, self.childViewControllers)
}


}

class ChildViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
NSLog("child did load %@ %@", self.view, self.childViewControllers)
// NSLog(@"%d", [self.childViewControllers[0] isViewLoaded]);

}

}
Expand Up @@ -4,6 +4,10 @@ class ViewController2 : UIViewController {
@IBAction func doButton(sender:AnyObject?) {
self.presentingViewController!.dismissViewControllerAnimated(true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
print("vc2 view did load")
}
}

// ===== the rest of the example actually demonstrates something else entirely,
Expand Down
6 changes: 5 additions & 1 deletion bk2ch06p325customSegue/CustomSegue/ViewController.swift
Expand Up @@ -18,19 +18,23 @@ class ViewController2: UIViewController {
// Xcode 7 lets you specify a custom segue class without saying Custom for the segue:
// we are customizing a standard present modally segue

class MyCoolSegue: UIStoryboardSegue, UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning {
class MyCoolSegue: UIStoryboardSegue {
override func perform() {
let dest = self.destinationViewController
dest.modalPresentationStyle = .Custom
dest.transitioningDelegate = self
super.perform()
}
}
extension MyCoolSegue: UIViewControllerTransitioningDelegate {
func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return self
}
func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return self
}
}
extension MyCoolSegue: UIViewControllerAnimatedTransitioning {
func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
return 0.8
}
Expand Down
@@ -0,0 +1,290 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
32CAFACA1B7CFCF000B1DDB8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32CAFAC91B7CFCF000B1DDB8 /* AppDelegate.swift */; };
32CAFACC1B7CFCF000B1DDB8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32CAFACB1B7CFCF000B1DDB8 /* ViewController.swift */; };
32CAFACF1B7CFCF000B1DDB8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32CAFACD1B7CFCF000B1DDB8 /* Main.storyboard */; };
32CAFAD11B7CFCF000B1DDB8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32CAFAD01B7CFCF000B1DDB8 /* Assets.xcassets */; };
32CAFAD41B7CFCF000B1DDB8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32CAFAD21B7CFCF000B1DDB8 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
32CAFAC61B7CFCF000B1DDB8 /* PresentedCascadeUnwind.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PresentedCascadeUnwind.app; sourceTree = BUILT_PRODUCTS_DIR; };
32CAFAC91B7CFCF000B1DDB8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
32CAFACB1B7CFCF000B1DDB8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
32CAFACE1B7CFCF000B1DDB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
32CAFAD01B7CFCF000B1DDB8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
32CAFAD31B7CFCF000B1DDB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
32CAFAD51B7CFCF000B1DDB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
32CAFAC31B7CFCF000B1DDB8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
32CAFABD1B7CFCF000B1DDB8 = {
isa = PBXGroup;
children = (
32CAFAC81B7CFCF000B1DDB8 /* PresentedCascadeUnwind */,
32CAFAC71B7CFCF000B1DDB8 /* Products */,
);
sourceTree = "<group>";
};
32CAFAC71B7CFCF000B1DDB8 /* Products */ = {
isa = PBXGroup;
children = (
32CAFAC61B7CFCF000B1DDB8 /* PresentedCascadeUnwind.app */,
);
name = Products;
sourceTree = "<group>";
};
32CAFAC81B7CFCF000B1DDB8 /* PresentedCascadeUnwind */ = {
isa = PBXGroup;
children = (
32CAFAC91B7CFCF000B1DDB8 /* AppDelegate.swift */,
32CAFACB1B7CFCF000B1DDB8 /* ViewController.swift */,
32CAFACD1B7CFCF000B1DDB8 /* Main.storyboard */,
32CAFAD01B7CFCF000B1DDB8 /* Assets.xcassets */,
32CAFAD21B7CFCF000B1DDB8 /* LaunchScreen.storyboard */,
32CAFAD51B7CFCF000B1DDB8 /* Info.plist */,
);
path = PresentedCascadeUnwind;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
32CAFAC51B7CFCF000B1DDB8 /* PresentedCascadeUnwind */ = {
isa = PBXNativeTarget;
buildConfigurationList = 32CAFAD81B7CFCF000B1DDB8 /* Build configuration list for PBXNativeTarget "PresentedCascadeUnwind" */;
buildPhases = (
32CAFAC21B7CFCF000B1DDB8 /* Sources */,
32CAFAC31B7CFCF000B1DDB8 /* Frameworks */,
32CAFAC41B7CFCF000B1DDB8 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = PresentedCascadeUnwind;
productName = PresentedCascadeUnwind;
productReference = 32CAFAC61B7CFCF000B1DDB8 /* PresentedCascadeUnwind.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
32CAFABE1B7CFCF000B1DDB8 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Matt Neuburg";
TargetAttributes = {
32CAFAC51B7CFCF000B1DDB8 = {
CreatedOnToolsVersion = 7.0;
};
};
};
buildConfigurationList = 32CAFAC11B7CFCF000B1DDB8 /* Build configuration list for PBXProject "PresentedCascadeUnwind" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 32CAFABD1B7CFCF000B1DDB8;
productRefGroup = 32CAFAC71B7CFCF000B1DDB8 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
32CAFAC51B7CFCF000B1DDB8 /* PresentedCascadeUnwind */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
32CAFAC41B7CFCF000B1DDB8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
32CAFAD41B7CFCF000B1DDB8 /* LaunchScreen.storyboard in Resources */,
32CAFAD11B7CFCF000B1DDB8 /* Assets.xcassets in Resources */,
32CAFACF1B7CFCF000B1DDB8 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
32CAFAC21B7CFCF000B1DDB8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
32CAFACC1B7CFCF000B1DDB8 /* ViewController.swift in Sources */,
32CAFACA1B7CFCF000B1DDB8 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
32CAFACD1B7CFCF000B1DDB8 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
32CAFACE1B7CFCF000B1DDB8 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
32CAFAD21B7CFCF000B1DDB8 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
32CAFAD31B7CFCF000B1DDB8 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
32CAFAD61B7CFCF000B1DDB8 /* 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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
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_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
32CAFAD71B7CFCF000B1DDB8 /* 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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
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_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
32CAFAD91B7CFCF000B1DDB8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = PresentedCascadeUnwind/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.neuburg.matt.PresentedCascadeUnwind;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
32CAFADA1B7CFCF000B1DDB8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = PresentedCascadeUnwind/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.neuburg.matt.PresentedCascadeUnwind;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
32CAFAC11B7CFCF000B1DDB8 /* Build configuration list for PBXProject "PresentedCascadeUnwind" */ = {
isa = XCConfigurationList;
buildConfigurations = (
32CAFAD61B7CFCF000B1DDB8 /* Debug */,
32CAFAD71B7CFCF000B1DDB8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
32CAFAD81B7CFCF000B1DDB8 /* Build configuration list for PBXNativeTarget "PresentedCascadeUnwind" */ = {
isa = XCConfigurationList;
buildConfigurations = (
32CAFAD91B7CFCF000B1DDB8 /* Debug */,
32CAFADA1B7CFCF000B1DDB8 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 32CAFABE1B7CFCF000B1DDB8 /* Project object */;
}
@@ -0,0 +1,17 @@

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}


}

0 comments on commit 4c8108c

Please sign in to comment.