diff --git a/SwiftCodeByEunjiKim/BareBasic/BareBasic.xcodeproj/project.pbxproj b/SwiftCodeByEunjiKim/BareBasic/BareBasic.xcodeproj/project.pbxproj new file mode 100644 index 0000000..821b886 --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic.xcodeproj/project.pbxproj @@ -0,0 +1,557 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + ED3A698E1F7A1528003F9103 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A698D1F7A1528003F9103 /* AppDelegate.swift */; }; + ED3A69901F7A1528003F9103 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A698F1F7A1528003F9103 /* ViewController.swift */; }; + ED3A69931F7A1528003F9103 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED3A69911F7A1528003F9103 /* Main.storyboard */; }; + ED3A69951F7A1528003F9103 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED3A69941F7A1528003F9103 /* Assets.xcassets */; }; + ED3A69981F7A1528003F9103 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED3A69961F7A1528003F9103 /* LaunchScreen.storyboard */; }; + ED3A69A31F7A1528003F9103 /* BareBasicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A69A21F7A1528003F9103 /* BareBasicTests.swift */; }; + ED3A69AE1F7A1528003F9103 /* BareBasicUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A69AD1F7A1528003F9103 /* BareBasicUITests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + ED3A699F1F7A1528003F9103 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ED3A69821F7A1528003F9103 /* Project object */; + proxyType = 1; + remoteGlobalIDString = ED3A69891F7A1528003F9103; + remoteInfo = BareBasic; + }; + ED3A69AA1F7A1528003F9103 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ED3A69821F7A1528003F9103 /* Project object */; + proxyType = 1; + remoteGlobalIDString = ED3A69891F7A1528003F9103; + remoteInfo = BareBasic; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + ED3A698A1F7A1528003F9103 /* BareBasic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BareBasic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + ED3A698D1F7A1528003F9103 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + ED3A698F1F7A1528003F9103 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + ED3A69921F7A1528003F9103 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + ED3A69941F7A1528003F9103 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + ED3A69971F7A1528003F9103 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + ED3A69991F7A1528003F9103 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + ED3A699E1F7A1528003F9103 /* BareBasicTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BareBasicTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + ED3A69A21F7A1528003F9103 /* BareBasicTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BareBasicTests.swift; sourceTree = ""; }; + ED3A69A41F7A1528003F9103 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + ED3A69A91F7A1528003F9103 /* BareBasicUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BareBasicUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + ED3A69AD1F7A1528003F9103 /* BareBasicUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BareBasicUITests.swift; sourceTree = ""; }; + ED3A69AF1F7A1528003F9103 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + ED3A69871F7A1528003F9103 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A699B1F7A1528003F9103 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69A61F7A1528003F9103 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + ED3A69811F7A1528003F9103 = { + isa = PBXGroup; + children = ( + ED3A698C1F7A1528003F9103 /* BareBasic */, + ED3A69A11F7A1528003F9103 /* BareBasicTests */, + ED3A69AC1F7A1528003F9103 /* BareBasicUITests */, + ED3A698B1F7A1528003F9103 /* Products */, + ); + sourceTree = ""; + }; + ED3A698B1F7A1528003F9103 /* Products */ = { + isa = PBXGroup; + children = ( + ED3A698A1F7A1528003F9103 /* BareBasic.app */, + ED3A699E1F7A1528003F9103 /* BareBasicTests.xctest */, + ED3A69A91F7A1528003F9103 /* BareBasicUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + ED3A698C1F7A1528003F9103 /* BareBasic */ = { + isa = PBXGroup; + children = ( + ED3A698D1F7A1528003F9103 /* AppDelegate.swift */, + ED3A698F1F7A1528003F9103 /* ViewController.swift */, + ED3A69911F7A1528003F9103 /* Main.storyboard */, + ED3A69941F7A1528003F9103 /* Assets.xcassets */, + ED3A69961F7A1528003F9103 /* LaunchScreen.storyboard */, + ED3A69991F7A1528003F9103 /* Info.plist */, + ); + path = BareBasic; + sourceTree = ""; + }; + ED3A69A11F7A1528003F9103 /* BareBasicTests */ = { + isa = PBXGroup; + children = ( + ED3A69A21F7A1528003F9103 /* BareBasicTests.swift */, + ED3A69A41F7A1528003F9103 /* Info.plist */, + ); + path = BareBasicTests; + sourceTree = ""; + }; + ED3A69AC1F7A1528003F9103 /* BareBasicUITests */ = { + isa = PBXGroup; + children = ( + ED3A69AD1F7A1528003F9103 /* BareBasicUITests.swift */, + ED3A69AF1F7A1528003F9103 /* Info.plist */, + ); + path = BareBasicUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + ED3A69891F7A1528003F9103 /* BareBasic */ = { + isa = PBXNativeTarget; + buildConfigurationList = ED3A69B21F7A1528003F9103 /* Build configuration list for PBXNativeTarget "BareBasic" */; + buildPhases = ( + ED3A69861F7A1528003F9103 /* Sources */, + ED3A69871F7A1528003F9103 /* Frameworks */, + ED3A69881F7A1528003F9103 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BareBasic; + productName = BareBasic; + productReference = ED3A698A1F7A1528003F9103 /* BareBasic.app */; + productType = "com.apple.product-type.application"; + }; + ED3A699D1F7A1528003F9103 /* BareBasicTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = ED3A69B51F7A1528003F9103 /* Build configuration list for PBXNativeTarget "BareBasicTests" */; + buildPhases = ( + ED3A699A1F7A1528003F9103 /* Sources */, + ED3A699B1F7A1528003F9103 /* Frameworks */, + ED3A699C1F7A1528003F9103 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ED3A69A01F7A1528003F9103 /* PBXTargetDependency */, + ); + name = BareBasicTests; + productName = BareBasicTests; + productReference = ED3A699E1F7A1528003F9103 /* BareBasicTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + ED3A69A81F7A1528003F9103 /* BareBasicUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = ED3A69B81F7A1528003F9103 /* Build configuration list for PBXNativeTarget "BareBasicUITests" */; + buildPhases = ( + ED3A69A51F7A1528003F9103 /* Sources */, + ED3A69A61F7A1528003F9103 /* Frameworks */, + ED3A69A71F7A1528003F9103 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ED3A69AB1F7A1528003F9103 /* PBXTargetDependency */, + ); + name = BareBasicUITests; + productName = BareBasicUITests; + productReference = ED3A69A91F7A1528003F9103 /* BareBasicUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + ED3A69821F7A1528003F9103 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0900; + LastUpgradeCheck = 0900; + ORGANIZATIONNAME = eunjikim; + TargetAttributes = { + ED3A69891F7A1528003F9103 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + }; + ED3A699D1F7A1528003F9103 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = ED3A69891F7A1528003F9103; + }; + ED3A69A81F7A1528003F9103 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = ED3A69891F7A1528003F9103; + }; + }; + }; + buildConfigurationList = ED3A69851F7A1528003F9103 /* Build configuration list for PBXProject "BareBasic" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = ED3A69811F7A1528003F9103; + productRefGroup = ED3A698B1F7A1528003F9103 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + ED3A69891F7A1528003F9103 /* BareBasic */, + ED3A699D1F7A1528003F9103 /* BareBasicTests */, + ED3A69A81F7A1528003F9103 /* BareBasicUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + ED3A69881F7A1528003F9103 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69981F7A1528003F9103 /* LaunchScreen.storyboard in Resources */, + ED3A69951F7A1528003F9103 /* Assets.xcassets in Resources */, + ED3A69931F7A1528003F9103 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A699C1F7A1528003F9103 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69A71F7A1528003F9103 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + ED3A69861F7A1528003F9103 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69901F7A1528003F9103 /* ViewController.swift in Sources */, + ED3A698E1F7A1528003F9103 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A699A1F7A1528003F9103 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69A31F7A1528003F9103 /* BareBasicTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69A51F7A1528003F9103 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69AE1F7A1528003F9103 /* BareBasicUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + ED3A69A01F7A1528003F9103 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = ED3A69891F7A1528003F9103 /* BareBasic */; + targetProxy = ED3A699F1F7A1528003F9103 /* PBXContainerItemProxy */; + }; + ED3A69AB1F7A1528003F9103 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = ED3A69891F7A1528003F9103 /* BareBasic */; + targetProxy = ED3A69AA1F7A1528003F9103 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + ED3A69911F7A1528003F9103 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ED3A69921F7A1528003F9103 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + ED3A69961F7A1528003F9103 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ED3A69971F7A1528003F9103 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + ED3A69B01F7A1528003F9103 /* 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.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + ED3A69B11F7A1528003F9103 /* 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.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + ED3A69B31F7A1528003F9103 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = BareBasic/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.BareBasic; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + ED3A69B41F7A1528003F9103 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = BareBasic/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.BareBasic; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + ED3A69B61F7A1528003F9103 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = BareBasicTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.BareBasicTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BareBasic.app/BareBasic"; + }; + name = Debug; + }; + ED3A69B71F7A1528003F9103 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = BareBasicTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.BareBasicTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BareBasic.app/BareBasic"; + }; + name = Release; + }; + ED3A69B91F7A1528003F9103 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = BareBasicUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.BareBasicUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = BareBasic; + }; + name = Debug; + }; + ED3A69BA1F7A1528003F9103 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = BareBasicUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.BareBasicUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = BareBasic; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + ED3A69851F7A1528003F9103 /* Build configuration list for PBXProject "BareBasic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69B01F7A1528003F9103 /* Debug */, + ED3A69B11F7A1528003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ED3A69B21F7A1528003F9103 /* Build configuration list for PBXNativeTarget "BareBasic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69B31F7A1528003F9103 /* Debug */, + ED3A69B41F7A1528003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ED3A69B51F7A1528003F9103 /* Build configuration list for PBXNativeTarget "BareBasicTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69B61F7A1528003F9103 /* Debug */, + ED3A69B71F7A1528003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ED3A69B81F7A1528003F9103 /* Build configuration list for PBXNativeTarget "BareBasicUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69B91F7A1528003F9103 /* Debug */, + ED3A69BA1F7A1528003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = ED3A69821F7A1528003F9103 /* Project object */; +} diff --git a/SwiftCodeByEunjiKim/BareBasic/BareBasic.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/BareBasic/BareBasic.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a2f94f8 --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/BareBasic/BareBasic/AppDelegate.swift b/SwiftCodeByEunjiKim/BareBasic/BareBasic/AppDelegate.swift new file mode 100644 index 0000000..0847ac9 --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// BareBasic +// +// Created by eunjikim on 2017. 9. 26.. +// Copyright © 2017년 eunjikim. 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/SwiftCodeByEunjiKim/BareBasic/BareBasic/Assets.xcassets/AppIcon.appiconset/Contents.json b/SwiftCodeByEunjiKim/BareBasic/BareBasic/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic/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/SwiftCodeByEunjiKim/BareBasic/BareBasic/Base.lproj/LaunchScreen.storyboard b/SwiftCodeByEunjiKim/BareBasic/BareBasic/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/BareBasic/BareBasic/Base.lproj/Main.storyboard b/SwiftCodeByEunjiKim/BareBasic/BareBasic/Base.lproj/Main.storyboard new file mode 100644 index 0000000..090a6cc --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic/Base.lproj/Main.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/BareBasic/BareBasic/Info.plist b/SwiftCodeByEunjiKim/BareBasic/BareBasic/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic/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/SwiftCodeByEunjiKim/BareBasic/BareBasic/ViewController.swift b/SwiftCodeByEunjiKim/BareBasic/BareBasic/ViewController.swift new file mode 100644 index 0000000..756c287 --- /dev/null +++ b/SwiftCodeByEunjiKim/BareBasic/BareBasic/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// BareBasic +// +// Created by eunjikim on 2017. 9. 26.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/SwiftCodeByEunjiKim/FunctionType.playground/Contents.swift b/SwiftCodeByEunjiKim/FunctionType.playground/Contents.swift new file mode 100644 index 0000000..b26b4c0 --- /dev/null +++ b/SwiftCodeByEunjiKim/FunctionType.playground/Contents.swift @@ -0,0 +1,154 @@ +//: Playground - noun: a place where people can play + +import UIKit + +//: Function Type + +func addVAT(source:Double) -> Double { + return source * 1.1 +} +func couponDiscount(source:Double) -> Double { + return source * 0.9 +} + +var additional:(Double) -> Double + +let transaction102101 = 120.7 +additional = addVAT + +let price102301 = additional(transaction102101) + +func finalPrice(source:Double, additional:(Double) -> Double) -> Double { + let price = additional(source) + return price +} + +let price102102 = finalPrice(source: 350.0, additional: couponDiscount) + + +//: Closure + +let addVATClosure = { (source:Double) -> Double in + return source * 1.1 +} +let addVATClosure2 = { source in + return source * 1.1 +} +let addVATClosure3 = { source in + source * 1.1 +} +let addVATClosure4 = {$0 * 1.1} +let couponDiscountCloser = { (source:Double) -> Double in + return source * 0.9 +} +let couponDiscountCloser2 = { source in + return source * 0.9 +} +let couponDiscountCloser3 = { source in + source * 0.9 +} +let couponDiscountCloser4 = {$0 * 0.9} + +let price102103 = addVATClosure4(157.6) +let price102104 = couponDiscountCloser(200.0) + +func makeAdder (x:Int) -> (Int) -> Int { + func adder(a:Int) -> Int { + return x + a + } + return adder +} +func makeAdder2 (x:Int) -> (Int) -> Int { + let adder:(Int) -> Int = { + return $0 + x + } + return adder +} +func makeAdder3 (x:Int) -> (Int) -> Int { + return { + return $0 + x + } +} + +let add5 = makeAdder2(x: 5) +let add10 = makeAdder2(x: 10) + +print(add5(2)) +print(add10(2)) +print(makeAdder3(x:5)(2)) + + +//: map +let transactions = [560.0, 321.5, 190.0, 672.8, 1190.0, 450.0] + +var vatPrices:[Double] = [] + +for transaction in transactions { + vatPrices += [addVAT(source: transaction)] +} + +let vatMapPrices = transactions.map({ transaction -> Double in + return transaction * 1.1 +}) +let vatMapPrices2 = transactions.map({$0*1.1}) +print(vatMapPrices2) + + +//: filter + +var bigTransactions:[Double] = [] +for price in vatPrices { + if price >= 500 { + bigTransactions += [price] + } +} +let bigFilterTransactions = vatPrices.filter {$0 >= 500} +print(bigFilterTransactions) + +var meetingRooms:[String:Int] = ["Banksy":4, "Rivera":8, "Kahlo":8, "Picasso":10, "Cezanne":20, "Matisse":30] +print(meetingRooms) + +let members = 9 +let available = meetingRooms.filter{$0.1 > members} +print(available.first!) +print(Array(available)[0]) + +//: sort +func ascendantSort (sort1:Double, sort2:Double) -> Bool { + return sort1 > sort2 +} +let sortedPrices = vatPrices.sorted(by:ascendantSort) +let sortedPrices2 = vatPrices.sorted(by:{ sort1, sort2 in + return sort1>sort2 +}) +let sortedPrices3 = vatPrices.sorted(by:{$0>$1}) +print("\(sortedPrices3)") +let sortedPrices4 = vatPrices.sorted(by:>) + +let sortedMeetingRooms = meetingRooms.sorted(by: {$0.1>$1.1}) +print("\(sortedMeetingRooms)") + + +//: reduce + +func priceSum (base:Double, adder:Double) -> Double { + return base + adder +} +var sum:Double = 0.0 +for price in vatPrices { + sum = priceSum(base: sum, adder: price) +} +print("\(sum)") + +var sum2:Double = 0.0 +let sumReduce = vatPrices.reduce(sum2, priceSum) +let sumReduce2 = vatPrices.reduce(0.0, {base, adder in + base + adder +}) +let sumReduce3 = vatPrices.reduce(0.0, +) + +let pricesInString = vatPrices.reduce("",{ $0 + "\($1)\n"}) +print(pricesInString) + +let descriptionString = meetingRooms.reduce("We have meeting rooms : \n", {$0 + "\($1.0) for \($1.1) person \n"}) +print(descriptionString) diff --git a/SwiftCodeByEunjiKim/FunctionType.playground/contents.xcplayground b/SwiftCodeByEunjiKim/FunctionType.playground/contents.xcplayground new file mode 100644 index 0000000..5da2641 --- /dev/null +++ b/SwiftCodeByEunjiKim/FunctionType.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/FunctionType.playground/playground.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/FunctionType.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SwiftCodeByEunjiKim/FunctionType.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/FunctionType.playground/timeline.xctimeline b/SwiftCodeByEunjiKim/FunctionType.playground/timeline.xctimeline new file mode 100644 index 0000000..99b63fa --- /dev/null +++ b/SwiftCodeByEunjiKim/FunctionType.playground/timeline.xctimeline @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone.xcodeproj/project.pbxproj b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c88e798 --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone.xcodeproj/project.pbxproj @@ -0,0 +1,557 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + ED3A69C81F7A1710003F9103 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A69C71F7A1710003F9103 /* AppDelegate.swift */; }; + ED3A69CA1F7A1710003F9103 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A69C91F7A1710003F9103 /* ViewController.swift */; }; + ED3A69CD1F7A1710003F9103 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED3A69CB1F7A1710003F9103 /* Main.storyboard */; }; + ED3A69CF1F7A1710003F9103 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED3A69CE1F7A1710003F9103 /* Assets.xcassets */; }; + ED3A69D21F7A1710003F9103 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED3A69D01F7A1710003F9103 /* LaunchScreen.storyboard */; }; + ED3A69DD1F7A1710003F9103 /* HelloiPhoneTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A69DC1F7A1710003F9103 /* HelloiPhoneTests.swift */; }; + ED3A69E81F7A1710003F9103 /* HelloiPhoneUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3A69E71F7A1710003F9103 /* HelloiPhoneUITests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + ED3A69D91F7A1710003F9103 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ED3A69BC1F7A1710003F9103 /* Project object */; + proxyType = 1; + remoteGlobalIDString = ED3A69C31F7A1710003F9103; + remoteInfo = HelloiPhone; + }; + ED3A69E41F7A1710003F9103 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ED3A69BC1F7A1710003F9103 /* Project object */; + proxyType = 1; + remoteGlobalIDString = ED3A69C31F7A1710003F9103; + remoteInfo = HelloiPhone; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + ED3A69C41F7A1710003F9103 /* HelloiPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloiPhone.app; sourceTree = BUILT_PRODUCTS_DIR; }; + ED3A69C71F7A1710003F9103 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + ED3A69C91F7A1710003F9103 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + ED3A69CC1F7A1710003F9103 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + ED3A69CE1F7A1710003F9103 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + ED3A69D11F7A1710003F9103 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + ED3A69D31F7A1710003F9103 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + ED3A69D81F7A1710003F9103 /* HelloiPhoneTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloiPhoneTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + ED3A69DC1F7A1710003F9103 /* HelloiPhoneTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelloiPhoneTests.swift; sourceTree = ""; }; + ED3A69DE1F7A1710003F9103 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + ED3A69E31F7A1710003F9103 /* HelloiPhoneUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloiPhoneUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + ED3A69E71F7A1710003F9103 /* HelloiPhoneUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelloiPhoneUITests.swift; sourceTree = ""; }; + ED3A69E91F7A1710003F9103 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + ED3A69C11F7A1710003F9103 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69D51F7A1710003F9103 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69E01F7A1710003F9103 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + ED3A69BB1F7A1710003F9103 = { + isa = PBXGroup; + children = ( + ED3A69C61F7A1710003F9103 /* HelloiPhone */, + ED3A69DB1F7A1710003F9103 /* HelloiPhoneTests */, + ED3A69E61F7A1710003F9103 /* HelloiPhoneUITests */, + ED3A69C51F7A1710003F9103 /* Products */, + ); + sourceTree = ""; + }; + ED3A69C51F7A1710003F9103 /* Products */ = { + isa = PBXGroup; + children = ( + ED3A69C41F7A1710003F9103 /* HelloiPhone.app */, + ED3A69D81F7A1710003F9103 /* HelloiPhoneTests.xctest */, + ED3A69E31F7A1710003F9103 /* HelloiPhoneUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + ED3A69C61F7A1710003F9103 /* HelloiPhone */ = { + isa = PBXGroup; + children = ( + ED3A69C71F7A1710003F9103 /* AppDelegate.swift */, + ED3A69C91F7A1710003F9103 /* ViewController.swift */, + ED3A69CB1F7A1710003F9103 /* Main.storyboard */, + ED3A69CE1F7A1710003F9103 /* Assets.xcassets */, + ED3A69D01F7A1710003F9103 /* LaunchScreen.storyboard */, + ED3A69D31F7A1710003F9103 /* Info.plist */, + ); + path = HelloiPhone; + sourceTree = ""; + }; + ED3A69DB1F7A1710003F9103 /* HelloiPhoneTests */ = { + isa = PBXGroup; + children = ( + ED3A69DC1F7A1710003F9103 /* HelloiPhoneTests.swift */, + ED3A69DE1F7A1710003F9103 /* Info.plist */, + ); + path = HelloiPhoneTests; + sourceTree = ""; + }; + ED3A69E61F7A1710003F9103 /* HelloiPhoneUITests */ = { + isa = PBXGroup; + children = ( + ED3A69E71F7A1710003F9103 /* HelloiPhoneUITests.swift */, + ED3A69E91F7A1710003F9103 /* Info.plist */, + ); + path = HelloiPhoneUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + ED3A69C31F7A1710003F9103 /* HelloiPhone */ = { + isa = PBXNativeTarget; + buildConfigurationList = ED3A69EC1F7A1710003F9103 /* Build configuration list for PBXNativeTarget "HelloiPhone" */; + buildPhases = ( + ED3A69C01F7A1710003F9103 /* Sources */, + ED3A69C11F7A1710003F9103 /* Frameworks */, + ED3A69C21F7A1710003F9103 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HelloiPhone; + productName = HelloiPhone; + productReference = ED3A69C41F7A1710003F9103 /* HelloiPhone.app */; + productType = "com.apple.product-type.application"; + }; + ED3A69D71F7A1710003F9103 /* HelloiPhoneTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = ED3A69EF1F7A1710003F9103 /* Build configuration list for PBXNativeTarget "HelloiPhoneTests" */; + buildPhases = ( + ED3A69D41F7A1710003F9103 /* Sources */, + ED3A69D51F7A1710003F9103 /* Frameworks */, + ED3A69D61F7A1710003F9103 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ED3A69DA1F7A1710003F9103 /* PBXTargetDependency */, + ); + name = HelloiPhoneTests; + productName = HelloiPhoneTests; + productReference = ED3A69D81F7A1710003F9103 /* HelloiPhoneTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + ED3A69E21F7A1710003F9103 /* HelloiPhoneUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = ED3A69F21F7A1710003F9103 /* Build configuration list for PBXNativeTarget "HelloiPhoneUITests" */; + buildPhases = ( + ED3A69DF1F7A1710003F9103 /* Sources */, + ED3A69E01F7A1710003F9103 /* Frameworks */, + ED3A69E11F7A1710003F9103 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ED3A69E51F7A1710003F9103 /* PBXTargetDependency */, + ); + name = HelloiPhoneUITests; + productName = HelloiPhoneUITests; + productReference = ED3A69E31F7A1710003F9103 /* HelloiPhoneUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + ED3A69BC1F7A1710003F9103 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0900; + LastUpgradeCheck = 0900; + ORGANIZATIONNAME = eunjikim; + TargetAttributes = { + ED3A69C31F7A1710003F9103 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + }; + ED3A69D71F7A1710003F9103 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = ED3A69C31F7A1710003F9103; + }; + ED3A69E21F7A1710003F9103 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = ED3A69C31F7A1710003F9103; + }; + }; + }; + buildConfigurationList = ED3A69BF1F7A1710003F9103 /* Build configuration list for PBXProject "HelloiPhone" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = ED3A69BB1F7A1710003F9103; + productRefGroup = ED3A69C51F7A1710003F9103 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + ED3A69C31F7A1710003F9103 /* HelloiPhone */, + ED3A69D71F7A1710003F9103 /* HelloiPhoneTests */, + ED3A69E21F7A1710003F9103 /* HelloiPhoneUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + ED3A69C21F7A1710003F9103 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69D21F7A1710003F9103 /* LaunchScreen.storyboard in Resources */, + ED3A69CF1F7A1710003F9103 /* Assets.xcassets in Resources */, + ED3A69CD1F7A1710003F9103 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69D61F7A1710003F9103 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69E11F7A1710003F9103 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + ED3A69C01F7A1710003F9103 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69CA1F7A1710003F9103 /* ViewController.swift in Sources */, + ED3A69C81F7A1710003F9103 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69D41F7A1710003F9103 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69DD1F7A1710003F9103 /* HelloiPhoneTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ED3A69DF1F7A1710003F9103 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED3A69E81F7A1710003F9103 /* HelloiPhoneUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + ED3A69DA1F7A1710003F9103 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = ED3A69C31F7A1710003F9103 /* HelloiPhone */; + targetProxy = ED3A69D91F7A1710003F9103 /* PBXContainerItemProxy */; + }; + ED3A69E51F7A1710003F9103 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = ED3A69C31F7A1710003F9103 /* HelloiPhone */; + targetProxy = ED3A69E41F7A1710003F9103 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + ED3A69CB1F7A1710003F9103 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ED3A69CC1F7A1710003F9103 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + ED3A69D01F7A1710003F9103 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ED3A69D11F7A1710003F9103 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + ED3A69EA1F7A1710003F9103 /* 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.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + ED3A69EB1F7A1710003F9103 /* 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.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + ED3A69ED1F7A1710003F9103 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HelloiPhone/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.HelloiPhone; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + ED3A69EE1F7A1710003F9103 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HelloiPhone/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.HelloiPhone; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + ED3A69F01F7A1710003F9103 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HelloiPhoneTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.HelloiPhoneTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloiPhone.app/HelloiPhone"; + }; + name = Debug; + }; + ED3A69F11F7A1710003F9103 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HelloiPhoneTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.HelloiPhoneTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloiPhone.app/HelloiPhone"; + }; + name = Release; + }; + ED3A69F31F7A1710003F9103 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HelloiPhoneUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.HelloiPhoneUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = HelloiPhone; + }; + name = Debug; + }; + ED3A69F41F7A1710003F9103 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HelloiPhoneUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.HelloiPhoneUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = HelloiPhone; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + ED3A69BF1F7A1710003F9103 /* Build configuration list for PBXProject "HelloiPhone" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69EA1F7A1710003F9103 /* Debug */, + ED3A69EB1F7A1710003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ED3A69EC1F7A1710003F9103 /* Build configuration list for PBXNativeTarget "HelloiPhone" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69ED1F7A1710003F9103 /* Debug */, + ED3A69EE1F7A1710003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ED3A69EF1F7A1710003F9103 /* Build configuration list for PBXNativeTarget "HelloiPhoneTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69F01F7A1710003F9103 /* Debug */, + ED3A69F11F7A1710003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ED3A69F21F7A1710003F9103 /* Build configuration list for PBXNativeTarget "HelloiPhoneUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED3A69F31F7A1710003F9103 /* Debug */, + ED3A69F41F7A1710003F9103 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = ED3A69BC1F7A1710003F9103 /* Project object */; +} diff --git a/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ca797d8 --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/AppDelegate.swift b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/AppDelegate.swift new file mode 100644 index 0000000..f194f21 --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// HelloiPhone +// +// Created by eunjikim on 2017. 9. 26.. +// Copyright © 2017년 eunjikim. 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/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Assets.xcassets/AppIcon.appiconset/Contents.json b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/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/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Base.lproj/LaunchScreen.storyboard b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Base.lproj/Main.storyboard b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Base.lproj/Main.storyboard new file mode 100644 index 0000000..7ae5f18 --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Base.lproj/Main.storyboard @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Info.plist b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/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/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/ViewController.swift b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/ViewController.swift new file mode 100644 index 0000000..1c68b93 --- /dev/null +++ b/SwiftCodeByEunjiKim/HelloiPhone/HelloiPhone/ViewController.swift @@ -0,0 +1,29 @@ +// +// ViewController.swift +// HelloiPhone +// +// Created by eunjikim on 2017. 9. 26.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + @IBOutlet weak var myLabel: UILabel! + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func change(_ sender: Any) { + myLabel.text = "Hello iPhone" + } + +} + diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms.xcodeproj/project.pbxproj b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms.xcodeproj/project.pbxproj new file mode 100644 index 0000000..26ce984 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms.xcodeproj/project.pbxproj @@ -0,0 +1,569 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + ED374C511FB032EB00CA50E5 /* DataCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C501FB032EB00CA50E5 /* DataCenter.swift */; }; + ED374C531FB0363200CA50E5 /* BranchListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C521FB0363200CA50E5 /* BranchListViewController.swift */; }; + ED374C551FB0364400CA50E5 /* ServiceListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C541FB0364400CA50E5 /* ServiceListViewController.swift */; }; + ED374C571FB0520B00CA50E5 /* RoomInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C561FB0520B00CA50E5 /* RoomInfoViewController.swift */; }; + ED374C591FB05A0F00CA50E5 /* ReservationListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C581FB05A0F00CA50E5 /* ReservationListViewController.swift */; }; + ED374C5B1FB05A4100CA50E5 /* ReserveRoomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C5A1FB05A4100CA50E5 /* ReserveRoomViewController.swift */; }; + ED374C5D1FB09EE700CA50E5 /* TintColorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C5C1FB09EE700CA50E5 /* TintColorViewController.swift */; }; + ED374C5F1FB0A55000CA50E5 /* EquipmentDefault.plist in Resources */ = {isa = PBXBuildFile; fileRef = ED374C5E1FB0A55000CA50E5 /* EquipmentDefault.plist */; }; + ED374C611FB0A62400CA50E5 /* EquipmentListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C601FB0A62400CA50E5 /* EquipmentListViewController.swift */; }; + EDA094D61F94D4B800ACEC56 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA094D51F94D4B800ACEC56 /* AppDelegate.swift */; }; + EDA094D81F94D4B800ACEC56 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA094D71F94D4B800ACEC56 /* ViewController.swift */; }; + EDA094DB1F94D4B800ACEC56 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDA094D91F94D4B800ACEC56 /* Main.storyboard */; }; + EDA094DD1F94D4B800ACEC56 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EDA094DC1F94D4B800ACEC56 /* Assets.xcassets */; }; + EDA094E01F94D4B800ACEC56 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDA094DE1F94D4B800ACEC56 /* LaunchScreen.storyboard */; }; + EDA095401F94DAA600ACEC56 /* MeetingRoomListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA0953F1F94DAA600ACEC56 /* MeetingRoomListViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + EDA094E71F94D4B800ACEC56 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EDA094CA1F94D4B800ACEC56 /* Project object */; + proxyType = 1; + remoteGlobalIDString = EDA094D11F94D4B800ACEC56; + remoteInfo = MeetingRooms; + }; + EDA094F21F94D4B800ACEC56 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EDA094CA1F94D4B800ACEC56 /* Project object */; + proxyType = 1; + remoteGlobalIDString = EDA094D11F94D4B800ACEC56; + remoteInfo = MeetingRooms; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + ED374C501FB032EB00CA50E5 /* DataCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataCenter.swift; sourceTree = ""; }; + ED374C521FB0363200CA50E5 /* BranchListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BranchListViewController.swift; sourceTree = ""; }; + ED374C541FB0364400CA50E5 /* ServiceListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceListViewController.swift; sourceTree = ""; }; + ED374C561FB0520B00CA50E5 /* RoomInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomInfoViewController.swift; sourceTree = ""; }; + ED374C581FB05A0F00CA50E5 /* ReservationListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReservationListViewController.swift; sourceTree = ""; }; + ED374C5A1FB05A4100CA50E5 /* ReserveRoomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReserveRoomViewController.swift; sourceTree = ""; }; + ED374C5C1FB09EE700CA50E5 /* TintColorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TintColorViewController.swift; sourceTree = ""; }; + ED374C5E1FB0A55000CA50E5 /* EquipmentDefault.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = EquipmentDefault.plist; sourceTree = ""; }; + ED374C601FB0A62400CA50E5 /* EquipmentListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EquipmentListViewController.swift; sourceTree = ""; }; + EDA094D21F94D4B800ACEC56 /* MeetingRooms.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MeetingRooms.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EDA094D51F94D4B800ACEC56 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + EDA094D71F94D4B800ACEC56 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + EDA094DA1F94D4B800ACEC56 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + EDA094DC1F94D4B800ACEC56 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + EDA094DF1F94D4B800ACEC56 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + EDA094E11F94D4B800ACEC56 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EDA094E61F94D4B800ACEC56 /* MeetingRoomsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MeetingRoomsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EDA094F11F94D4B800ACEC56 /* MeetingRoomsUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MeetingRoomsUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EDA0953F1F94DAA600ACEC56 /* MeetingRoomListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeetingRoomListViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EDA094CF1F94D4B800ACEC56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA094E31F94D4B800ACEC56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA094EE1F94D4B800ACEC56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + EDA094C91F94D4B800ACEC56 = { + isa = PBXGroup; + children = ( + EDA094D41F94D4B800ACEC56 /* MeetingRooms */, + EDA094D31F94D4B800ACEC56 /* Products */, + ); + sourceTree = ""; + }; + EDA094D31F94D4B800ACEC56 /* Products */ = { + isa = PBXGroup; + children = ( + EDA094D21F94D4B800ACEC56 /* MeetingRooms.app */, + EDA094E61F94D4B800ACEC56 /* MeetingRoomsTests.xctest */, + EDA094F11F94D4B800ACEC56 /* MeetingRoomsUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + EDA094D41F94D4B800ACEC56 /* MeetingRooms */ = { + isa = PBXGroup; + children = ( + EDA094D51F94D4B800ACEC56 /* AppDelegate.swift */, + EDA094D71F94D4B800ACEC56 /* ViewController.swift */, + EDA094D91F94D4B800ACEC56 /* Main.storyboard */, + ED374C5E1FB0A55000CA50E5 /* EquipmentDefault.plist */, + ED374C601FB0A62400CA50E5 /* EquipmentListViewController.swift */, + ED374C5C1FB09EE700CA50E5 /* TintColorViewController.swift */, + ED374C581FB05A0F00CA50E5 /* ReservationListViewController.swift */, + ED374C501FB032EB00CA50E5 /* DataCenter.swift */, + ED374C521FB0363200CA50E5 /* BranchListViewController.swift */, + ED374C541FB0364400CA50E5 /* ServiceListViewController.swift */, + EDA0953F1F94DAA600ACEC56 /* MeetingRoomListViewController.swift */, + ED374C561FB0520B00CA50E5 /* RoomInfoViewController.swift */, + EDA094DC1F94D4B800ACEC56 /* Assets.xcassets */, + ED374C5A1FB05A4100CA50E5 /* ReserveRoomViewController.swift */, + EDA094DE1F94D4B800ACEC56 /* LaunchScreen.storyboard */, + EDA094E11F94D4B800ACEC56 /* Info.plist */, + ); + path = MeetingRooms; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EDA094D11F94D4B800ACEC56 /* MeetingRooms */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDA094FA1F94D4B800ACEC56 /* Build configuration list for PBXNativeTarget "MeetingRooms" */; + buildPhases = ( + EDA094CE1F94D4B800ACEC56 /* Sources */, + EDA094CF1F94D4B800ACEC56 /* Frameworks */, + EDA094D01F94D4B800ACEC56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MeetingRooms; + productName = MeetingRooms; + productReference = EDA094D21F94D4B800ACEC56 /* MeetingRooms.app */; + productType = "com.apple.product-type.application"; + }; + EDA094E51F94D4B800ACEC56 /* MeetingRoomsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDA094FD1F94D4B800ACEC56 /* Build configuration list for PBXNativeTarget "MeetingRoomsTests" */; + buildPhases = ( + EDA094E21F94D4B800ACEC56 /* Sources */, + EDA094E31F94D4B800ACEC56 /* Frameworks */, + EDA094E41F94D4B800ACEC56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + EDA094E81F94D4B800ACEC56 /* PBXTargetDependency */, + ); + name = MeetingRoomsTests; + productName = MeetingRoomsTests; + productReference = EDA094E61F94D4B800ACEC56 /* MeetingRoomsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + EDA094F01F94D4B800ACEC56 /* MeetingRoomsUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDA095001F94D4B800ACEC56 /* Build configuration list for PBXNativeTarget "MeetingRoomsUITests" */; + buildPhases = ( + EDA094ED1F94D4B800ACEC56 /* Sources */, + EDA094EE1F94D4B800ACEC56 /* Frameworks */, + EDA094EF1F94D4B800ACEC56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + EDA094F31F94D4B800ACEC56 /* PBXTargetDependency */, + ); + name = MeetingRoomsUITests; + productName = MeetingRoomsUITests; + productReference = EDA094F11F94D4B800ACEC56 /* MeetingRoomsUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EDA094CA1F94D4B800ACEC56 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0900; + LastUpgradeCheck = 0900; + ORGANIZATIONNAME = eunjikim; + TargetAttributes = { + EDA094D11F94D4B800ACEC56 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + }; + EDA094E51F94D4B800ACEC56 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = EDA094D11F94D4B800ACEC56; + }; + EDA094F01F94D4B800ACEC56 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = EDA094D11F94D4B800ACEC56; + }; + }; + }; + buildConfigurationList = EDA094CD1F94D4B800ACEC56 /* Build configuration list for PBXProject "MeetingRooms" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EDA094C91F94D4B800ACEC56; + productRefGroup = EDA094D31F94D4B800ACEC56 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EDA094D11F94D4B800ACEC56 /* MeetingRooms */, + EDA094E51F94D4B800ACEC56 /* MeetingRoomsTests */, + EDA094F01F94D4B800ACEC56 /* MeetingRoomsUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EDA094D01F94D4B800ACEC56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDA094E01F94D4B800ACEC56 /* LaunchScreen.storyboard in Resources */, + ED374C5F1FB0A55000CA50E5 /* EquipmentDefault.plist in Resources */, + EDA094DD1F94D4B800ACEC56 /* Assets.xcassets in Resources */, + EDA094DB1F94D4B800ACEC56 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA094E41F94D4B800ACEC56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA094EF1F94D4B800ACEC56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EDA094CE1F94D4B800ACEC56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED374C611FB0A62400CA50E5 /* EquipmentListViewController.swift in Sources */, + ED374C571FB0520B00CA50E5 /* RoomInfoViewController.swift in Sources */, + EDA094D81F94D4B800ACEC56 /* ViewController.swift in Sources */, + EDA094D61F94D4B800ACEC56 /* AppDelegate.swift in Sources */, + ED374C591FB05A0F00CA50E5 /* ReservationListViewController.swift in Sources */, + ED374C511FB032EB00CA50E5 /* DataCenter.swift in Sources */, + ED374C531FB0363200CA50E5 /* BranchListViewController.swift in Sources */, + ED374C551FB0364400CA50E5 /* ServiceListViewController.swift in Sources */, + EDA095401F94DAA600ACEC56 /* MeetingRoomListViewController.swift in Sources */, + ED374C5B1FB05A4100CA50E5 /* ReserveRoomViewController.swift in Sources */, + ED374C5D1FB09EE700CA50E5 /* TintColorViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA094E21F94D4B800ACEC56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA094ED1F94D4B800ACEC56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + EDA094E81F94D4B800ACEC56 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EDA094D11F94D4B800ACEC56 /* MeetingRooms */; + targetProxy = EDA094E71F94D4B800ACEC56 /* PBXContainerItemProxy */; + }; + EDA094F31F94D4B800ACEC56 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EDA094D11F94D4B800ACEC56 /* MeetingRooms */; + targetProxy = EDA094F21F94D4B800ACEC56 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + EDA094D91F94D4B800ACEC56 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EDA094DA1F94D4B800ACEC56 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + EDA094DE1F94D4B800ACEC56 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EDA094DF1F94D4B800ACEC56 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EDA094F81F94D4B800ACEC56 /* 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.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + EDA094F91F94D4B800ACEC56 /* 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.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + EDA094FB1F94D4B800ACEC56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MeetingRooms/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MeetingRooms; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EDA094FC1F94D4B800ACEC56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MeetingRooms/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MeetingRooms; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + EDA094FE1F94D4B800ACEC56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MeetingRoomsTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MeetingRoomsTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MeetingRooms.app/MeetingRooms"; + }; + name = Debug; + }; + EDA094FF1F94D4B800ACEC56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MeetingRoomsTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MeetingRoomsTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MeetingRooms.app/MeetingRooms"; + }; + name = Release; + }; + EDA095011F94D4B800ACEC56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MeetingRoomsUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MeetingRoomsUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = MeetingRooms; + }; + name = Debug; + }; + EDA095021F94D4B800ACEC56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MeetingRoomsUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MeetingRoomsUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = MeetingRooms; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EDA094CD1F94D4B800ACEC56 /* Build configuration list for PBXProject "MeetingRooms" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA094F81F94D4B800ACEC56 /* Debug */, + EDA094F91F94D4B800ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDA094FA1F94D4B800ACEC56 /* Build configuration list for PBXNativeTarget "MeetingRooms" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA094FB1F94D4B800ACEC56 /* Debug */, + EDA094FC1F94D4B800ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDA094FD1F94D4B800ACEC56 /* Build configuration list for PBXNativeTarget "MeetingRoomsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA094FE1F94D4B800ACEC56 /* Debug */, + EDA094FF1F94D4B800ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDA095001F94D4B800ACEC56 /* Build configuration list for PBXNativeTarget "MeetingRoomsUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA095011F94D4B800ACEC56 /* Debug */, + EDA095021F94D4B800ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EDA094CA1F94D4B800ACEC56 /* Project object */; +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ff41f19 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/AppDelegate.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/AppDelegate.swift new file mode 100644 index 0000000..f4fa1b9 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/AppDelegate.swift @@ -0,0 +1,53 @@ +// +// AppDelegate.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 10. 16.. +// Copyright © 2017년 eunjikim. 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. + dataCenter.save() + } + + 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. + let userDefaultColor = UserDefaults.standard.integer(forKey: TintColorKey) + guard let defaultColor = TintColor(rawValue: userDefaultColor)?.color else { + return + } + applyTintColor(color: defaultColor) + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + dataCenter.save() + } + + +} + diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/AppIcon.appiconset/Contents.json b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "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" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/Contents.json b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/building.imageset/Contents.json b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/building.imageset/Contents.json new file mode 100644 index 0000000..c2f248e --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/building.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "building.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/building.imageset/building.png b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/building.imageset/building.png new file mode 100644 index 0000000..50631b8 Binary files /dev/null and b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/building.imageset/building.png differ diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/equipment.imageset/Contents.json b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/equipment.imageset/Contents.json new file mode 100644 index 0000000..f73165b --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/equipment.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "equipment.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/equipment.imageset/equipment.png b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/equipment.imageset/equipment.png new file mode 100644 index 0000000..2eccf20 Binary files /dev/null and b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/equipment.imageset/equipment.png differ diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/location.imageset/Contents.json b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/location.imageset/Contents.json new file mode 100644 index 0000000..73c4fdb --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/location.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "location.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/location.imageset/location.png b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/location.imageset/location.png new file mode 100644 index 0000000..064332f Binary files /dev/null and b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Assets.xcassets/location.imageset/location.png differ diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Base.lproj/LaunchScreen.storyboard b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Base.lproj/Main.storyboard b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8b91e8f --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Base.lproj/Main.storyboard @@ -0,0 +1,998 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/BranchListViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/BranchListViewController.swift new file mode 100644 index 0000000..59a274b --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/BranchListViewController.swift @@ -0,0 +1,111 @@ +// +// BranchListViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class BranchListViewController: UITableViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + //self.navigationController?.setToolbarHidden(true, animated: true) + self.navigationController?.isToolbarHidden = true + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + // MARK: - Table view data source + + override func numberOfSections(in tableView: UITableView) -> Int { + + return 1 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + let rowCount = dataCenter.branches.count + return rowCount + } + + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "BranchCell", for: indexPath) + + let branch = dataCenter.branches[indexPath.row] + cell.textLabel?.text = branch.name + + return cell + } + + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // 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. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "ServiceSegue" { + if let destination = segue.destination as? ServiceListViewController, let selectedIndex = self.tableView.indexPathForSelectedRow?.row { + destination.branch = dataCenter.branches[selectedIndex] as Branch + } + } + } + @IBAction func locationTurnOn(_ sender: Any) { + let locationAlert = UIAlertController(title: "위치 정보 요청", message: "위치 정보를 기반으로 가까운 지점을 자동으로 선택할 수 있습니다. 또는 지도앱에서 지점의 위치 정보를 제공해드립니다. 선택하신 기능이 계속 제공됩니다. 환경설정에서 제공되는 기능을 변경할 수 있습니다.", preferredStyle: .alert) + let locationAction = UIAlertAction(title: "위치정보 켜기", style:.default, handler:{(action:UIAlertAction) -> Void in print("위치정보 켜기 선택")}) + let openMapAction = UIAlertAction(title: "지도앱에서 열기", style:.default, handler:{(action:UIAlertAction) -> Void in print("지도 앱에서 열기 선택") + }) + locationAlert.addAction(locationAction) + locationAlert.addAction(openMapAction) + + self.present(locationAlert, animated: true, completion: nil) + } + + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/DataCenter.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/DataCenter.swift new file mode 100644 index 0000000..f086719 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/DataCenter.swift @@ -0,0 +1,154 @@ +// +// DataCenter.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import Foundation + +let dataCenter:DataCenter = DataCenter() +let fileName = "BranchData.brch" + +class DataCenter { + var branches:[Branch] = [] + var filePath:String { get{ + let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! + return documentDirectory + fileName + }} + + + + init(){ + if FileManager.default.fileExists(atPath: self.filePath) { + //read + if let unarchArray = NSKeyedUnarchiver.unarchiveObject(withFile: self.filePath) as? [Branch] { + branches += unarchArray + } + } else { + //create + branches += defaultData() + } + } + + func defaultData() -> Array { + let banksyRoom = MeetingRoom(name:"Bansky", capacity: 4) + let kahloRoom = MeetingRoom(name:"Kahlo",capacity: 8) + let riveraRoom = MeetingRoom(name:"Rivera", capacity: 8) + let picassoRoom = MeetingRoom(name: "Picasso", capacity: 10) + + let vehicleService = Service(name: "차량예약") + let meetingRoomService = Service(name: "회의실예약") + let visitorService = Service(name:"방문자예약") + let deskService = Service(name: "데스크예약") + meetingRoomService.items = [banksyRoom, kahloRoom, riveraRoom, picassoRoom] + + let pangyoBranch = Branch(name: "판교점") + let samsungBranch = Branch(name: "삼성점") + let yeoksamBranch = Branch(name: "역삼점") + let sinrimBranch = Branch(name: "신림점") + let songdoBranch = Branch(name: "송도점") + let anamBranch = Branch(name: "안암점") + pangyoBranch.services = [vehicleService, meetingRoomService, visitorService, deskService] + + branches += [pangyoBranch, samsungBranch, yeoksamBranch, sinrimBranch, songdoBranch, anamBranch] + + let branchArray = [samsungBranch, pangyoBranch, yeoksamBranch, sinrimBranch, songdoBranch, anamBranch] + + return branchArray + } + func save(){ + NSKeyedArchiver.archiveRootObject(self.branches, toFile: self.filePath) + } +} + +class Branch:NSObject, NSCoding { + let name:String + var services:[Service]? + + init(name:String) { + self.name = name + } + + required init?(coder aDecoder: NSCoder) { + self.name = aDecoder.decodeObject(forKey: "name") as! String + self.services = aDecoder.decodeObject(forKey: "services") as? [Service] + } + + func encode(with aCoder: NSCoder) { + aCoder.encode(self.name, forKey: "name") + aCoder.encode(self.services, forKey: "services") + } +} + +class Service:NSObject, NSCoding { + let name:String + var items:[MeetingRoom]? + + init(name:String) { + self.name = name + } + required init?(coder aDecoder: NSCoder) { + self.name = aDecoder.decodeObject(forKey: "name") as! String + self.items = aDecoder.decodeObject(forKey: "item") as? [MeetingRoom] + } + + func encode(with aCoder: NSCoder) { + aCoder.encode(self.name, forKey: "name") + aCoder.encode(self.items, forKey: "item") + } +} + +class MeetingRoom:NSObject, NSCoding { + let name:String + let capacity:Int + var reservations:[Reservation]? + + init(name:String, capacity:Int) { + self.name = name + self.capacity = capacity + } + required init?(coder aDecoder: NSCoder) { + self.name = aDecoder.decodeObject(forKey: "name") as! String + self.capacity = aDecoder.decodeInteger(forKey: "capacity") + self.reservations = aDecoder.decodeObject(forKey: "reservations") as? [Reservation] + } + + func encode(with aCoder: NSCoder) { + aCoder.encode(self.name, forKey: "name") + aCoder.encode(self.capacity, forKey: "capacity") + aCoder.encode(self.reservations, forKey: "reservations") + } +} + +class Reservation:NSObject, NSCoding { + var hostName:String + var date:NSDate + var attendees:Int + var equipments:[String] + var catering:Bool + + override init() { + self.hostName = "Host of Meeting" + self.date = NSDate() + self.attendees = 1 + self.equipments = [] + self.catering = false + } + required init?(coder aDecoder: NSCoder) { + self.hostName = aDecoder.decodeObject(forKey: "hostName") as! String + self.date = aDecoder.decodeObject(forKey: "date") as! NSDate + self.attendees = aDecoder.decodeInteger(forKey: "attendees") + self.equipments = aDecoder.decodeObject(forKey: "equipments") as! [String] + self.catering = aDecoder.decodeBool(forKey: "catering") + } + + func encode(with aCoder: NSCoder) { + aCoder.encode(self.hostName, forKey: "hostName") + aCoder.encode(self.date, forKey: "date") + aCoder.encode(self.attendees, forKey: "attendees") + aCoder.encode(self.equipments, forKey: "equipments") + aCoder.encode(self.catering, forKey: "catering") + } +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/EquipmentDefault.plist b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/EquipmentDefault.plist new file mode 100644 index 0000000..5962ab0 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/EquipmentDefault.plist @@ -0,0 +1,30 @@ + + + + + + name + HP G2020T + amount + 15 + + + name + Lenovo P900TW + amount + 10 + + + name + HP DL320e + amount + 7 + + + name + TYAN KST208 + amount + 20 + + + diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/EquipmentListViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/EquipmentListViewController.swift new file mode 100644 index 0000000..ef64976 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/EquipmentListViewController.swift @@ -0,0 +1,115 @@ +// +// EquipmentListViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +let EquipmentFileName = "EquipmentsDefault" + +class EquipmentListViewController: UITableViewController { + var equipments:Array = [] + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + + guard let equipmentURL = Bundle.main.url(forResource: EquipmentFileName, withExtension: "plist") else { + print("No File") + return + } + if let equipmentsArray = NSArray(contentsOf: equipmentURL) { + print(equipmentsArray) + equipments.append(equipmentsArray) + } + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + // MARK: - Table view data source + + override func numberOfSections(in tableView: UITableView) -> Int { + // #warning Incomplete implementation, return the number of sections + return 1 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + // #warning Incomplete implementation, return the number of rows + return equipments.count + } + + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "EquipmentCell", for: indexPath) + + guard let equipment = equipments[indexPath.row] as? [String:AnyObject] else { + return cell + } + + if let name = equipment["name"] as? String { + cell.textLabel?.text = name + } + if let amount = equipment["amount"] as? Int { + cell.detailTextLabel?.text = String(amount) + } + + return cell + } + + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // 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. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Info.plist b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/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/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/MeetingRoomListViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/MeetingRoomListViewController.swift new file mode 100644 index 0000000..846dfbc --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/MeetingRoomListViewController.swift @@ -0,0 +1,143 @@ +// +// MeetingRoomListViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 10. 16.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class MeetingRoomListViewController: UITableViewController { + //var meetingRooms:[String:[String:Int]] = ["Meeting":["Bansky":4, "Rivera":8, "Kahlo":8, "Picasso":10], "Seminar":["Cezanne":20, "Matisse":30, "Renoir":40]] + var service:Service? + + /* + func meetingRoomsAtIndex(index:Int) -> (key:String, value:[String:Int]) { + let orderedMeetringRooms = meetingRooms.sorted(by:{$0.1.first!.1 < $1.1.first!.1}) + return orderedMeetringRooms[index] + } + */ + + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + self.title = service?.name + self.navigationController?.isToolbarHidden = true + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + // MARK: - Table view data source + + override func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + //let categoryValues = Array(meetingRooms.values)[section] + //let orderedMeetringRooms = meetingRooms.sorted(by:{$0.1.first!.1 < $1.1.first!.1}) + //let rowCount = meetingRoomsAtIndex(index: section).value.count + guard let rowCount = service?.items?.count else { + return 0 + } + return rowCount + } + + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "ItemCell", for: indexPath) + //let orderedMeetringRooms = meetingRooms.sorted(by:{$0.1.first!.1 < $1.1.first!.1}) + //let categoryValue = orderedMeetringRooms[indexPath.section].1 + //let categoryValue = meetingRoomsAtIndex(index: indexPath.section).value + //let categoryValue = Array(meetingRooms.values)[indexPath.section] + //let orderedCategoryValue = categoryValue.sorted(by:{$0.1 < $1.1}) + +// let roomName = Array(categoryValue.keys)[indexPath.row] +// let capacity = Array(categoryValue.values)[indexPath.row] + //let roomName = orderedCategoryValue[indexPath.row].0 + //let capacity = orderedCategoryValue[indexPath.row].1 + + guard let meetingRoom = service?.items?[indexPath.row] else { + return cell + } + + cell.textLabel!.text = meetingRoom.name + cell.detailTextLabel!.text = String(meetingRoom.capacity) + + return cell + } + /* + override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + //let orderedMeetringRooms = meetingRooms.sorted(by:{$0.1.first!.1 < $1.1.first!.1}) + //return Array(meetingRooms.keys)[section] + return meetingRoomsAtIndex(index: section).key + } + + override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { + //let orderedMeetringRooms = meetingRooms.sorted(by:{$0.1.first!.1 < $1.1.first!.1}) + //let rowCount = Array(meetingRooms.values)[section].count + let rowCount = meetingRoomsAtIndex(index: section).value.count + return "\(rowCount) rooms" + } + */ + + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // 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. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "ReservationSegue" { + guard let destination = segue.destination as? ReservationListViewController, let selectedIndex = self.tableView.indexPathForSelectedRow?.row, let meetingRoom = service?.items?[selectedIndex] else { + return + } + destination.meetingRoom = meetingRoom + } + } + + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ReservationListViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ReservationListViewController.swift new file mode 100644 index 0000000..2188e8a --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ReservationListViewController.swift @@ -0,0 +1,118 @@ +// +// ReservationListViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ReservationListViewController: UITableViewController { + + var meetingRoom:MeetingRoom? + var newReservation:Reservation? + + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + func addNewItem(reservation:Reservation) { + if (self.meetingRoom?.reservations?.append(reservation)) == nil { + self.meetingRoom?.reservations = [reservation] + } + dataCenter.save() + self.tableView.reloadData() + } + + @IBAction func unwindToReservationList(segue:UIStoryboardSegue) { + print("unwind") + } + + // MARK: - Table view data source + + override func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + guard let rowCount = meetingRoom?.reservations?.count else { + return 0 + } + return rowCount + } + + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "ReservationCell", for: indexPath) + + guard let reservation = meetingRoom?.reservations?[indexPath.row] else { + return cell + } + cell.textLabel?.text = reservation.date.description + cell.detailTextLabel?.text = reservation.hostName + + return cell + } + + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // 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. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "ReserveDone" { + guard let reservation = newReservation, let ReservationListVC = segue.destination as? ReservationListViewController else { + return + } + ReservationListVC.addNewItem(reservation: reservation) + } + } + + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ReserveRoomViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ReserveRoomViewController.swift new file mode 100644 index 0000000..203eba9 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ReserveRoomViewController.swift @@ -0,0 +1,142 @@ +// +// ReserveRoomViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ReserveRoomViewController: UITableViewController { + + @IBOutlet weak var equipmentField: UITextField! + @IBOutlet weak var attendeeField: UITextField! + @IBOutlet weak var hostNameField: UITextField! + @IBOutlet weak var datePicker: UIDatePicker! + @IBOutlet weak var cateringSwitch: UISwitch! + + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func makeReservation(_ sender: Any) { + guard let reservation = newReservation() else { + self.dismiss(animated: true, completion: nil) + return + } + switch self.presentingViewController { + case let tabBarC as UITabBarController: + if let navigationC = tabBarC.selectedViewController as? UINavigationController, let reservationListVC = navigationC.topViewController as? ReservationListViewController { + reservationListVC.addNewItem(reservation: reservation) + } + case let navigationC as UINavigationController: + if let reservationListVC = navigationC.topViewController as? ReservationListViewController { + reservationListVC.addNewItem(reservation: reservation) + } + case let reservationListVC as ReservationListViewController: + reservationListVC.addNewItem(reservation: reservation) + default: + break + } + self.dismiss(animated: true, completion: nil) + } + + @IBAction func cancelReservation(_ sender: Any) { + self.dismiss(animated: true, completion: nil) + } + + func newReservation() -> Reservation? { + let reservation = Reservation() + let host = hostNameField.text! + if host.isEmpty { + return nil + } + reservation.hostName = host + reservation.date = datePicker.date as NSDate + if let equipmentArray = equipmentField.text?.characters.split(separator: ",").map(String.init) { + reservation.equipments = equipmentArray + } + reservation.catering = cateringSwitch.isOn + return reservation + } + + // MARK: - Table view data source +/* + override func numberOfSections(in tableView: UITableView) -> Int { + // #warning Incomplete implementation, return the number of sections + return 0 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + // #warning Incomplete implementation, return the number of rows + return 0 + } +*/ + /* + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) + + // Configure the cell... + + return cell + } + */ + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // 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. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/RoomInfoViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/RoomInfoViewController.swift new file mode 100644 index 0000000..188407a --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/RoomInfoViewController.swift @@ -0,0 +1,98 @@ +// +// RoomInfoViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class RoomInfoViewController: UITableViewController { + @IBAction func modalDismiss(_ sender: Any) { + self.dismiss(animated: true, completion: nil) + } + + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + // MARK: - Table view data source +/* + override func numberOfSections(in tableView: UITableView) -> Int { + // #warning Incomplete implementation, return the number of sections + return 0 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + // #warning Incomplete implementation, return the number of rows + return 0 + } +*/ + /* + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) + + // Configure the cell... + + return cell + } + */ + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // 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. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ServiceListViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ServiceListViewController.swift new file mode 100644 index 0000000..1990f4a --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ServiceListViewController.swift @@ -0,0 +1,114 @@ +// +// ServiceListViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ServiceListViewController: UITableViewController { + + var branch:Branch? + + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + self.title = branch?.name + //self.navigationItem.title = "\(branch!.name) 정보" + //self.navigationController?.isToolbarHidden = false + //self.navigationController?.setToolbarHidden(false, animated: true) + //self.tabBarController?.setTabbarHidden = true + self.navigationController?.isToolbarHidden = true + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + // MARK: - Table view data source + + override func numberOfSections(in tableView: UITableView) -> Int { + + return 1 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + + guard let rowCount = branch?.services?.count else { + return 0 + } + return rowCount + } + + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "ServiceCell", for: indexPath) + + guard let service = branch?.services?[indexPath.row] else { + return cell + } + cell.textLabel?.text = service.name + return cell + } + + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // 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. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + if segue.identifier == "MeetingRoomSegue" { + guard let destination = segue.destination as? MeetingRoomListViewController, let selectedIndex = self.tableView.indexPathForSelectedRow?.row, let service = branch?.services?[selectedIndex] else { + return + } + destination.service = service + } + } + + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/TintColorViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/TintColorViewController.swift new file mode 100644 index 0000000..38e6b53 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/TintColorViewController.swift @@ -0,0 +1,71 @@ +// +// TintColorViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +enum TintColor:Int { + case Blue=0, Red, Green, Purple + + var color:UIColor {get{ + switch self { + case .Blue: + return UIColor.blue + case .Red: + return UIColor.red + case .Green: + return UIColor.green + case .Purple: + return UIColor.purple + } + } + } +} +let TintColorKey = "TintColor" + +func applyTintColor(color:UIColor){ + guard let window = UIApplication.shared.keyWindow else { + return + } + window.tintColor = color +} + +class TintColorViewController: UIViewController { + + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + let userDefaultColor = UserDefaults.standard.integer(forKey: TintColorKey) + self.tintColorSegment.selectedSegmentIndex = userDefaultColor + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + @IBOutlet weak var tintColorSegment: UISegmentedControl! + @IBAction func TintColorChanged(_ sender: Any) { + let selectedIndex = self.tintColorSegment.selectedSegmentIndex + UserDefaults.standard.set(selectedIndex, forKey: TintColorKey) + guard let changedColor = TintColor(rawValue: selectedIndex)?.color else { + return + } + applyTintColor(color: changedColor) + } + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ViewController.swift b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ViewController.swift new file mode 100644 index 0000000..c1b8555 --- /dev/null +++ b/SwiftCodeByEunjiKim/MeetingRooms/MeetingRooms/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// MeetingRooms +// +// Created by eunjikim on 2017. 10. 16.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/SwiftCodeByEunjiKim/MeetingRooms/building.png b/SwiftCodeByEunjiKim/MeetingRooms/building.png new file mode 100644 index 0000000..50631b8 Binary files /dev/null and b/SwiftCodeByEunjiKim/MeetingRooms/building.png differ diff --git a/SwiftCodeByEunjiKim/MeetingRooms/equipment.png b/SwiftCodeByEunjiKim/MeetingRooms/equipment.png new file mode 100644 index 0000000..2eccf20 Binary files /dev/null and b/SwiftCodeByEunjiKim/MeetingRooms/equipment.png differ diff --git a/SwiftCodeByEunjiKim/MeetingRooms/location.png b/SwiftCodeByEunjiKim/MeetingRooms/location.png new file mode 100644 index 0000000..064332f Binary files /dev/null and b/SwiftCodeByEunjiKim/MeetingRooms/location.png differ diff --git a/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter.xcodeproj/project.pbxproj b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter.xcodeproj/project.pbxproj new file mode 100644 index 0000000..cc9f0b2 --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter.xcodeproj/project.pbxproj @@ -0,0 +1,329 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + EDAEB3BB1F9A4AA8003BBC90 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDAEB3BA1F9A4AA8003BBC90 /* AppDelegate.swift */; }; + EDAEB3BD1F9A4AA8003BBC90 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDAEB3BC1F9A4AA8003BBC90 /* ViewController.swift */; }; + EDAEB3C01F9A4AA8003BBC90 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDAEB3BE1F9A4AA8003BBC90 /* Main.storyboard */; }; + EDAEB3C21F9A4AA8003BBC90 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EDAEB3C11F9A4AA8003BBC90 /* Assets.xcassets */; }; + EDAEB3C51F9A4AA8003BBC90 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDAEB3C31F9A4AA8003BBC90 /* LaunchScreen.storyboard */; }; + EDAEB3CD1F9A4FBE003BBC90 /* Money.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDAEB3CC1F9A4FBE003BBC90 /* Money.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + EDAEB3B71F9A4AA7003BBC90 /* MoneyConverter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MoneyConverter.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EDAEB3BA1F9A4AA8003BBC90 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + EDAEB3BC1F9A4AA8003BBC90 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + EDAEB3BF1F9A4AA8003BBC90 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + EDAEB3C11F9A4AA8003BBC90 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + EDAEB3C41F9A4AA8003BBC90 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + EDAEB3C61F9A4AA8003BBC90 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EDAEB3CC1F9A4FBE003BBC90 /* Money.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Money.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EDAEB3B41F9A4AA7003BBC90 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + EDAEB3AE1F9A4AA7003BBC90 = { + isa = PBXGroup; + children = ( + EDAEB3B91F9A4AA7003BBC90 /* MoneyConverter */, + EDAEB3B81F9A4AA7003BBC90 /* Products */, + ); + sourceTree = ""; + }; + EDAEB3B81F9A4AA7003BBC90 /* Products */ = { + isa = PBXGroup; + children = ( + EDAEB3B71F9A4AA7003BBC90 /* MoneyConverter.app */, + ); + name = Products; + sourceTree = ""; + }; + EDAEB3B91F9A4AA7003BBC90 /* MoneyConverter */ = { + isa = PBXGroup; + children = ( + EDAEB3BA1F9A4AA8003BBC90 /* AppDelegate.swift */, + EDAEB3BC1F9A4AA8003BBC90 /* ViewController.swift */, + EDAEB3CC1F9A4FBE003BBC90 /* Money.swift */, + EDAEB3BE1F9A4AA8003BBC90 /* Main.storyboard */, + EDAEB3C11F9A4AA8003BBC90 /* Assets.xcassets */, + EDAEB3C31F9A4AA8003BBC90 /* LaunchScreen.storyboard */, + EDAEB3C61F9A4AA8003BBC90 /* Info.plist */, + ); + path = MoneyConverter; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EDAEB3B61F9A4AA7003BBC90 /* MoneyConverter */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDAEB3C91F9A4AA8003BBC90 /* Build configuration list for PBXNativeTarget "MoneyConverter" */; + buildPhases = ( + EDAEB3B31F9A4AA7003BBC90 /* Sources */, + EDAEB3B41F9A4AA7003BBC90 /* Frameworks */, + EDAEB3B51F9A4AA7003BBC90 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MoneyConverter; + productName = MoneyConverter; + productReference = EDAEB3B71F9A4AA7003BBC90 /* MoneyConverter.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EDAEB3AF1F9A4AA7003BBC90 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0900; + LastUpgradeCheck = 0900; + ORGANIZATIONNAME = eunjikim; + TargetAttributes = { + EDAEB3B61F9A4AA7003BBC90 = { + CreatedOnToolsVersion = 9.0.1; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = EDAEB3B21F9A4AA7003BBC90 /* Build configuration list for PBXProject "MoneyConverter" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EDAEB3AE1F9A4AA7003BBC90; + productRefGroup = EDAEB3B81F9A4AA7003BBC90 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EDAEB3B61F9A4AA7003BBC90 /* MoneyConverter */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EDAEB3B51F9A4AA7003BBC90 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDAEB3C51F9A4AA8003BBC90 /* LaunchScreen.storyboard in Resources */, + EDAEB3C21F9A4AA8003BBC90 /* Assets.xcassets in Resources */, + EDAEB3C01F9A4AA8003BBC90 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EDAEB3B31F9A4AA7003BBC90 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDAEB3CD1F9A4FBE003BBC90 /* Money.swift in Sources */, + EDAEB3BD1F9A4AA8003BBC90 /* ViewController.swift in Sources */, + EDAEB3BB1F9A4AA8003BBC90 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + EDAEB3BE1F9A4AA8003BBC90 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EDAEB3BF1F9A4AA8003BBC90 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + EDAEB3C31F9A4AA8003BBC90 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EDAEB3C41F9A4AA8003BBC90 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EDAEB3C71F9A4AA8003BBC90 /* 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.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + EDAEB3C81F9A4AA8003BBC90 /* 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.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + EDAEB3CA1F9A4AA8003BBC90 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MoneyConverter/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MoneyConverter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EDAEB3CB1F9A4AA8003BBC90 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MoneyConverter/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.MoneyConverter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EDAEB3B21F9A4AA7003BBC90 /* Build configuration list for PBXProject "MoneyConverter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDAEB3C71F9A4AA8003BBC90 /* Debug */, + EDAEB3C81F9A4AA8003BBC90 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDAEB3C91F9A4AA8003BBC90 /* Build configuration list for PBXNativeTarget "MoneyConverter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDAEB3CA1F9A4AA8003BBC90 /* Debug */, + EDAEB3CB1F9A4AA8003BBC90 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EDAEB3AF1F9A4AA7003BBC90 /* Project object */; +} diff --git a/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..5566428 --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/AppDelegate.swift b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/AppDelegate.swift new file mode 100644 index 0000000..99f71c8 --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// MoneyConverter +// +// Created by eunjikim on 2017. 10. 21.. +// Copyright © 2017년 eunjikim. 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/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Assets.xcassets/AppIcon.appiconset/Contents.json b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/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/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Base.lproj/LaunchScreen.storyboard b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Base.lproj/Main.storyboard b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Base.lproj/Main.storyboard new file mode 100644 index 0000000..3a9ef7e --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Base.lproj/Main.storyboard @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Info.plist b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/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/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Money.swift b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Money.swift new file mode 100644 index 0000000..3c12ba0 --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/Money.swift @@ -0,0 +1,51 @@ +// +// Money.swift +// MoneyConverter +// +// Created by eunjikim on 2017. 10. 21.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import Foundation + +enum Currency:Int { + case USD = 0, KRW, JPY, EUR + + var ratio:Double { + get{ + switch self{ + case .USD : return 1.0 + case .KRW : return 1178.5 + case .JPY : return 122.45 + case .EUR : return 0.92 + } + } + } + var symbol:String { + get{ + switch self{ + case .USD : return "$" + case .KRW : return "₩" + case .JPY : return "¥" + case .EUR : return "€" + } + } + } +} + +struct Money { + var usdollar = 0.0 + + init(_ _usdollar:Double){ + usdollar = _usdollar + } + init(_ amount:Double, currency:Currency) { + usdollar = amount / currency.ratio + } + func valueInCurrency(currency:Currency) -> String { + return "\(currency.symbol)" + "\(usdollar * currency.ratio)" + } +} + +let myMoney = Money(120) +let incomeInKRW = Money(350_000, currency: .KRW) diff --git a/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/ViewController.swift b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/ViewController.swift new file mode 100644 index 0000000..d4f377e --- /dev/null +++ b/SwiftCodeByEunjiKim/MoneyConverter/MoneyConverter/ViewController.swift @@ -0,0 +1,50 @@ +// +// ViewController.swift +// MoneyConverter +// +// Created by eunjikim on 2017. 10. 21.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + @IBOutlet weak var currencySegment: UISegmentedControl! + + @IBOutlet weak var sourceMoneyField: UITextField! + + @IBOutlet weak var targetMoneyLabel: UILabel! + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + @IBAction func convertMoney(_ sender: Any) { + guard let sourceCurrency = Currency(rawValue: currencySegment.selectedSegmentIndex) else { + print("Source Currency Error") + return + } + + guard let sourceAmount = Double(sourceMoneyField.text!) else { + targetMoneyLabel.text = "Error" + return + } + let sourceMoney = Money(sourceAmount, currency: sourceCurrency) + + var targetMoneyString = "" + for i in 0..<4 { + targetMoneyString += sourceMoney.valueInCurrency(currency: Currency.init(rawValue: i)!) + targetMoneyString += "\r\n" + } + targetMoneyLabel.text = targetMoneyString + } +} + diff --git a/SwiftCodeByEunjiKim/Session2_1.playground/Contents.swift b/SwiftCodeByEunjiKim/Session2_1.playground/Contents.swift new file mode 100644 index 0000000..38eae61 --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_1.playground/Contents.swift @@ -0,0 +1,152 @@ +//: Playground - noun: a place where people can play + +import UIKit + +//---------- +//: let과 var + +let maxSpeed:Int = 200 //Int라는 type inferring 생략가능 +// maxSpeed += 10 //error + +var currentSpeed:Int = 110 +currentSpeed += 10 +// currentSpeed += 20.5 //error +currentSpeed += Int(20.5) + + +//---------- +//: String과 Numbers + +let intMax = Int.max +let UintMax = UInt.max +let intMin = Int.min +let UintMin = UInt.min + +let pi = 3.14 +let divider = 2 +let halfPi = 3.14/Double(divider) //Int는 Int끼리, Double은 Double끼리 연산 + +let name:String = "Eunji" + +var greeting = "Hello" +greeting += " " + name + +let characters = name.characters +let count = characters.count + +let url = "www.codershigh.com" +let hasProtocol = url.hasPrefix("http://") + +print("\(name)") + + +//---------- +//: Tuple + +let time1 = (9, 0, 48) +let time2:(h:Int, m:Int, s:Int) = (11, 51, 5) + +let duration = (time1, time2) + +let (start, end) = duration +let endHour = end.h + +typealias Time = (h:Int, m:Int, s:Int) +typealias Duration = (start:Time, end: Time) + +let today:Duration = ((9, 10, 23), (17, 8, 21)) + +print("We studied until \(today.end.h) today") + + +//---------- +//: Array + +var meetingRooms:Array = ["Bansky", "Rivera", "Kahlo", "Picasso", "Cezanne", "Matisse"] +var groups:[Int] = [10, 8, 14, 9] + +meetingRooms += ["Renoir"] +meetingRooms.insert("Renoir", at: 0) + +var speedHistory:[Int] = [] +speedHistory += [currentSpeed] +let gpsSpeed0901 = 114.1 +speedHistory.append(Int(gpsSpeed0901)) +speedHistory.last + +let historyBackup = speedHistory +speedHistory += [150] +historyBackup + + +//---------- +//: Dictionary + +var roomCapacity:[String:Int] = ["Bansky":4, "Rivera":8, "Kahlo":8, "Picasso":10, "Cezanne":20, "Matisse":30] +roomCapacity["Renoir"] = 40 +roomCapacity["Kahlo"] + +let roomNames = [String](roomCapacity.keys) +let capacities = [Int](roomCapacity.values) + +let total = capacities.reduce(0, +) + +let subway2 :Set = ["시청", "을지로입구", "을지로3가", "을지로4가","동대문역사문화공원", "신당", "상왕십리", "왕십리", "한양대", "뚝섬", "성수", "건대입구", "구의", "강변", "잠실나루", "잠실", "신천", "종합운동장", "삼성", "선릉", "역삼", "강남", "교대", "서초", "방배", "사당", "낙성대", "서울대입구", "봉천", "신림", "신대방", "구로디지털단지", "대림", "신도림", "문래", "영등포구청", "당산", "합정", "홍대입구", "신촌", "이대", "아현", "충정로"] +subway2.count + +let subway3 :Set = ["지축", "구파발", "연신내", "불광", "녹번", "홍제", "무악재", "독립문", "경복궁", "안국", "종로3가", "을지로3가", "충무로", "동대입구", "약수", "금호", "옥수", "압구정", "신사", "잠원", "고속터미널", "교대", "남부터미널", "양재", "매봉", "도곡", "대치", "학여울", "대청", "일원", "수서", "가락시장", "경찰병원", "오금"] +subway3.count + +let transfer = subway2.intersection(subway3) +transfer.count +let notTransfer = subway2.subtracting(subway3) +notTransfer.count + +let union = subway2.union(subway3) +union.count +let exOR = subway2.symmetricDifference(subway3) +exOR.count + + +//---------- +//: Control Flow + +if transfer.count > 0 { + print("환승역은 \(transfer) 입니다.") +} else { + print("환승역은 없습니다.") +} + +for station in subway2{ + print("이번역은 \(station)입니다.") +} + +for (roomName, capacity) in roomCapacity { + let roomDescription:String + switch capacity { + case 4: + roomDescription = "\(roomName)은 스터디룸이며 정원은 \(capacity)명입니다." + case 5...10: + roomDescription = "\(roomName)은 팀 세미나룸이며 정원은 \(capacity)명입니다." + case 11...30: + roomDescription = "\(roomName)은 그룹 세미나룸이며 정원은 \(capacity)명입니다." + case _ where capacity > 30: + roomDescription = "\(roomName)의 정원은 \(capacity)명이며 별도의 사용신청이 필요합니다." + default: + roomDescription = "\(roomName)의 정보를 다시 확인해주세요." + } +} + +typealias ShoppingItem = (name:String, amount:Int) +let cart = ShoppingItem("beer", 1) + +switch cart { +case ("beer", 0...3): + print("Guide to small item counter.") +case ("beer", 51...100): + print("Call manager.") +case ("beer", let amount) where amount>100: + print("Call police.") +default: + print("Make wait in line.") +} diff --git a/SwiftCodeByEunjiKim/Session2_1.playground/contents.xcplayground b/SwiftCodeByEunjiKim/Session2_1.playground/contents.xcplayground new file mode 100644 index 0000000..5da2641 --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_1.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/Session2_1.playground/playground.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/Session2_1.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_1.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/Session2_2.playground/Contents.swift b/SwiftCodeByEunjiKim/Session2_2.playground/Contents.swift new file mode 100644 index 0000000..38915ab --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_2.playground/Contents.swift @@ -0,0 +1,175 @@ +//: Playground - noun: a place where people can play + +import UIKit + +//---------------------- +//: Optional & Function + +var title:String = "Storyboard Prototyping" +var ratings : [Double]? = nil +var supportURL : String? = nil + +supportURL = "www.cordershigh.com" +ratings = [4.5, 3.0, 5.0, 2.5] + +func ratingRecord (history:[Double]) -> (average:Double, min:Double, max:Double){ + var sum = 0.0, min = history[0], max = history[0] + + for value in history { + if min > value { min = value } + if max < value { max = value } + sum += value + } + + let average = sum / Double(history.count) + + return (average, min, max) +} + +var bookDescription:String = "\(title)" +//if ratings != nil { +// bookDescription += "has \(ratings!.count) ratings." +//} +//if supportURL != nil { +// bookDescription += "\r\nsupport web page: \(supportURL!)" +//} +if let theRatings = ratings { //optional binding + let record = ratingRecord(history: theRatings) + bookDescription += " has \(theRatings.count) ratings, \r\naverage is \(record.average), from \(record.min) to \(record.max)." +} +//if let theURL = supportURL { +// bookDescription += "\r\nsupport web page: \(theURL)" +//} +bookDescription += "\r\nsupport web page: \(supportURL!)" +print("\(bookDescription)") + +//print("\(title) has \(ratings!.count) ratings. \r\nsupport web page: \(supportURL)") + + +//---------------------- +//: Structure & Class & Enumerations + +struct Task { + var title:String //Stored property + var time:Int? + + var owner:Employee + //var participant:Employee? + + var type:TaskType + + enum TaskType { + case Call(number:String) + case Report(to:Employee, when:String) + case Meet(with:Employee, location:String) + case Support(who:Employee, duration:Int) + + var typeTitle:String { //Computed property + get { + let titleString:String + switch self { + case .Call: + titleString = "Call" + case .Report: + titleString = "Report" + case .Meet: + titleString = "Meet" + case .Support: + titleString = "Support" + } + return titleString + } + } + } + + init (type:TaskType, owner:Employee){ + self.type = type + self.title = type.typeTitle + self.owner = owner + self.time = nil + //self.participant = nil + } + + func doBasicTask() -> String { + let taskDescription:String + switch type { + case .Call(let number) : + taskDescription = "\(owner.name) make a call to \(number)" + case .Report(let receiver, let time) : + taskDescription = "\(owner.name) report to \(receiver.name) at \(time)" + case .Meet(let participant, let location) : + taskDescription = "\(owner.name) meet \(participant.name) at \(location)" + case .Support(let taskOwner, let duration) : + taskDescription = "\(owner.name) support \(taskOwner.name) for \(duration) days" + default: + taskDescription = "Need more information for task." + } + return taskDescription + } +} + +class Employee { + var name:String? + var phoneNumber:String? + var boss:Employee? + + init (name:String){ + self.name = name + } + + convenience init (name:String, phone:String){ + self.init(name:name) + self.phoneNumber = phone + } + + func report() { + if let myBoss = boss { + print("\(self.name) reported to \(myBoss.name)") + } else { + print("\(String(describing: name)) don't have boss") + } + } + + func callTaskToBoss() -> Task? { + if let myBoss = boss, let callTo = myBoss.phoneNumber { + var callTask = Task(type: .Call(number: callTo), owner: self) + return callTask + } + return nil + } +} + +let me:Employee = Employee(name: "Alex", phone: "010-1234-5678") //class는 let으로 만들더라도 내부의 값이 var라면 수정 가능 +//me.name = "Alex" +//me.phoneNumber = "010-1234-5678" + +let toby = Employee(name: "Toby") +//toby.name = "Toby" +toby.phoneNumber = "011-5678-1234" + +me.boss = toby +me.report() +var todayTask:[Task] = [] + +//var callTask = Task(title: "Call to Toby", time: 10*60, owner: me, participant: toby, type:.Call) //let으로 struct를 만들면 수정 불가 +//var reportTask = Task(title: "Report to Boss", time: nil, owner: me, participant: nil, type:Task.TaskType.Report) + +//var callTask = Task(type: .Call, owner: me) +//callTask.time = 10*60 +var reportTask = Task(type: .Report(to:toby, when:"Afternoon"), owner: me) +todayTask += [reportTask] +if let callTask = me.callTaskToBoss() { + todayTask += [callTask] + callTask.doBasicTask() +} +reportTask.doBasicTask() + +//callTask.participant?.phoneNumber = "010-5678-1234" +//print("\(toby.phoneNumber)") + +//todayTask += [callTask, reportTask] //todayTask에는 callTask의 값이 복사되어 들어간다 +//callTask.title = "Call to Randy" +//print("today task = \(todayTask), callTask=\(callTask)") + + + diff --git a/SwiftCodeByEunjiKim/Session2_2.playground/contents.xcplayground b/SwiftCodeByEunjiKim/Session2_2.playground/contents.xcplayground new file mode 100644 index 0000000..5da2641 --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_2.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/Session2_2.playground/playground.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/Session2_2.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_2.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/Session2_practice.playground/Contents.swift b/SwiftCodeByEunjiKim/Session2_practice.playground/Contents.swift new file mode 100644 index 0000000..1cfccef --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_practice.playground/Contents.swift @@ -0,0 +1,92 @@ +//: Playground - noun: a place where people can play + +import UIKit + + +struct WatchDevice { + var pairediPhone:String? = nil + var appInstalled = false + + enum WatchSize { + case m42,m38 + } +} + +var appleWatch:WatchDevice? = nil +appleWatch = WatchDevice(pairediPhone: "링고스타의 아이폰", appInstalled: true) + +if let watch = appleWatch { + if let phoneName = watch.pairediPhone { + print("AppleWhatch가 \(phoneName)과 쌍을 이룹니다.") + } +} + + +typealias Time = (minute:Int, second:Int) + +let lunch = (16, 37) +let walk = (18, 48) + +// 함수의 인자와 리턴 타입을 명시해주세요 +func addTime (time1:Time, time2:Time) -> Time { + let secondSum = time1.second + time2.second + let second = secondSum % 60 + let minute = time1.minute + time2.minute + (secondSum / 60) + + // minute과 second를 이용해서 적절한 값을 리턴해주세요 + return Time(minute, second) +} + +//atNoon의 값은 (35, 25) 이어야 합니다. +let atNoon = addTime(time1:lunch, time2:walk) +print(atNoon) + + +//------------- +//: Method +class Car { + var drivingLog:[Driving] = [] + var mileage:Int = 0 + + // 매개변수로 Driving 인스턴스를 받으세요 + func addLog(driving:Driving) { + // 인자를 drivingLog 배열에 추가하세요 + self.drivingLog += [driving] + // mileage에 운행거리를 더하세요 + self.mileage += driving.distance + } +} + +struct Driving { + let car:Car + let distance:Int //운행 거리 + + func arrived() { + car.addLog(driving:self) + } +} + +let truck = Car() +let deliver = Driving(car: truck, distance:30) +deliver.arrived() + +print(truck.drivingLog) +print(truck.mileage) + + +//------------- +//: Enum Associated Value +indirect enum Fuel { + case Gasoline + case Diesel + case LPG + case Electic(hybrid:Fuel?) +} + +let mini01Fuel = Fuel.Diesel +let mini02Fuel = Fuel.Gasoline +let sedan01Fuel = Fuel.Electic(hybrid:nil) + + print("mini01은 연료로 \(mini01Fuel)을 씁니다.") + print("mini02는 연료로 \(mini02Fuel)을 씁니다.") + print("sedan01은 연료로 \(sedan01Fuel)을 씁니다.") diff --git a/SwiftCodeByEunjiKim/Session2_practice.playground/contents.xcplayground b/SwiftCodeByEunjiKim/Session2_practice.playground/contents.xcplayground new file mode 100644 index 0000000..5da2641 --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_practice.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SwiftCodeByEunjiKim/Session2_practice.playground/playground.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/Session2_practice.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SwiftCodeByEunjiKim/Session2_practice.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail.xcodeproj/project.pbxproj b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a8466e6 --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail.xcodeproj/project.pbxproj @@ -0,0 +1,561 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + EDA095101F94D82C00ACEC56 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA0950F1F94D82C00ACEC56 /* AppDelegate.swift */; }; + EDA095121F94D82C00ACEC56 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA095111F94D82C00ACEC56 /* MasterViewController.swift */; }; + EDA095141F94D82C00ACEC56 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA095131F94D82C00ACEC56 /* DetailViewController.swift */; }; + EDA095171F94D82C00ACEC56 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDA095151F94D82C00ACEC56 /* Main.storyboard */; }; + EDA095191F94D82C00ACEC56 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EDA095181F94D82C00ACEC56 /* Assets.xcassets */; }; + EDA0951C1F94D82C00ACEC56 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDA0951A1F94D82C00ACEC56 /* LaunchScreen.storyboard */; }; + EDA095271F94D82C00ACEC56 /* TestMasterDetailTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA095261F94D82C00ACEC56 /* TestMasterDetailTests.swift */; }; + EDA095321F94D82C00ACEC56 /* TestMasterDetailUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA095311F94D82C00ACEC56 /* TestMasterDetailUITests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + EDA095231F94D82C00ACEC56 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EDA095041F94D82C00ACEC56 /* Project object */; + proxyType = 1; + remoteGlobalIDString = EDA0950B1F94D82C00ACEC56; + remoteInfo = TestMasterDetail; + }; + EDA0952E1F94D82C00ACEC56 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EDA095041F94D82C00ACEC56 /* Project object */; + proxyType = 1; + remoteGlobalIDString = EDA0950B1F94D82C00ACEC56; + remoteInfo = TestMasterDetail; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + EDA0950C1F94D82C00ACEC56 /* TestMasterDetail.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestMasterDetail.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EDA0950F1F94D82C00ACEC56 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + EDA095111F94D82C00ACEC56 /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; + EDA095131F94D82C00ACEC56 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; + EDA095161F94D82C00ACEC56 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + EDA095181F94D82C00ACEC56 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + EDA0951B1F94D82C00ACEC56 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + EDA0951D1F94D82C00ACEC56 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EDA095221F94D82C00ACEC56 /* TestMasterDetailTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestMasterDetailTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EDA095261F94D82C00ACEC56 /* TestMasterDetailTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestMasterDetailTests.swift; sourceTree = ""; }; + EDA095281F94D82C00ACEC56 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EDA0952D1F94D82C00ACEC56 /* TestMasterDetailUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestMasterDetailUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EDA095311F94D82C00ACEC56 /* TestMasterDetailUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestMasterDetailUITests.swift; sourceTree = ""; }; + EDA095331F94D82C00ACEC56 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EDA095091F94D82C00ACEC56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA0951F1F94D82C00ACEC56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA0952A1F94D82C00ACEC56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + EDA095031F94D82C00ACEC56 = { + isa = PBXGroup; + children = ( + EDA0950E1F94D82C00ACEC56 /* TestMasterDetail */, + EDA095251F94D82C00ACEC56 /* TestMasterDetailTests */, + EDA095301F94D82C00ACEC56 /* TestMasterDetailUITests */, + EDA0950D1F94D82C00ACEC56 /* Products */, + ); + sourceTree = ""; + }; + EDA0950D1F94D82C00ACEC56 /* Products */ = { + isa = PBXGroup; + children = ( + EDA0950C1F94D82C00ACEC56 /* TestMasterDetail.app */, + EDA095221F94D82C00ACEC56 /* TestMasterDetailTests.xctest */, + EDA0952D1F94D82C00ACEC56 /* TestMasterDetailUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + EDA0950E1F94D82C00ACEC56 /* TestMasterDetail */ = { + isa = PBXGroup; + children = ( + EDA0950F1F94D82C00ACEC56 /* AppDelegate.swift */, + EDA095111F94D82C00ACEC56 /* MasterViewController.swift */, + EDA095131F94D82C00ACEC56 /* DetailViewController.swift */, + EDA095151F94D82C00ACEC56 /* Main.storyboard */, + EDA095181F94D82C00ACEC56 /* Assets.xcassets */, + EDA0951A1F94D82C00ACEC56 /* LaunchScreen.storyboard */, + EDA0951D1F94D82C00ACEC56 /* Info.plist */, + ); + path = TestMasterDetail; + sourceTree = ""; + }; + EDA095251F94D82C00ACEC56 /* TestMasterDetailTests */ = { + isa = PBXGroup; + children = ( + EDA095261F94D82C00ACEC56 /* TestMasterDetailTests.swift */, + EDA095281F94D82C00ACEC56 /* Info.plist */, + ); + path = TestMasterDetailTests; + sourceTree = ""; + }; + EDA095301F94D82C00ACEC56 /* TestMasterDetailUITests */ = { + isa = PBXGroup; + children = ( + EDA095311F94D82C00ACEC56 /* TestMasterDetailUITests.swift */, + EDA095331F94D82C00ACEC56 /* Info.plist */, + ); + path = TestMasterDetailUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EDA0950B1F94D82C00ACEC56 /* TestMasterDetail */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDA095361F94D82C00ACEC56 /* Build configuration list for PBXNativeTarget "TestMasterDetail" */; + buildPhases = ( + EDA095081F94D82C00ACEC56 /* Sources */, + EDA095091F94D82C00ACEC56 /* Frameworks */, + EDA0950A1F94D82C00ACEC56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestMasterDetail; + productName = TestMasterDetail; + productReference = EDA0950C1F94D82C00ACEC56 /* TestMasterDetail.app */; + productType = "com.apple.product-type.application"; + }; + EDA095211F94D82C00ACEC56 /* TestMasterDetailTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDA095391F94D82C00ACEC56 /* Build configuration list for PBXNativeTarget "TestMasterDetailTests" */; + buildPhases = ( + EDA0951E1F94D82C00ACEC56 /* Sources */, + EDA0951F1F94D82C00ACEC56 /* Frameworks */, + EDA095201F94D82C00ACEC56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + EDA095241F94D82C00ACEC56 /* PBXTargetDependency */, + ); + name = TestMasterDetailTests; + productName = TestMasterDetailTests; + productReference = EDA095221F94D82C00ACEC56 /* TestMasterDetailTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + EDA0952C1F94D82C00ACEC56 /* TestMasterDetailUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EDA0953C1F94D82C00ACEC56 /* Build configuration list for PBXNativeTarget "TestMasterDetailUITests" */; + buildPhases = ( + EDA095291F94D82C00ACEC56 /* Sources */, + EDA0952A1F94D82C00ACEC56 /* Frameworks */, + EDA0952B1F94D82C00ACEC56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + EDA0952F1F94D82C00ACEC56 /* PBXTargetDependency */, + ); + name = TestMasterDetailUITests; + productName = TestMasterDetailUITests; + productReference = EDA0952D1F94D82C00ACEC56 /* TestMasterDetailUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EDA095041F94D82C00ACEC56 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0900; + LastUpgradeCheck = 0900; + ORGANIZATIONNAME = eunjikim; + TargetAttributes = { + EDA0950B1F94D82C00ACEC56 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + }; + EDA095211F94D82C00ACEC56 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = EDA0950B1F94D82C00ACEC56; + }; + EDA0952C1F94D82C00ACEC56 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + TestTargetID = EDA0950B1F94D82C00ACEC56; + }; + }; + }; + buildConfigurationList = EDA095071F94D82C00ACEC56 /* Build configuration list for PBXProject "TestMasterDetail" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EDA095031F94D82C00ACEC56; + productRefGroup = EDA0950D1F94D82C00ACEC56 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EDA0950B1F94D82C00ACEC56 /* TestMasterDetail */, + EDA095211F94D82C00ACEC56 /* TestMasterDetailTests */, + EDA0952C1F94D82C00ACEC56 /* TestMasterDetailUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EDA0950A1F94D82C00ACEC56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDA0951C1F94D82C00ACEC56 /* LaunchScreen.storyboard in Resources */, + EDA095191F94D82C00ACEC56 /* Assets.xcassets in Resources */, + EDA095171F94D82C00ACEC56 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA095201F94D82C00ACEC56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA0952B1F94D82C00ACEC56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EDA095081F94D82C00ACEC56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDA095141F94D82C00ACEC56 /* DetailViewController.swift in Sources */, + EDA095121F94D82C00ACEC56 /* MasterViewController.swift in Sources */, + EDA095101F94D82C00ACEC56 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA0951E1F94D82C00ACEC56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDA095271F94D82C00ACEC56 /* TestMasterDetailTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EDA095291F94D82C00ACEC56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDA095321F94D82C00ACEC56 /* TestMasterDetailUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + EDA095241F94D82C00ACEC56 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EDA0950B1F94D82C00ACEC56 /* TestMasterDetail */; + targetProxy = EDA095231F94D82C00ACEC56 /* PBXContainerItemProxy */; + }; + EDA0952F1F94D82C00ACEC56 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EDA0950B1F94D82C00ACEC56 /* TestMasterDetail */; + targetProxy = EDA0952E1F94D82C00ACEC56 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + EDA095151F94D82C00ACEC56 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EDA095161F94D82C00ACEC56 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + EDA0951A1F94D82C00ACEC56 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EDA0951B1F94D82C00ACEC56 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EDA095341F94D82C00ACEC56 /* 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.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + EDA095351F94D82C00ACEC56 /* 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.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + EDA095371F94D82C00ACEC56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestMasterDetail/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.TestMasterDetail; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EDA095381F94D82C00ACEC56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestMasterDetail/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.TestMasterDetail; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + EDA0953A1F94D82C00ACEC56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestMasterDetailTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.TestMasterDetailTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestMasterDetail.app/TestMasterDetail"; + }; + name = Debug; + }; + EDA0953B1F94D82C00ACEC56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestMasterDetailTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.TestMasterDetailTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestMasterDetail.app/TestMasterDetail"; + }; + name = Release; + }; + EDA0953D1F94D82C00ACEC56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestMasterDetailUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.TestMasterDetailUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = TestMasterDetail; + }; + name = Debug; + }; + EDA0953E1F94D82C00ACEC56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestMasterDetailUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.TestMasterDetailUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = TestMasterDetail; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EDA095071F94D82C00ACEC56 /* Build configuration list for PBXProject "TestMasterDetail" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA095341F94D82C00ACEC56 /* Debug */, + EDA095351F94D82C00ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDA095361F94D82C00ACEC56 /* Build configuration list for PBXNativeTarget "TestMasterDetail" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA095371F94D82C00ACEC56 /* Debug */, + EDA095381F94D82C00ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDA095391F94D82C00ACEC56 /* Build configuration list for PBXNativeTarget "TestMasterDetailTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA0953A1F94D82C00ACEC56 /* Debug */, + EDA0953B1F94D82C00ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EDA0953C1F94D82C00ACEC56 /* Build configuration list for PBXNativeTarget "TestMasterDetailUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EDA0953D1F94D82C00ACEC56 /* Debug */, + EDA0953E1F94D82C00ACEC56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EDA095041F94D82C00ACEC56 /* Project object */; +} diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..4c7037c --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/AppDelegate.swift b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/AppDelegate.swift new file mode 100644 index 0000000..07f8143 --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/AppDelegate.swift @@ -0,0 +1,61 @@ +// +// AppDelegate.swift +// TestMasterDetail +// +// Created by eunjikim on 2017. 10. 16.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + let splitViewController = window!.rootViewController as! UISplitViewController + let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController + navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem + splitViewController.delegate = self + 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:. + } + + // MARK: - Split view + + func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool { + guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false } + guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false } + if topAsDetailController.detailItem == nil { + // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. + return true + } + return false + } + +} + diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Assets.xcassets/AppIcon.appiconset/Contents.json b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/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/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Base.lproj/LaunchScreen.storyboard b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Base.lproj/Main.storyboard b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Base.lproj/Main.storyboard new file mode 100644 index 0000000..d784065 --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Base.lproj/Main.storyboard @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/DetailViewController.swift b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/DetailViewController.swift new file mode 100644 index 0000000..5eeefa0 --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/DetailViewController.swift @@ -0,0 +1,45 @@ +// +// DetailViewController.swift +// TestMasterDetail +// +// Created by eunjikim on 2017. 10. 16.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class DetailViewController: UIViewController { + + @IBOutlet weak var detailDescriptionLabel: UILabel! + + + func configureView() { + // Update the user interface for the detail item. + if let detail = detailItem { + if let label = detailDescriptionLabel { + label.text = detail.description + } + } + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + configureView() + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + var detailItem: NSDate? { + didSet { + // Update the view. + configureView() + } + } + + +} + diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Info.plist b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Info.plist new file mode 100644 index 0000000..6873106 --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/Info.plist @@ -0,0 +1,55 @@ + + + + + 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 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/MasterViewController.swift b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/MasterViewController.swift new file mode 100644 index 0000000..2f52d1b --- /dev/null +++ b/SwiftCodeByEunjiKim/TestMasterDetail/TestMasterDetail/MasterViewController.swift @@ -0,0 +1,95 @@ +// +// MasterViewController.swift +// TestMasterDetail +// +// Created by eunjikim on 2017. 10. 16.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class MasterViewController: UITableViewController { + + var detailViewController: DetailViewController? = nil + var objects = [Any]() + + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + navigationItem.leftBarButtonItem = editButtonItem + + let addButton = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(insertNewObject(_:))) + navigationItem.rightBarButtonItem = addButton + if let split = splitViewController { + let controllers = split.viewControllers + detailViewController = (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController + } + } + + override func viewWillAppear(_ animated: Bool) { + clearsSelectionOnViewWillAppear = splitViewController!.isCollapsed + super.viewWillAppear(animated) + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @objc + func insertNewObject(_ sender: Any) { + objects.insert(NSDate(), at: 0) + let indexPath = IndexPath(row: 0, section: 0) + tableView.insertRows(at: [indexPath], with: .automatic) + } + + // MARK: - Segues + + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "showDetail" { + if let indexPath = tableView.indexPathForSelectedRow { + let object = objects[indexPath.row] as! NSDate + let controller = (segue.destination as! UINavigationController).topViewController as! DetailViewController + controller.detailItem = object + controller.navigationItem.leftBarButtonItem = splitViewController?.displayModeButtonItem + controller.navigationItem.leftItemsSupplementBackButton = true + } + } + } + + // MARK: - Table View + + override func numberOfSections(in tableView: UITableView) -> Int { + return 10 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 20 + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) + + //let object = objects[indexPath.row] as! NSDate + cell.textLabel!.text = "Hello!" + return cell + } + + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + objects.remove(at: indexPath.row) + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. + } + } + + +} + diff --git a/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest.xcodeproj/project.pbxproj b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest.xcodeproj/project.pbxproj new file mode 100644 index 0000000..88974fc --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest.xcodeproj/project.pbxproj @@ -0,0 +1,325 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + ED374C3F1FB014C600CA50E5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C3E1FB014C600CA50E5 /* AppDelegate.swift */; }; + ED374C411FB014C600CA50E5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED374C401FB014C600CA50E5 /* ViewController.swift */; }; + ED374C441FB014C600CA50E5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED374C421FB014C600CA50E5 /* Main.storyboard */; }; + ED374C461FB014C600CA50E5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED374C451FB014C600CA50E5 /* Assets.xcassets */; }; + ED374C491FB014C600CA50E5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED374C471FB014C600CA50E5 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + ED374C3B1FB014C600CA50E5 /* ViewControllerTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ViewControllerTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; + ED374C3E1FB014C600CA50E5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + ED374C401FB014C600CA50E5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + ED374C431FB014C600CA50E5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + ED374C451FB014C600CA50E5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + ED374C481FB014C600CA50E5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + ED374C4A1FB014C600CA50E5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + ED374C381FB014C600CA50E5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + ED374C321FB014C600CA50E5 = { + isa = PBXGroup; + children = ( + ED374C3D1FB014C600CA50E5 /* ViewControllerTest */, + ED374C3C1FB014C600CA50E5 /* Products */, + ); + sourceTree = ""; + }; + ED374C3C1FB014C600CA50E5 /* Products */ = { + isa = PBXGroup; + children = ( + ED374C3B1FB014C600CA50E5 /* ViewControllerTest.app */, + ); + name = Products; + sourceTree = ""; + }; + ED374C3D1FB014C600CA50E5 /* ViewControllerTest */ = { + isa = PBXGroup; + children = ( + ED374C3E1FB014C600CA50E5 /* AppDelegate.swift */, + ED374C401FB014C600CA50E5 /* ViewController.swift */, + ED374C421FB014C600CA50E5 /* Main.storyboard */, + ED374C451FB014C600CA50E5 /* Assets.xcassets */, + ED374C471FB014C600CA50E5 /* LaunchScreen.storyboard */, + ED374C4A1FB014C600CA50E5 /* Info.plist */, + ); + path = ViewControllerTest; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + ED374C3A1FB014C600CA50E5 /* ViewControllerTest */ = { + isa = PBXNativeTarget; + buildConfigurationList = ED374C4D1FB014C600CA50E5 /* Build configuration list for PBXNativeTarget "ViewControllerTest" */; + buildPhases = ( + ED374C371FB014C600CA50E5 /* Sources */, + ED374C381FB014C600CA50E5 /* Frameworks */, + ED374C391FB014C600CA50E5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ViewControllerTest; + productName = ViewControllerTest; + productReference = ED374C3B1FB014C600CA50E5 /* ViewControllerTest.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + ED374C331FB014C600CA50E5 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0910; + LastUpgradeCheck = 0910; + ORGANIZATIONNAME = eunjikim; + TargetAttributes = { + ED374C3A1FB014C600CA50E5 = { + CreatedOnToolsVersion = 9.1; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = ED374C361FB014C600CA50E5 /* Build configuration list for PBXProject "ViewControllerTest" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = ED374C321FB014C600CA50E5; + productRefGroup = ED374C3C1FB014C600CA50E5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + ED374C3A1FB014C600CA50E5 /* ViewControllerTest */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + ED374C391FB014C600CA50E5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED374C491FB014C600CA50E5 /* LaunchScreen.storyboard in Resources */, + ED374C461FB014C600CA50E5 /* Assets.xcassets in Resources */, + ED374C441FB014C600CA50E5 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + ED374C371FB014C600CA50E5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ED374C411FB014C600CA50E5 /* ViewController.swift in Sources */, + ED374C3F1FB014C600CA50E5 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + ED374C421FB014C600CA50E5 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ED374C431FB014C600CA50E5 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + ED374C471FB014C600CA50E5 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ED374C481FB014C600CA50E5 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + ED374C4B1FB014C600CA50E5 /* 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.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + ED374C4C1FB014C600CA50E5 /* 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.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + ED374C4E1FB014C600CA50E5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = ViewControllerTest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.ViewControllerTest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + ED374C4F1FB014C600CA50E5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = ViewControllerTest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ISC.ViewControllerTest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + ED374C361FB014C600CA50E5 /* Build configuration list for PBXProject "ViewControllerTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED374C4B1FB014C600CA50E5 /* Debug */, + ED374C4C1FB014C600CA50E5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ED374C4D1FB014C600CA50E5 /* Build configuration list for PBXNativeTarget "ViewControllerTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ED374C4E1FB014C600CA50E5 /* Debug */, + ED374C4F1FB014C600CA50E5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = ED374C331FB014C600CA50E5 /* Project object */; +} diff --git a/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3144bf9 --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/AppDelegate.swift b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/AppDelegate.swift new file mode 100644 index 0000000..4170fe6 --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// ViewControllerTest +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. 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/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Assets.xcassets/AppIcon.appiconset/Contents.json b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/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/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Base.lproj/LaunchScreen.storyboard b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Base.lproj/Main.storyboard b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Base.lproj/Main.storyboard new file mode 100644 index 0000000..fbad6f1 --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Base.lproj/Main.storyboard @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Info.plist b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/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/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/ViewController.swift b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/ViewController.swift new file mode 100644 index 0000000..cf68878 --- /dev/null +++ b/SwiftCodeByEunjiKim/ViewControllerTest/ViewControllerTest/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// ViewControllerTest +// +// Created by eunjikim on 2017. 11. 6.. +// Copyright © 2017년 eunjikim. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git "a/SwiftCodeByEunjiKim/\354\212\244\355\201\254\353\246\260\354\203\267 2017-11-06 \354\230\244\355\233\204 11.50.42.png" "b/SwiftCodeByEunjiKim/\354\212\244\355\201\254\353\246\260\354\203\267 2017-11-06 \354\230\244\355\233\204 11.50.42.png" new file mode 100644 index 0000000..9e4f1da Binary files /dev/null and "b/SwiftCodeByEunjiKim/\354\212\244\355\201\254\353\246\260\354\203\267 2017-11-06 \354\230\244\355\233\204 11.50.42.png" differ