diff --git a/WeekFour/WeekFour.xcodeproj/project.pbxproj b/WeekFour/WeekFour.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2392c71 --- /dev/null +++ b/WeekFour/WeekFour.xcodeproj/project.pbxproj @@ -0,0 +1,382 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 803EDE0E2AFC977A00723E4B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 803EDE0D2AFC977A00723E4B /* AppDelegate.swift */; }; + 803EDE102AFC977A00723E4B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 803EDE0F2AFC977A00723E4B /* SceneDelegate.swift */; }; + 803EDE122AFC977A00723E4B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 803EDE112AFC977A00723E4B /* ViewController.swift */; }; + 803EDE172AFC977B00723E4B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 803EDE162AFC977B00723E4B /* Assets.xcassets */; }; + 803EDE1A2AFC977B00723E4B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 803EDE182AFC977B00723E4B /* LaunchScreen.storyboard */; }; + 804756D82AFC9E4E00A7051E /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 804756D72AFC9E4E00A7051E /* SnapKit */; }; + 804756E02AFCA8D900A7051E /* UserDefaultKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 804756DF2AFCA8D900A7051E /* UserDefaultKey.swift */; }; + 804756E22AFCAA2600A7051E /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 804756E12AFCAA2600A7051E /* SecondViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 803EDE0A2AFC977A00723E4B /* WeekFour.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WeekFour.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 803EDE0D2AFC977A00723E4B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 803EDE0F2AFC977A00723E4B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 803EDE112AFC977A00723E4B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 803EDE162AFC977B00723E4B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 803EDE192AFC977B00723E4B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 803EDE1B2AFC977B00723E4B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 804756DF2AFCA8D900A7051E /* UserDefaultKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultKey.swift; sourceTree = ""; }; + 804756E12AFCAA2600A7051E /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 803EDE072AFC977A00723E4B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 804756D82AFC9E4E00A7051E /* SnapKit in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 803EDE012AFC977A00723E4B = { + isa = PBXGroup; + children = ( + 803EDE0C2AFC977A00723E4B /* WeekFour */, + 803EDE0B2AFC977A00723E4B /* Products */, + ); + sourceTree = ""; + }; + 803EDE0B2AFC977A00723E4B /* Products */ = { + isa = PBXGroup; + children = ( + 803EDE0A2AFC977A00723E4B /* WeekFour.app */, + ); + name = Products; + sourceTree = ""; + }; + 803EDE0C2AFC977A00723E4B /* WeekFour */ = { + isa = PBXGroup; + children = ( + 804756E12AFCAA2600A7051E /* SecondViewController.swift */, + 804756DF2AFCA8D900A7051E /* UserDefaultKey.swift */, + 803EDE0D2AFC977A00723E4B /* AppDelegate.swift */, + 803EDE0F2AFC977A00723E4B /* SceneDelegate.swift */, + 803EDE112AFC977A00723E4B /* ViewController.swift */, + 803EDE162AFC977B00723E4B /* Assets.xcassets */, + 803EDE182AFC977B00723E4B /* LaunchScreen.storyboard */, + 803EDE1B2AFC977B00723E4B /* Info.plist */, + ); + path = WeekFour; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 803EDE092AFC977A00723E4B /* WeekFour */ = { + isa = PBXNativeTarget; + buildConfigurationList = 803EDE1E2AFC977B00723E4B /* Build configuration list for PBXNativeTarget "WeekFour" */; + buildPhases = ( + 803EDE062AFC977A00723E4B /* Sources */, + 803EDE072AFC977A00723E4B /* Frameworks */, + 803EDE082AFC977A00723E4B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WeekFour; + packageProductDependencies = ( + 804756D72AFC9E4E00A7051E /* SnapKit */, + ); + productName = WeekFour; + productReference = 803EDE0A2AFC977A00723E4B /* WeekFour.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 803EDE022AFC977A00723E4B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1420; + LastUpgradeCheck = 1420; + TargetAttributes = { + 803EDE092AFC977A00723E4B = { + CreatedOnToolsVersion = 14.2; + }; + }; + }; + buildConfigurationList = 803EDE052AFC977A00723E4B /* Build configuration list for PBXProject "WeekFour" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 803EDE012AFC977A00723E4B; + packageReferences = ( + 804756D62AFC9E4E00A7051E /* XCRemoteSwiftPackageReference "SnapKit" */, + ); + productRefGroup = 803EDE0B2AFC977A00723E4B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 803EDE092AFC977A00723E4B /* WeekFour */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 803EDE082AFC977A00723E4B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 803EDE1A2AFC977B00723E4B /* LaunchScreen.storyboard in Resources */, + 803EDE172AFC977B00723E4B /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 803EDE062AFC977A00723E4B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 804756E02AFCA8D900A7051E /* UserDefaultKey.swift in Sources */, + 803EDE122AFC977A00723E4B /* ViewController.swift in Sources */, + 803EDE0E2AFC977A00723E4B /* AppDelegate.swift in Sources */, + 804756E22AFCAA2600A7051E /* SecondViewController.swift in Sources */, + 803EDE102AFC977A00723E4B /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 803EDE182AFC977B00723E4B /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 803EDE192AFC977B00723E4B /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 803EDE1C2AFC977B00723E4B /* 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++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + 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 = 16.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 803EDE1D2AFC977B00723E4B /* 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++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + 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 = 16.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 803EDE1F2AFC977B00723E4B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WeekFour/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = soomin.WeekFour; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 803EDE202AFC977B00723E4B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WeekFour/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = soomin.WeekFour; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 803EDE052AFC977A00723E4B /* Build configuration list for PBXProject "WeekFour" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 803EDE1C2AFC977B00723E4B /* Debug */, + 803EDE1D2AFC977B00723E4B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 803EDE1E2AFC977B00723E4B /* Build configuration list for PBXNativeTarget "WeekFour" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 803EDE1F2AFC977B00723E4B /* Debug */, + 803EDE202AFC977B00723E4B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 804756D62AFC9E4E00A7051E /* XCRemoteSwiftPackageReference "SnapKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SnapKit/SnapKit.git"; + requirement = { + branch = develop; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 804756D72AFC9E4E00A7051E /* SnapKit */ = { + isa = XCSwiftPackageProductDependency; + package = 804756D62AFC9E4E00A7051E /* XCRemoteSwiftPackageReference "SnapKit" */; + productName = SnapKit; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 803EDE022AFC977A00723E4B /* Project object */; +} diff --git a/WeekFour/WeekFour.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/WeekFour/WeekFour.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/WeekFour/WeekFour.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/WeekFour/WeekFour.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/WeekFour/WeekFour.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/WeekFour/WeekFour.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/WeekFour/WeekFour.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/WeekFour/WeekFour.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..6ad6148 --- /dev/null +++ b/WeekFour/WeekFour.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "snapkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SnapKit/SnapKit.git", + "state" : { + "branch" : "develop", + "revision" : "4d52cc3768ec5d345827b063dfa59e98a929965d" + } + } + ], + "version" : 2 +} diff --git a/WeekFour/WeekFour/AppDelegate.swift b/WeekFour/WeekFour/AppDelegate.swift new file mode 100644 index 0000000..3ecafd9 --- /dev/null +++ b/WeekFour/WeekFour/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// WeekFour +// +// Created by 김수민 on 2023/11/09. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/WeekFour/WeekFour/Assets.xcassets/AccentColor.colorset/Contents.json b/WeekFour/WeekFour/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/WeekFour/WeekFour/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WeekFour/WeekFour/Assets.xcassets/AppIcon.appiconset/Contents.json b/WeekFour/WeekFour/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/WeekFour/WeekFour/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WeekFour/WeekFour/Assets.xcassets/Contents.json b/WeekFour/WeekFour/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/WeekFour/WeekFour/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WeekFour/WeekFour/Base.lproj/LaunchScreen.storyboard b/WeekFour/WeekFour/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/WeekFour/WeekFour/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WeekFour/WeekFour/Info.plist b/WeekFour/WeekFour/Info.plist new file mode 100644 index 0000000..0eb786d --- /dev/null +++ b/WeekFour/WeekFour/Info.plist @@ -0,0 +1,23 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + + diff --git a/WeekFour/WeekFour/SceneDelegate.swift b/WeekFour/WeekFour/SceneDelegate.swift new file mode 100644 index 0000000..053b9f5 --- /dev/null +++ b/WeekFour/WeekFour/SceneDelegate.swift @@ -0,0 +1,94 @@ +// +// SceneDelegate.swift +// WeekFour +// +// Created by 김수민 on 2023/11/09. +// + + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +// guard let _ = (scene as? UIWindowScene) else { return } + //윈도우 씬을 가져온다. + guard let windowScene = (scene as? UIWindowScene) else {return} + //윈도우의 크기 설정 + window = UIWindow(frame: UIScreen.main.bounds) + +// if let startStatus = status { +// if startStatus == "success" { +// //뷰컨트롤러 인스턴스 가져오기 +// let vc = ViewController() +// //네비게이션 컨트롤러 +// let navVC = UINavigationController(rootViewController: vc) +// //뿌리 뷰컨트롤러 설정 +// window?.rootViewController = navVC +// //설정한 윈도우를 보이게끔 설정 +// window?.makeKeyAndVisible() +// //윈도우 씬 설정 +// window?.windowScene = windowScene +// } else { +// //뷰컨트롤러 인스턴스 가져오기 +// let vc = SecondViewController() +// //네비게이션 컨트롤러 +// let navVC = UINavigationController(rootViewController: vc) +// //뿌리 뷰컨트롤러 설정 +// window?.rootViewController = navVC +// //설정한 윈도우를 보이게끔 설정 +// window?.makeKeyAndVisible() +// //윈도우 씬 설정 +// window?.windowScene = windowScene +// } +// } + //뷰컨트롤러 인스턴스 가져오기 + let vc = ViewController() + //네비게이션 컨트롤러 + let navVC = UINavigationController(rootViewController: vc) + //뿌리 뷰컨트롤러 설정 + window?.rootViewController = navVC + //설정한 윈도우를 보이게끔 설정 + window?.makeKeyAndVisible() + //윈도우 씬 설정 + window?.windowScene = windowScene + } + + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/WeekFour/WeekFour/SecondViewController.swift b/WeekFour/WeekFour/SecondViewController.swift new file mode 100644 index 0000000..ddc9f17 --- /dev/null +++ b/WeekFour/WeekFour/SecondViewController.swift @@ -0,0 +1,29 @@ +// +// SecondViewController.swift +// WeekFour +// +// Created by 김수민 on 2023/11/09. +// + +import UIKit + +class SecondViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + self.view.backgroundColor = .yellow + // Do any additional setup after loading the view. + } + + + /* + // 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.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/WeekFour/WeekFour/UserDefaultKey.swift b/WeekFour/WeekFour/UserDefaultKey.swift new file mode 100644 index 0000000..c15c52c --- /dev/null +++ b/WeekFour/WeekFour/UserDefaultKey.swift @@ -0,0 +1,14 @@ +// +// UserDefaultKey.swift +// WeekFour +// +// Created by 김수민 on 2023/11/09. +// + +import Foundation +enum UserDefaultKey: String { + case isAutoLogin //활성화시 success + case id + case password + +} diff --git a/WeekFour/WeekFour/ViewController.swift b/WeekFour/WeekFour/ViewController.swift new file mode 100644 index 0000000..48adedb --- /dev/null +++ b/WeekFour/WeekFour/ViewController.swift @@ -0,0 +1,162 @@ +// +// ViewController.swift +// WeekFour +// +// Created by 김수민 on 2023/11/09. +// + +import UIKit +import SnapKit +class ViewController: UIViewController { +// private let idTextField: UITextField = UITextField() +// private let passwordTextField: UITextField = UITextField() + let footerLabel: UILabel = { + let label = UILabel() + label.text = "이것은 푸터입니다." + return label + }() + + private let idTextField: UITextField = { + let textField = UITextField() + textField.placeholder = "Enter ID" + return textField + }() + + private let passwordTextField: UITextField = { + let textField = UITextField() + textField.placeholder = "Enter Password" + return textField + }() + var logInButton: UIButton = { + let button = UIButton() + button.backgroundColor = .cyan + button.setTitle("로그인", for: .normal) + // Add any additional configurations for the button + button.addTarget(self, action: #selector(loginButtonTapped), for: .touchUpInside) + return button + }() + + var registerButton: UIButton = { + let button = UIButton() + button.backgroundColor = .cyan + button.setTitle("회원가입", for: .normal) + // Add any additional configurations for the button + button.addTarget(self, action: #selector(registerButtonTapped), for: .touchUpInside) + return button + }() + + var logOutButton: UIButton = { + let button = UIButton() + button.backgroundColor = .cyan + button.setTitle("로그아웃", for: .normal) + // Add any additional configurations for the button + button.addTarget(self, action: #selector(logOutTapped), for: .touchUpInside) + return button + }() + @objc func logOutTapped(){ + UserDefaults.standard.removeObject(forKey: "isAutoLogin") + } + @objc func loginButtonTapped(){ + if (loginSuccessChecking()) { + footerLabel.text = "로그인완료!" + let alertController = autoLoginAlert() + present(alertController, animated: true, completion: nil) + } else {footerLabel.text = "로그인 실패 ㅠㅠ"} + } + func autoLoginAlert() -> UIAlertController{ + let alertController = UIAlertController(title: "자동 로그인 활성화", + message: "자동 로그인을 활성화 하시겠습니까?", + preferredStyle: .alert) + let yesAction = UIAlertAction(title: "예", style: .default, handler: {_ in + UserDefaults.standard.set("success", forKey: "isAutoLogin") + let nextViewController = SecondViewController() + self.navigationController?.pushViewController(nextViewController, animated: true) + }) + let noAction = UIAlertAction(title: "아니요", style: .default, handler: { _ in + UserDefaults.standard.set("fail", forKey: "isAutoLogin") + let nextViewController = SecondViewController() + self.navigationController?.pushViewController(nextViewController, animated: true) + }) + alertController.addAction(yesAction) + alertController.addAction(noAction) + return alertController + } + func loginSuccessChecking() -> Bool { + if (UserDefaults.standard.string(forKey: "id") == idTextField.text && UserDefaults.standard.string(forKey: "password") == passwordTextField.text){ + return true + } else { return false } + } + @objc func registerButtonTapped(){ + // let nextViewController = SecondViewController() + // navigationController?.pushViewController(nextViewController, animated: true) + if let idValue = idTextField.text, let passwordValue = passwordTextField.text{ + UserDefaults.standard.set(idValue, forKey: "id") + UserDefaults.standard.set(passwordValue, forKey: "password") + footerLabel.text = "회원가입 완료!" +// print(UserDefaults.standard.string(forKey: "id")) + } else { + footerLabel.text = "값을 입력해주세요." + } + } + +// var logInButton: UIButton = UIButton() +// var registerButton: UIButton = UIButton() + + + lazy var stackView: UIStackView = { + let stackView = UIStackView(arrangedSubviews: [footerLabel,idTextField, passwordTextField, logInButton, registerButton,logOutButton]) + stackView.axis = .vertical + stackView.alignment = .center + stackView.distribution = .equalSpacing + stackView.spacing = 20 + return stackView + }() + + override func viewDidLoad() { + super.viewDidLoad() + if let userId = UserDefaults.standard.string(forKey:"isAutoLogin"), userId == "success"{ + let nextViewController = SecondViewController() + self.navigationController?.pushViewController(nextViewController, animated: true) + } + // Do any additional setup after loading the view. + configUI() +// self.view.addSubview(idTextField) +// self.view.addSubview(passwordTextField) +// self.view.addSubview(logInButton) +// self.view.addSubview(registerButton) + self.view.addSubview(stackView) + layout() + + } + + func configUI(){ + self.view.backgroundColor = .white + + } + func layout(){ + idTextField.snp.makeConstraints { make in + make.height.equalTo(50) + make.width.equalTo(200) + } + + passwordTextField.snp.makeConstraints { make in + make.height.equalTo(50) + make.width.equalTo(200) + } + + logInButton.snp.makeConstraints { make in + make.height.equalTo(50) + make.width.equalTo(200) + } + + registerButton.snp.makeConstraints { make in + make.height.equalTo(50) + make.width.equalTo(200) + } + + stackView.snp.makeConstraints { make in + make.centerX.centerY.equalToSuperview() + } + } +} +