diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.pbxproj b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1ca0a1a --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.pbxproj @@ -0,0 +1,333 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + BF013A1B204E7506009058DE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF013A1A204E7506009058DE /* AppDelegate.swift */; }; + BF013A1D204E7506009058DE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF013A1C204E7506009058DE /* ViewController.swift */; }; + BF013A20204E7506009058DE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF013A1E204E7506009058DE /* Main.storyboard */; }; + BF013A22204E7506009058DE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BF013A21204E7506009058DE /* Assets.xcassets */; }; + BF013A25204E7506009058DE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF013A23204E7506009058DE /* LaunchScreen.storyboard */; }; + BF013A2D204E791E009058DE /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF013A2C204E791E009058DE /* BlueViewController.swift */; }; + BF036C40204ED5B2004BA70A /* RedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF036C3F204ED5B2004BA70A /* RedViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + BF013A17204E7506009058DE /* 4.Lifecycle_Naviagation_Controller.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 4.Lifecycle_Naviagation_Controller.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BF013A1A204E7506009058DE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + BF013A1C204E7506009058DE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + BF013A1F204E7506009058DE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + BF013A21204E7506009058DE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + BF013A24204E7506009058DE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + BF013A26204E7506009058DE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BF013A2C204E791E009058DE /* BlueViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = ""; }; + BF036C3F204ED5B2004BA70A /* RedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + BF013A14204E7506009058DE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + BF013A0E204E7506009058DE = { + isa = PBXGroup; + children = ( + BF013A19204E7506009058DE /* 4.Lifecycle_Naviagation_Controller */, + BF013A18204E7506009058DE /* Products */, + ); + sourceTree = ""; + }; + BF013A18204E7506009058DE /* Products */ = { + isa = PBXGroup; + children = ( + BF013A17204E7506009058DE /* 4.Lifecycle_Naviagation_Controller.app */, + ); + name = Products; + sourceTree = ""; + }; + BF013A19204E7506009058DE /* 4.Lifecycle_Naviagation_Controller */ = { + isa = PBXGroup; + children = ( + BF013A26204E7506009058DE /* Info.plist */, + BF013A1A204E7506009058DE /* AppDelegate.swift */, + BF013A2C204E791E009058DE /* BlueViewController.swift */, + BF036C3F204ED5B2004BA70A /* RedViewController.swift */, + BF013A1C204E7506009058DE /* ViewController.swift */, + BF013A21204E7506009058DE /* Assets.xcassets */, + BF013A23204E7506009058DE /* LaunchScreen.storyboard */, + BF013A1E204E7506009058DE /* Main.storyboard */, + ); + path = 4.Lifecycle_Naviagation_Controller; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + BF013A16204E7506009058DE /* 4.Lifecycle_Naviagation_Controller */ = { + isa = PBXNativeTarget; + buildConfigurationList = BF013A29204E7506009058DE /* Build configuration list for PBXNativeTarget "4.Lifecycle_Naviagation_Controller" */; + buildPhases = ( + BF013A13204E7506009058DE /* Sources */, + BF013A14204E7506009058DE /* Frameworks */, + BF013A15204E7506009058DE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = 4.Lifecycle_Naviagation_Controller; + productName = 3.Lifecycle_Naviagation_Controller; + productReference = BF013A17204E7506009058DE /* 4.Lifecycle_Naviagation_Controller.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BF013A0F204E7506009058DE /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = DaoLQ; + TargetAttributes = { + BF013A16204E7506009058DE = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = BF013A12204E7506009058DE /* Build configuration list for PBXProject "4.Lifecycle_Naviagation_Controller" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = BF013A0E204E7506009058DE; + productRefGroup = BF013A18204E7506009058DE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + BF013A16204E7506009058DE /* 4.Lifecycle_Naviagation_Controller */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + BF013A15204E7506009058DE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BF013A25204E7506009058DE /* LaunchScreen.storyboard in Resources */, + BF013A22204E7506009058DE /* Assets.xcassets in Resources */, + BF013A20204E7506009058DE /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + BF013A13204E7506009058DE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BF036C40204ED5B2004BA70A /* RedViewController.swift in Sources */, + BF013A1D204E7506009058DE /* ViewController.swift in Sources */, + BF013A2D204E791E009058DE /* BlueViewController.swift in Sources */, + BF013A1B204E7506009058DE /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + BF013A1E204E7506009058DE /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BF013A1F204E7506009058DE /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + BF013A23204E7506009058DE /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BF013A24204E7506009058DE /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + BF013A27204E7506009058DE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + BF013A28204E7506009058DE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "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 = gnu11; + 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 = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + BF013A2A204E7506009058DE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = 3.Lifecycle_Naviagation_Controller/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.fstyle.--Lifecycle-Naviagation-Controller"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + BF013A2B204E7506009058DE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = 3.Lifecycle_Naviagation_Controller/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.fstyle.--Lifecycle-Naviagation-Controller"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BF013A12204E7506009058DE /* Build configuration list for PBXProject "4.Lifecycle_Naviagation_Controller" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BF013A27204E7506009058DE /* Debug */, + BF013A28204E7506009058DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BF013A29204E7506009058DE /* Build configuration list for PBXNativeTarget "4.Lifecycle_Naviagation_Controller" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BF013A2A204E7506009058DE /* Debug */, + BF013A2B204E7506009058DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BF013A0F204E7506009058DE /* Project object */; +} diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..fb245f7 --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.xcworkspace/xcuserdata/daolq.xcuserdatad/UserInterfaceState.xcuserstate b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.xcworkspace/xcuserdata/daolq.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c7fb422 Binary files /dev/null and b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/project.xcworkspace/xcuserdata/daolq.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/xcschememanagement.plist b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..7bf8096 --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + 3.Lifecycle_Naviagation_Controller.xcscheme + + orderHint + 0 + + + + diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/AppDelegate.swift b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/AppDelegate.swift new file mode 100644 index 0000000..c1f975b --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// 3.Lifecycle_Naviagation_Controller +// +// Created by DaoLQ on 3/6/18. +// Copyright © 2018 DaoLQ. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // 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 invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // 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. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // 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. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Assets.xcassets/AppIcon.appiconset/Contents.json b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "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" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Base.lproj/LaunchScreen.storyboard b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Base.lproj/Main.storyboard b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c095a87 --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Base.lproj/Main.storyboard @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/BlueViewController.swift b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/BlueViewController.swift new file mode 100644 index 0000000..8b6a504 --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/BlueViewController.swift @@ -0,0 +1,25 @@ +// +// BlueViewController.swift +// 3.Lifecycle_Naviagation_Controller +// +// Created by DaoLQ on 3/6/18. +// Copyright © 2018 DaoLQ. All rights reserved. +// + +import UIKit + +class BlueViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + @IBAction func gotoRedScreen(_ sender: Any) { + let sb = UIStoryboard(name: "Main", bundle: nil) + let redViewController = sb.instantiateViewController(withIdentifier: "RedViewController") + self.navigationController?.pushViewController(redViewController, animated: true) + } + +} diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Info.plist b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/RedViewController.swift b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/RedViewController.swift new file mode 100644 index 0000000..35f9244 --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/RedViewController.swift @@ -0,0 +1,31 @@ +// +// RedViewController.swift +// 3.Lifecycle_Naviagation_Controller +// +// Created by DaoLQ on 3/6/18. +// Copyright © 2018 DaoLQ. All rights reserved. +// + +import UIKit + +class RedViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + @IBAction func backToPrevious(_ sender: Any) { + self.navigationController?.popViewController(animated: true) + } + + @IBAction func backToRoot(_ sender: Any) { + self.navigationController?.popToRootViewController(animated: true) + } + + @IBAction func backToView(_ sender: Any) { + let viewController = self.navigationController?.viewControllers[1] + self.navigationController?.popToViewController(viewController!, animated: true) + } +} diff --git a/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/ViewController.swift b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/ViewController.swift new file mode 100644 index 0000000..c7018c5 --- /dev/null +++ b/4.Lifecycle_Naviagation_Controller/4.Lifecycle_Naviagation_Controller/ViewController.swift @@ -0,0 +1,45 @@ +// +// ViewController.swift +// 3.Lifecycle_Naviagation_Controller +// +// Created by DaoLQ on 3/6/18. +// Copyright © 2018 DaoLQ. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + print("View DidLoad") + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + print("View Will Appear") + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + print("View Did Appear") + } + + override func viewWillDisappear(_ animated: Bool) { + print("View Will Disappear") + } + + override func viewDidDisappear(_ animated: Bool) { + print("View Did Disappear") + } + + @IBAction func gotoBlueScreen(_ sender: Any) { + // Storyboard + let sb = UIStoryboard(name: "Main", bundle: nil) + // Blue Screen + let screen2 = sb.instantiateViewController(withIdentifier: "BlueViewController") as! BlueViewController + // Push + self.navigationController?.pushViewController(screen2, animated: true) + } +} + diff --git a/README.md b/README.md index 76205d9..b473fd2 100644 --- a/README.md +++ b/README.md @@ -1 +1,34 @@ # IOSTraining +## Lession 4: +**1. NavigationController** ++ Embed in Navagation Controller ++ Push to next screen ++ Send data from current screen and display in next screen ++ Pop to previous screen ++ Pop to root screen ++ Pop to a specified screen has gone through ++ Send data from current screen and display in previous screen + +**2. Presentation** ++ Present a view controller ++ Dismiss a view controller + +**3. LifeCycle Of App** + +**4. LifeCycle Of ViewController** ++ List all method through when Open ViewController ++ List all method through when Goto Another ViewController ++ List all method through when back from other ViewController + +**5. Additional Techniques** ++ Pass Data though storyboard (using segue) ++ Loading ViewController from xib file ++ Communicate between 2 screens by apply Delegation ++ Communicate between 2 screens by apply Closure + +### Excercise: +- TBD + +### Ref: ++ Viblo - Một số kỹ thuật Passing Data giữa các View Controllers: [P1](https://viblo.asia/p/mot-so-ky-thuat-passing-data-giua-cac-view-controllers-phan-1-E375zBjj5GW), [P2](https://viblo.asia/p/mot-so-ky-thuat-passing-data-giua-cac-view-controllers-phan-2-Az45bNWg5xY) ++ [Lập trình iOS - Khoa Pham](https://www.youtube.com/watch?v=wVB0WMsL9hk)