diff --git a/Instagram/Instagram.xcodeproj/project.pbxproj b/Instagram/Instagram.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b817ee9 --- /dev/null +++ b/Instagram/Instagram.xcodeproj/project.pbxproj @@ -0,0 +1,375 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 84D00AF527FE12CD00AEDEFA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D00AF427FE12CD00AEDEFA /* AppDelegate.swift */; }; + 84D00AF727FE12CD00AEDEFA /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D00AF627FE12CD00AEDEFA /* SceneDelegate.swift */; }; + 84D00AF927FE12CD00AEDEFA /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D00AF827FE12CD00AEDEFA /* ViewController.swift */; }; + 84D00AFC27FE12CD00AEDEFA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84D00AFA27FE12CD00AEDEFA /* Main.storyboard */; }; + 84D00AFE27FE12CE00AEDEFA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84D00AFD27FE12CE00AEDEFA /* Assets.xcassets */; }; + 84D00B0127FE12CE00AEDEFA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84D00AFF27FE12CE00AEDEFA /* LaunchScreen.storyboard */; }; + 84D00B0927FE1A7C00AEDEFA /* AddNameToSignupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D00B0827FE1A7B00AEDEFA /* AddNameToSignupViewController.swift */; }; + 84D00B0B27FE1A9500AEDEFA /* AddPasswordToSignupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D00B0A27FE1A9500AEDEFA /* AddPasswordToSignupViewController.swift */; }; + 84D00B0D27FE1C8400AEDEFA /* SigninViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D00B0C27FE1C8400AEDEFA /* SigninViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 84D00AF127FE12CD00AEDEFA /* Instagram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Instagram.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 84D00AF427FE12CD00AEDEFA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 84D00AF627FE12CD00AEDEFA /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 84D00AF827FE12CD00AEDEFA /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 84D00AFB27FE12CD00AEDEFA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 84D00AFD27FE12CE00AEDEFA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 84D00B0027FE12CE00AEDEFA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 84D00B0227FE12CE00AEDEFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 84D00B0827FE1A7B00AEDEFA /* AddNameToSignupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddNameToSignupViewController.swift; sourceTree = ""; }; + 84D00B0A27FE1A9500AEDEFA /* AddPasswordToSignupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddPasswordToSignupViewController.swift; sourceTree = ""; }; + 84D00B0C27FE1C8400AEDEFA /* SigninViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SigninViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 84D00AEE27FE12CD00AEDEFA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 84D00AE827FE12CD00AEDEFA = { + isa = PBXGroup; + children = ( + 84D00AF327FE12CD00AEDEFA /* Instagram */, + 84D00AF227FE12CD00AEDEFA /* Products */, + ); + sourceTree = ""; + }; + 84D00AF227FE12CD00AEDEFA /* Products */ = { + isa = PBXGroup; + children = ( + 84D00AF127FE12CD00AEDEFA /* Instagram.app */, + ); + name = Products; + sourceTree = ""; + }; + 84D00AF327FE12CD00AEDEFA /* Instagram */ = { + isa = PBXGroup; + children = ( + 84D00AF427FE12CD00AEDEFA /* AppDelegate.swift */, + 84D00AF627FE12CD00AEDEFA /* SceneDelegate.swift */, + 84D00AF827FE12CD00AEDEFA /* ViewController.swift */, + 84D00AFA27FE12CD00AEDEFA /* Main.storyboard */, + 84D00B0827FE1A7B00AEDEFA /* AddNameToSignupViewController.swift */, + 84D00B0C27FE1C8400AEDEFA /* SigninViewController.swift */, + 84D00B0A27FE1A9500AEDEFA /* AddPasswordToSignupViewController.swift */, + 84D00AFD27FE12CE00AEDEFA /* Assets.xcassets */, + 84D00AFF27FE12CE00AEDEFA /* LaunchScreen.storyboard */, + 84D00B0227FE12CE00AEDEFA /* Info.plist */, + ); + path = Instagram; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 84D00AF027FE12CD00AEDEFA /* Instagram */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84D00B0527FE12CE00AEDEFA /* Build configuration list for PBXNativeTarget "Instagram" */; + buildPhases = ( + 84D00AED27FE12CD00AEDEFA /* Sources */, + 84D00AEE27FE12CD00AEDEFA /* Frameworks */, + 84D00AEF27FE12CD00AEDEFA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Instagram; + productName = Instagram; + productReference = 84D00AF127FE12CD00AEDEFA /* Instagram.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 84D00AE927FE12CD00AEDEFA /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1330; + LastUpgradeCheck = 1330; + TargetAttributes = { + 84D00AF027FE12CD00AEDEFA = { + CreatedOnToolsVersion = 13.3; + }; + }; + }; + buildConfigurationList = 84D00AEC27FE12CD00AEDEFA /* Build configuration list for PBXProject "Instagram" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 84D00AE827FE12CD00AEDEFA; + productRefGroup = 84D00AF227FE12CD00AEDEFA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 84D00AF027FE12CD00AEDEFA /* Instagram */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 84D00AEF27FE12CD00AEDEFA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84D00B0127FE12CE00AEDEFA /* LaunchScreen.storyboard in Resources */, + 84D00AFE27FE12CE00AEDEFA /* Assets.xcassets in Resources */, + 84D00AFC27FE12CD00AEDEFA /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 84D00AED27FE12CD00AEDEFA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84D00B0927FE1A7C00AEDEFA /* AddNameToSignupViewController.swift in Sources */, + 84D00AF927FE12CD00AEDEFA /* ViewController.swift in Sources */, + 84D00AF527FE12CD00AEDEFA /* AppDelegate.swift in Sources */, + 84D00AF727FE12CD00AEDEFA /* SceneDelegate.swift in Sources */, + 84D00B0D27FE1C8400AEDEFA /* SigninViewController.swift in Sources */, + 84D00B0B27FE1A9500AEDEFA /* AddPasswordToSignupViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 84D00AFA27FE12CD00AEDEFA /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 84D00AFB27FE12CD00AEDEFA /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 84D00AFF27FE12CE00AEDEFA /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 84D00B0027FE12CE00AEDEFA /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 84D00B0327FE12CE00AEDEFA /* 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++17"; + 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 = 15.4; + 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; + }; + 84D00B0427FE12CE00AEDEFA /* 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++17"; + 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 = 15.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 84D00B0627FE12CE00AEDEFA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 83B9Y749K7; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Instagram/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + 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 = org.sopt.Instagram; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 84D00B0727FE12CE00AEDEFA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 83B9Y749K7; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Instagram/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + 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 = org.sopt.Instagram; + 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 */ + 84D00AEC27FE12CD00AEDEFA /* Build configuration list for PBXProject "Instagram" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84D00B0327FE12CE00AEDEFA /* Debug */, + 84D00B0427FE12CE00AEDEFA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 84D00B0527FE12CE00AEDEFA /* Build configuration list for PBXNativeTarget "Instagram" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84D00B0627FE12CE00AEDEFA /* Debug */, + 84D00B0727FE12CE00AEDEFA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 84D00AE927FE12CD00AEDEFA /* Project object */; +} diff --git a/Instagram/Instagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Instagram/Instagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Instagram/Instagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Instagram/Instagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Instagram/Instagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Instagram/Instagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Instagram/Instagram/AddNameToSignupViewController.swift b/Instagram/Instagram/AddNameToSignupViewController.swift new file mode 100644 index 0000000..e130689 --- /dev/null +++ b/Instagram/Instagram/AddNameToSignupViewController.swift @@ -0,0 +1,56 @@ +// +// AddNameToSignupViewController.swift +// Instagram +// +// Created by 변주현 on 2022/04/07. +// + +import UIKit + +class AddNameToSignupViewController: UIViewController { + + @IBOutlet weak var idTextField: UITextField! + @IBOutlet weak var nextButton: UIButton! + var userName: String? + + override func viewDidLoad() { + super.viewDidLoad() + + setButtonOption() + setTextFieldOption() + addActionToTextField() + } + + private func setButtonOption() { + // 다음 버튼 비활성화 + nextButton.isEnabled = false + } + + private func setTextFieldOption() { + // TextField에 입력하면 Clear 버튼이 나오도록 표시 + idTextField.clearButtonMode = .whileEditing + } + + private func addActionToTextField() { + // TextField에 이벤트 감지 시 함수 실행을 위한 addTarget() 설정 + self.idTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) + } + + @objc func textFieldDidChange(sender: UITextField) { + self.nextButton.isEnabled = sender.hasText + } + + @IBAction func backButtonDidTap(_ sender: Any) { + self.navigationController?.popViewController(animated: true) + } + + @IBAction func nextButtonDidTap(_ sender: Any) { + guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "AddPasswordToSignupViewController") as? AddPasswordToSignupViewController else { return } + + // 회원가입(2) VC로 사용자 이름 전달 + nextVC.userId = idTextField.text + + self.navigationController?.pushViewController(nextVC, animated: true) + } + +} diff --git a/Instagram/Instagram/AddPasswordToSignupViewController.swift b/Instagram/Instagram/AddPasswordToSignupViewController.swift new file mode 100644 index 0000000..a0d1265 --- /dev/null +++ b/Instagram/Instagram/AddPasswordToSignupViewController.swift @@ -0,0 +1,57 @@ +// +// AddPasswordToSignupViewController.swift +// Instagram +// +// Created by 변주현 on 2022/04/07. +// + +import UIKit + +class AddPasswordToSignupViewController: UIViewController { + + @IBOutlet weak var passwordTextField: UITextField! + @IBOutlet weak var nextButton: UIButton! + var userId: String? + + override func viewDidLoad() { + super.viewDidLoad() + + setButtonOption() + setTextFieldOption() + addActionToTextField() + } + + private func setButtonOption() { + // 다음 버튼 비활성화 + nextButton.isEnabled = false + } + + private func setTextFieldOption() { + // TextField에 입력하면 Clear 버튼이 나오도록 표시 + passwordTextField.clearButtonMode = .whileEditing + } + + private func addActionToTextField() { + // TextField에 이벤트 감지 시 함수 실행을 위한 addTarget() 설정 + self.passwordTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) + } + + @objc func textFieldDidChange(sender: UITextField) { + self.nextButton.isEnabled = sender.hasText ? true : false + } + + @IBAction func backButtonDidTap(_ sender: Any) { + self.navigationController?.popViewController(animated: true) + } + + @IBAction func nextButtonDidTap(_ sender: Any) { + guard let signinVC = self.storyboard?.instantiateViewController(withIdentifier: "SigninViewController") as? SigninViewController else { return } + + signinVC.modalPresentationStyle = .fullScreen + // 회원가입(1)에서 받아온 사용자 id를 로그인 완료 VC로 전달 + signinVC.userId = userId + + self.present(signinVC, animated: true, completion: nil) + } + +} diff --git a/Instagram/Instagram/AppDelegate.swift b/Instagram/Instagram/AppDelegate.swift new file mode 100644 index 0000000..17f8bc6 --- /dev/null +++ b/Instagram/Instagram/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// Instagram +// +// Created by 변주현 on 2022/04/07. +// + +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/Instagram/Instagram/Assets.xcassets/AccentColor.colorset/Contents.json b/Instagram/Instagram/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Instagram/Instagram/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram/Instagram/Assets.xcassets/AppIcon.appiconset/Contents.json b/Instagram/Instagram/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/Instagram/Instagram/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram/Instagram/Assets.xcassets/Contents.json b/Instagram/Instagram/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Instagram/Instagram/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Contents.json b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Contents.json new file mode 100644 index 0000000..441b6ac --- /dev/null +++ b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Instagram Black Logo.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Instagram Black Logo@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Instagram Black Logo@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo.png b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo.png new file mode 100644 index 0000000..83f1827 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo.png differ diff --git a/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo@2x.png b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo@2x.png new file mode 100644 index 0000000..c0bcc31 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo@2x.png differ diff --git a/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo@3x.png b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo@3x.png new file mode 100644 index 0000000..7f5d4b2 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/Instagram Black Logo.imageset/Instagram Black Logo@3x.png differ diff --git a/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/Contents.json b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/Contents.json new file mode 100644 index 0000000..9060886 --- /dev/null +++ b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icn_back_24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icn_back_24@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icn_back_24@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24.png b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24.png new file mode 100644 index 0000000..37e9b88 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24.png differ diff --git a/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24@2x.png b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24@2x.png new file mode 100644 index 0000000..7c430a2 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24@2x.png differ diff --git a/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24@3x.png b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24@3x.png new file mode 100644 index 0000000..a099344 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/icn_back_24.imageset/icn_back_24@3x.png differ diff --git a/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/Contents.json b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/Contents.json new file mode 100644 index 0000000..194f919 --- /dev/null +++ b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "password hidden eye icon.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "password hidden eye icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "password hidden eye icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon.png b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon.png new file mode 100644 index 0000000..f8c3509 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon.png differ diff --git a/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon@2x.png b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon@2x.png new file mode 100644 index 0000000..cc6f57a Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon@2x.png differ diff --git a/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon@3x.png b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon@3x.png new file mode 100644 index 0000000..0dc3207 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/password hidden eye icon.imageset/password hidden eye icon@3x.png differ diff --git a/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/Contents.json b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/Contents.json new file mode 100644 index 0000000..6107868 --- /dev/null +++ b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "password shown eye icon.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "password shown eye icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "password shown eye icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon.png b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon.png new file mode 100644 index 0000000..7cf2c81 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon.png differ diff --git a/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon@2x.png b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon@2x.png new file mode 100644 index 0000000..710f305 Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon@2x.png differ diff --git a/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon@3x.png b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon@3x.png new file mode 100644 index 0000000..31829cc Binary files /dev/null and b/Instagram/Instagram/Assets.xcassets/password shown eye icon.imageset/password shown eye icon@3x.png differ diff --git a/Instagram/Instagram/Base.lproj/LaunchScreen.storyboard b/Instagram/Instagram/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/Instagram/Instagram/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Instagram/Instagram/Base.lproj/Main.storyboard b/Instagram/Instagram/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c3e237c --- /dev/null +++ b/Instagram/Instagram/Base.lproj/Main.storyboard @@ -0,0 +1,364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Instagram/Instagram/Info.plist b/Instagram/Instagram/Info.plist new file mode 100644 index 0000000..dd3c9af --- /dev/null +++ b/Instagram/Instagram/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/Instagram/Instagram/SceneDelegate.swift b/Instagram/Instagram/SceneDelegate.swift new file mode 100644 index 0000000..e7771da --- /dev/null +++ b/Instagram/Instagram/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// Instagram +// +// Created by 변주현 on 2022/04/07. +// + +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 } + } + + 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/Instagram/Instagram/SigninViewController.swift b/Instagram/Instagram/SigninViewController.swift new file mode 100644 index 0000000..ebb710b --- /dev/null +++ b/Instagram/Instagram/SigninViewController.swift @@ -0,0 +1,38 @@ +// +// SigninViewController.swift +// Instagram +// +// Created by 변주현 on 2022/04/07. +// + +import UIKit + +class SigninViewController: UIViewController { + + @IBOutlet weak var welcomeLabel: UILabel! + var userId: String? + + override func viewDidLoad() { + super.viewDidLoad() + + setWelcomeLabel() + } + + @IBAction func okButtonDidTap(_ sender: Any) { + let presentingVC = self.presentingViewController! + let navigationController = presentingVC is UINavigationController ? presentingVC as? UINavigationController : presentingVC.navigationController + + self.dismiss(animated: true){ + navigationController?.popToRootViewController(animated: true) + return + } + } + + private func setWelcomeLabel() { + if let userId = userId { + welcomeLabel.text = "\(userId)님 Instagram에 오신 것을 환영합니다" + welcomeLabel.sizeToFit() + } + } + +} diff --git a/Instagram/Instagram/ViewController.swift b/Instagram/Instagram/ViewController.swift new file mode 100644 index 0000000..7adfa9d --- /dev/null +++ b/Instagram/Instagram/ViewController.swift @@ -0,0 +1,90 @@ +// +// ViewController.swift +// Instagram +// +// Created by 변주현 on 2022/04/07. +// + +import UIKit + +class ViewController: UIViewController { + + @IBOutlet weak var idTextField: UITextField! + @IBOutlet weak var passwordTextField: UITextField! + @IBOutlet weak var signinButton: UIButton! + @IBOutlet weak var passwordEyeButton: UIButton! + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + resetTextField() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setButtonOption() + setTextFieldOption() + addActionToTextField() + } + + private func resetTextField() { + idTextField.text?.removeAll() + passwordTextField.text?.removeAll() + } + + private func setButtonOption() { + // 로그인 버튼 비활성화 + signinButton.isEnabled = false + // 눈 아이콘 버튼 default 보안처리가 true이므로 hidden 이미지로 세팅 + passwordEyeButton.setImage(UIImage(named: "password hidden eye icon"), for: .normal) + } + + private func setTextFieldOption() { + // 비밀번호 입력 시 보안처리 + passwordTextField.isSecureTextEntry = true + // TextField에 입력하면 Clear 버튼이 나오도록 표시 + idTextField.clearButtonMode = .whileEditing + // 눈 아이콘을 위해 주석 처리함 + // passwordTextField.clearButtonMode = .whileEditing + } + + private func addActionToTextField() { + // TextField에 이벤트 감지 시 함수 실행을 위한 addTarget() 설정 + self.idTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) + self.passwordTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) + } + + @objc func textFieldDidChange(sender: UITextField) { + self.signinButton.isEnabled = (idTextField.hasText && passwordTextField.hasText) ? true : false + } + + @IBAction func passwordEyeButtonDidTap(_ sender: Any) { + // textField에 대한 처리를 true -> false || false -> true + passwordTextField.isSecureTextEntry.toggle() + // eyeButton isSelected 값 반전 + passwordEyeButton.isSelected.toggle() + // 버튼 선택 유무에 따른 눈 모양 이미지 변경 + let eyeImage = passwordEyeButton.isSelected ? "password shown eye icon" : "password hidden eye icon" + passwordEyeButton.setImage(UIImage(named: eyeImage), for: .normal) + // 선택 시 틴트 컬러를 투명으로 변경해줌 + passwordEyeButton.tintColor = .clear + } + + @IBAction func signinButtonDidTap(_ sender: Any) { + guard let successVC = self.storyboard?.instantiateViewController(withIdentifier: "SigninViewController") as? SigninViewController else { return } + + successVC.modalPresentationStyle = .fullScreen + + // 로그인 완료 VC로 사용자 id 전달 + successVC.userId = idTextField.text + + self.present(successVC, animated: true, completion: nil) + } + + @IBAction func signupButtonDidTap(_ sender: Any) { + guard let signupVC = self.storyboard?.instantiateViewController(withIdentifier: "AddNameToSignupViewController") as? AddNameToSignupViewController else { return } + + self.navigationController?.pushViewController(signupVC, animated: true) + } + +}