diff --git a/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.pbxproj b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b670845 --- /dev/null +++ b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.pbxproj @@ -0,0 +1,259 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + BFDD69FE200C5CF600DA9FA0 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDD69FD200C5CF600DA9FA0 /* main.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + BFDD69F8200C5CF600DA9FA0 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + BFDD69FA200C5CF600DA9FA0 /* 1.SwiftFundamental */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = 1.SwiftFundamental; sourceTree = BUILT_PRODUCTS_DIR; }; + BFDD69FD200C5CF600DA9FA0 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + BFDD69F7200C5CF600DA9FA0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + BFDD69F1200C5CF600DA9FA0 = { + isa = PBXGroup; + children = ( + BFDD69FC200C5CF600DA9FA0 /* 1.SwiftFundamental */, + BFDD69FB200C5CF600DA9FA0 /* Products */, + ); + sourceTree = ""; + }; + BFDD69FB200C5CF600DA9FA0 /* Products */ = { + isa = PBXGroup; + children = ( + BFDD69FA200C5CF600DA9FA0 /* 1.SwiftFundamental */, + ); + name = Products; + sourceTree = ""; + }; + BFDD69FC200C5CF600DA9FA0 /* 1.SwiftFundamental */ = { + isa = PBXGroup; + children = ( + BFDD69FD200C5CF600DA9FA0 /* main.swift */, + ); + path = 1.SwiftFundamental; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + BFDD69F9200C5CF600DA9FA0 /* 1.SwiftFundamental */ = { + isa = PBXNativeTarget; + buildConfigurationList = BFDD6A01200C5CF600DA9FA0 /* Build configuration list for PBXNativeTarget "1.SwiftFundamental" */; + buildPhases = ( + BFDD69F6200C5CF600DA9FA0 /* Sources */, + BFDD69F7200C5CF600DA9FA0 /* Frameworks */, + BFDD69F8200C5CF600DA9FA0 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = 1.SwiftFundamental; + productName = 1.SwiftFundamental; + productReference = BFDD69FA200C5CF600DA9FA0 /* 1.SwiftFundamental */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BFDD69F2200C5CF600DA9FA0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = DaoLQ; + TargetAttributes = { + BFDD69F9200C5CF600DA9FA0 = { + CreatedOnToolsVersion = 8.3.3; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = BFDD69F5200C5CF600DA9FA0 /* Build configuration list for PBXProject "1.SwiftFundamental" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = BFDD69F1200C5CF600DA9FA0; + productRefGroup = BFDD69FB200C5CF600DA9FA0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + BFDD69F9200C5CF600DA9FA0 /* 1.SwiftFundamental */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + BFDD69F6200C5CF600DA9FA0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BFDD69FE200C5CF600DA9FA0 /* main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + BFDD69FF200C5CF600DA9FA0 /* 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++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_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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + BFDD6A00200C5CF600DA9FA0 /* 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++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_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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + }; + name = Release; + }; + BFDD6A02200C5CF600DA9FA0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + BFDD6A03200C5CF600DA9FA0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BFDD69F5200C5CF600DA9FA0 /* Build configuration list for PBXProject "1.SwiftFundamental" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BFDD69FF200C5CF600DA9FA0 /* Debug */, + BFDD6A00200C5CF600DA9FA0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BFDD6A01200C5CF600DA9FA0 /* Build configuration list for PBXNativeTarget "1.SwiftFundamental" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BFDD6A02200C5CF600DA9FA0 /* Debug */, + BFDD6A03200C5CF600DA9FA0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = BFDD69F2200C5CF600DA9FA0 /* Project object */; +} diff --git a/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..18a3efb --- /dev/null +++ b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.xcworkspace/xcuserdata/daolq.xcuserdatad/UserInterfaceState.xcuserstate b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.xcworkspace/xcuserdata/daolq.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..e16d864 Binary files /dev/null and b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/project.xcworkspace/xcuserdata/daolq.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/1.SwiftFundamental.xcscheme b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/1.SwiftFundamental.xcscheme new file mode 100644 index 0000000..7e700c4 --- /dev/null +++ b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/1.SwiftFundamental.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/xcschememanagement.plist b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..425cdd1 --- /dev/null +++ b/1.SwiftFundamental/1.SwiftFundamental.xcodeproj/xcuserdata/daolq.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + 1.SwiftFundamental.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + BFDD69F9200C5CF600DA9FA0 + + primary + + + + + diff --git a/1.SwiftFundamental/1.SwiftFundamental/main.swift b/1.SwiftFundamental/1.SwiftFundamental/main.swift new file mode 100644 index 0000000..ee675a7 --- /dev/null +++ b/1.SwiftFundamental/1.SwiftFundamental/main.swift @@ -0,0 +1,16 @@ +// +// main.swift +// 1.SwiftFundamental +// +// Created by DaoLQ on 1/15/18. +// Copyright © 2018 DaoLQ. All rights reserved. +// + +import Foundation + +let numberOfPlanets = 8 +let diameterOfEarth: Double = 24859.8244 // In miles, from pole to pole. + +print("Welcome to our solar system!") +print("There are \(numberOfPlanets) plan") +print("Your are currently on Earth, which has a circumference of \(diameterOfEarth) miles") diff --git a/README.md b/README.md index 76205d9..77d927b 100644 --- a/README.md +++ b/README.md @@ -1 +1,30 @@ # IOSTraining +## Lession 1: +**1. Variables, type, String, Operators** ++ Difference between let & var ++ Tuple and Optional ++ When to use ``!`` & when to use ``?`` + +**2. Structural condition, structural loop in swift** ++ Understand about if, else, if let, guard let ++ More ways using loop for by Swift [link](https://viblo.asia/p/tong-hop-cac-cu-phap-lenh-for-thuong-gap-trong-swift-3-tro-di-1Je5E8AGlnL) ++ When to use ``while`` loop and when to use ``for`` loop + +**3. Declare array/ dictionary/ set** ++ When to use array/ dictionary/ set? + +**4. Function Type** + +**5. Closure** + +**6. Enum** + +**7. Struct & Class** ++ When to use Struct and When to use class + +**8. Inheritance in swift** + +**9. Extension in swift** + +**10. Protocol** ++ When to use protocol?