From 1c50c7df40243c88192383dccf93d6fe715f93f3 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 12:17:29 +0900 Subject: [PATCH 01/64] =?UTF-8?q?feat:=20=EA=B9=83=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=85=B8=EC=96=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c0d6680c --- /dev/null +++ b/.gitignore @@ -0,0 +1,134 @@ +# Created by https://www.toptal.com/developers/gitignore/api/macos,swift,xcode +# Edit at https://www.toptal.com/developers/gitignore?templates=macos,swift,xcode + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Xcode ### + +## Xcode 8 and earlier + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcodeproj/project.xcworkspace/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.toptal.com/developers/gitignore/api/macos,swift,xcode \ No newline at end of file From 3bca8e46ea21ab8a20ee11eaa2cba656179480ed Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 12:27:04 +0900 Subject: [PATCH 02/64] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios-contact-manager-ui | 1 + 1 file changed, 1 insertion(+) create mode 160000 ios-contact-manager-ui diff --git a/ios-contact-manager-ui b/ios-contact-manager-ui new file mode 160000 index 00000000..f670d793 --- /dev/null +++ b/ios-contact-manager-ui @@ -0,0 +1 @@ +Subproject commit f670d793e982123a4fa28c8215a1282cafd3932b From e542e1ec1ceb10effe1558d5df91bc75fad78e1c Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 12:31:42 +0900 Subject: [PATCH 03/64] =?UTF-8?q?Revert=20"feat:=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20=EC=83=9D=EC=84=B1"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3bca8e46ea21ab8a20ee11eaa2cba656179480ed. --- ios-contact-manager-ui | 1 - 1 file changed, 1 deletion(-) delete mode 160000 ios-contact-manager-ui diff --git a/ios-contact-manager-ui b/ios-contact-manager-ui deleted file mode 160000 index f670d793..00000000 --- a/ios-contact-manager-ui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f670d793e982123a4fa28c8215a1282cafd3932b From 996c90713700924ddb2cbe89954ffe141900f407 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 12:33:50 +0900 Subject: [PATCH 04/64] =?UTF-8?q?fix:=20=EA=B9=83=ED=97=88=EB=B8=8C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 368 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../ios-contact-manager-ui/AppDelegate.swift | 36 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 13 + .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../Base.lproj/Main.storyboard | 24 ++ .../ios-contact-manager-ui/Info.plist | 25 ++ .../SceneDelegate.swift | 52 +++ .../ViewController.swift | 19 + 12 files changed, 594 insertions(+) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/AppDelegate.swift create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/Contents.json create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/LaunchScreen.storyboard create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Info.plist create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/ViewController.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj new file mode 100644 index 00000000..9c0da233 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -0,0 +1,368 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; + 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB942B43BB620083012B /* SceneDelegate.swift */; }; + 08E3AB972B43BB620083012B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* ViewController.swift */; }; + 08E3AB9A2B43BB620083012B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB982B43BB620083012B /* Main.storyboard */; }; + 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9B2B43BB650083012B /* Assets.xcassets */; }; + 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 08E3AB942B43BB620083012B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 08E3AB962B43BB620083012B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 08E3AB992B43BB620083012B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 08E3AB9B2B43BB650083012B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 08E3AB9E2B43BB650083012B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 08E3ABA02B43BB650083012B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 08E3AB8C2B43BB620083012B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08E3AB862B43BB620083012B = { + isa = PBXGroup; + children = ( + 08E3AB912B43BB620083012B /* ios-contact-manager-ui */, + 08E3AB902B43BB620083012B /* Products */, + ); + sourceTree = ""; + }; + 08E3AB902B43BB620083012B /* Products */ = { + isa = PBXGroup; + children = ( + 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */, + ); + name = Products; + sourceTree = ""; + }; + 08E3AB912B43BB620083012B /* ios-contact-manager-ui */ = { + isa = PBXGroup; + children = ( + 08E3AB922B43BB620083012B /* AppDelegate.swift */, + 08E3AB942B43BB620083012B /* SceneDelegate.swift */, + 08E3AB962B43BB620083012B /* ViewController.swift */, + 08E3AB982B43BB620083012B /* Main.storyboard */, + 08E3AB9B2B43BB650083012B /* Assets.xcassets */, + 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */, + 08E3ABA02B43BB650083012B /* Info.plist */, + ); + path = "ios-contact-manager-ui"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 08E3AB8E2B43BB620083012B /* ios-contact-manager-ui */ = { + isa = PBXNativeTarget; + buildConfigurationList = 08E3ABA32B43BB650083012B /* Build configuration list for PBXNativeTarget "ios-contact-manager-ui" */; + buildPhases = ( + 08E3AB8B2B43BB620083012B /* Sources */, + 08E3AB8C2B43BB620083012B /* Frameworks */, + 08E3AB8D2B43BB620083012B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ios-contact-manager-ui"; + productName = "ios-contact-manager-ui"; + productReference = 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08E3AB872B43BB620083012B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1510; + LastUpgradeCheck = 1510; + TargetAttributes = { + 08E3AB8E2B43BB620083012B = { + CreatedOnToolsVersion = 15.1; + }; + }; + }; + buildConfigurationList = 08E3AB8A2B43BB620083012B /* Build configuration list for PBXProject "ios-contact-manager-ui" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 08E3AB862B43BB620083012B; + productRefGroup = 08E3AB902B43BB620083012B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 08E3AB8E2B43BB620083012B /* ios-contact-manager-ui */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 08E3AB8D2B43BB620083012B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */, + 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */, + 08E3AB9A2B43BB620083012B /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 08E3AB8B2B43BB620083012B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, + 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, + 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 08E3AB982B43BB620083012B /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 08E3AB992B43BB620083012B /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 08E3AB9E2B43BB650083012B /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 08E3ABA12B43BB650083012B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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 = 17.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 08E3ABA22B43BB650083012B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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 = 17.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 08E3ABA42B43BB650083012B /* 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 = VGM28F2FH7; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "ios-contact-manager-ui/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 = "JongHyuckJeon.ios-contact-manager-ui"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 08E3ABA52B43BB650083012B /* 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 = VGM28F2FH7; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "ios-contact-manager-ui/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 = "JongHyuckJeon.ios-contact-manager-ui"; + 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 */ + 08E3AB8A2B43BB620083012B /* Build configuration list for PBXProject "ios-contact-manager-ui" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 08E3ABA12B43BB650083012B /* Debug */, + 08E3ABA22B43BB650083012B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 08E3ABA32B43BB650083012B /* Build configuration list for PBXNativeTarget "ios-contact-manager-ui" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 08E3ABA42B43BB650083012B /* Debug */, + 08E3ABA52B43BB650083012B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08E3AB872B43BB620083012B /* Project object */; +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/AppDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/AppDelegate.swift new file mode 100644 index 00000000..8c52fe13 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// ios-contact-manager-ui +// +// Created by ㅣ on 1/2/24. +// + +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/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/AccentColor.colorset/Contents.json b/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..13613e3e --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/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/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/Contents.json b/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/LaunchScreen.storyboard b/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard b/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard new file mode 100644 index 00000000..25a76385 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Info.plist b/ios-contact-manager-ui/ios-contact-manager-ui/Info.plist new file mode 100644 index 00000000..dd3c9afd --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift new file mode 100644 index 00000000..b488509d --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// ios-contact-manager-ui +// +// Created by ㅣ on 1/2/24. +// + +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/ios-contact-manager-ui/ios-contact-manager-ui/ViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController.swift new file mode 100644 index 00000000..65d7c341 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController.swift @@ -0,0 +1,19 @@ +// +// ViewController.swift +// ios-contact-manager-ui +// +// Created by ㅣ on 1/2/24. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + +} + From 49875ed1294d905fd3eda02215fe887afe8df530 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 12:41:10 +0900 Subject: [PATCH 05/64] =?UTF-8?q?feat:=20=20plist=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=8A=A4=ED=86=A0=EB=A6=AC=EB=B3=B4=EB=93=9C=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 2 - .../ios-contact-manager-ui/Info.plist | 2 - .../SceneDelegate.swift | 48 +++---------------- 3 files changed, 6 insertions(+), 46 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 9c0da233..d1a386e6 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -297,7 +297,6 @@ INFOPLIST_FILE = "ios-contact-manager-ui/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 = ( @@ -325,7 +324,6 @@ INFOPLIST_FILE = "ios-contact-manager-ui/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 = ( diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Info.plist b/ios-contact-manager-ui/ios-contact-manager-ui/Info.plist index dd3c9afd..0eb786dc 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Info.plist +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Info.plist @@ -15,8 +15,6 @@ Default Configuration UISceneDelegateClassName $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift index b488509d..5d562c33 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift @@ -1,9 +1,3 @@ -// -// SceneDelegate.swift -// ios-contact-manager-ui -// -// Created by ㅣ on 1/2/24. -// import UIKit @@ -11,42 +5,12 @@ 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). + guard let windowScene = (scene as? UIWindowScene) else { return } + window = UIWindow(windowScene: windowScene) + window?.makeKeyAndVisible() + window?.backgroundColor = .systemBackground + window?.rootViewController = ViewController() + } - - 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. - } - - } - From 2c3aef34b6685ec6ac4d93bd65cc3800d728d547 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 16:01:57 +0900 Subject: [PATCH 06/64] =?UTF-8?q?feat:=20=EB=A9=94=EC=9D=B8=20=EC=8A=A4?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=EB=B3=B4=EB=93=9C=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 62 ++++++++++++++----- .../Base.lproj/Main.storyboard | 24 ------- .../{ => New Group}/AppDelegate.swift | 0 .../{ => ViewController}/ViewController.swift | 0 4 files changed, 45 insertions(+), 41 deletions(-) delete mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard rename ios-contact-manager-ui/ios-contact-manager-ui/{ => New Group}/AppDelegate.swift (100%) rename ios-contact-manager-ui/ios-contact-manager-ui/{ => ViewController}/ViewController.swift (100%) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index d1a386e6..bf2ffb1b 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -7,20 +7,22 @@ objects = { /* Begin PBXBuildFile section */ + 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; + 08D566532B43EB7900E75000 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566522B43EB7900E75000 /* Tag.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB942B43BB620083012B /* SceneDelegate.swift */; }; 08E3AB972B43BB620083012B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* ViewController.swift */; }; - 08E3AB9A2B43BB620083012B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB982B43BB620083012B /* Main.storyboard */; }; 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9B2B43BB650083012B /* Assets.xcassets */; }; 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 08D566522B43EB7900E75000 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = "../New Group/AppDelegate.swift"; sourceTree = ""; }; 08E3AB942B43BB620083012B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 08E3AB962B43BB620083012B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 08E3AB992B43BB620083012B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 08E3AB9B2B43BB650083012B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 08E3AB9E2B43BB650083012B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 08E3ABA02B43BB650083012B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -37,6 +39,40 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 08D5664C2B43E87600E75000 /* App */ = { + isa = PBXGroup; + children = ( + 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */, + 08E3AB942B43BB620083012B /* SceneDelegate.swift */, + 08E3AB922B43BB620083012B /* AppDelegate.swift */, + ); + path = App; + sourceTree = ""; + }; + 08D5664D2B43E89000E75000 /* ViewController */ = { + isa = PBXGroup; + children = ( + 08E3AB962B43BB620083012B /* ViewController.swift */, + ); + path = ViewController; + sourceTree = ""; + }; + 08D5664E2B43E8A200E75000 /* View */ = { + isa = PBXGroup; + children = ( + ); + path = View; + sourceTree = ""; + }; + 08D5664F2B43E8AE00E75000 /* Model */ = { + isa = PBXGroup; + children = ( + 08D566502B43E8E900E75000 /* User.swift */, + 08D566522B43EB7900E75000 /* Tag.swift */, + ); + path = Model; + sourceTree = ""; + }; 08E3AB862B43BB620083012B = { isa = PBXGroup; children = ( @@ -56,12 +92,11 @@ 08E3AB912B43BB620083012B /* ios-contact-manager-ui */ = { isa = PBXGroup; children = ( - 08E3AB922B43BB620083012B /* AppDelegate.swift */, - 08E3AB942B43BB620083012B /* SceneDelegate.swift */, - 08E3AB962B43BB620083012B /* ViewController.swift */, - 08E3AB982B43BB620083012B /* Main.storyboard */, + 08D5664F2B43E8AE00E75000 /* Model */, + 08D5664E2B43E8A200E75000 /* View */, + 08D5664D2B43E89000E75000 /* ViewController */, + 08D5664C2B43E87600E75000 /* App */, 08E3AB9B2B43BB650083012B /* Assets.xcassets */, - 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */, 08E3ABA02B43BB650083012B /* Info.plist */, ); path = "ios-contact-manager-ui"; @@ -127,7 +162,6 @@ files = ( 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */, 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */, - 08E3AB9A2B43BB620083012B /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -138,7 +172,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 08D566512B43E8E900E75000 /* User.swift in Sources */, 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, + 08D566532B43EB7900E75000 /* Tag.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, ); @@ -147,14 +183,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 08E3AB982B43BB620083012B /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 08E3AB992B43BB620083012B /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard b/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard deleted file mode 100644 index 25a76385..00000000 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/AppDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/New Group/AppDelegate.swift similarity index 100% rename from ios-contact-manager-ui/ios-contact-manager-ui/AppDelegate.swift rename to ios-contact-manager-ui/ios-contact-manager-ui/New Group/AppDelegate.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController.swift similarity index 100% rename from ios-contact-manager-ui/ios-contact-manager-ui/ViewController.swift rename to ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController.swift From 45dc8e96d9a06dd2ecb1e0bf9aff27291f37a547 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 16:02:23 +0900 Subject: [PATCH 07/64] =?UTF-8?q?feat:=20User,=20Tag=20=EB=AA=A8=EB=8D=B8?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => App}/Base.lproj/LaunchScreen.storyboard | 0 .../{ => App}/SceneDelegate.swift | 1 - .../ios-contact-manager-ui/Model/Tag.swift | 8 ++++++++ .../ios-contact-manager-ui/Model/User.swift | 10 ++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) rename ios-contact-manager-ui/ios-contact-manager-ui/{ => App}/Base.lproj/LaunchScreen.storyboard (100%) rename ios-contact-manager-ui/ios-contact-manager-ui/{ => App}/SceneDelegate.swift (98%) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/LaunchScreen.storyboard b/ios-contact-manager-ui/ios-contact-manager-ui/App/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from ios-contact-manager-ui/ios-contact-manager-ui/Base.lproj/LaunchScreen.storyboard rename to ios-contact-manager-ui/ios-contact-manager-ui/App/Base.lproj/LaunchScreen.storyboard diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift similarity index 98% rename from ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift rename to ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift index 5d562c33..c522215f 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/SceneDelegate.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift @@ -11,6 +11,5 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window?.makeKeyAndVisible() window?.backgroundColor = .systemBackground window?.rootViewController = ViewController() - } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift new file mode 100644 index 00000000..baff914d --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift @@ -0,0 +1,8 @@ + +import Foundation + +enum Tag{ + case friend + case family + case coworker +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift new file mode 100644 index 00000000..4057aa3b --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift @@ -0,0 +1,10 @@ + +import Foundation + +struct User { + let userID: UUID + let tag: Tag + let name: String + let phoneNumber: String + let age: Int +} From 1048538cc4b0eb7332e3b9ff10c7d6c89aad0c1c Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 16:45:18 +0900 Subject: [PATCH 08/64] =?UTF-8?q?fix:=20Tag=20=EB=9D=84=EC=96=B4=EC=93=B0?= =?UTF-8?q?=EA=B8=B0=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20User=20=EA=B2=B9?= =?UTF-8?q?=EC=B9=98=EB=8A=94=20=EC=A0=95=EB=B3=B4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift | 2 +- ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift index baff914d..1cef7fcd 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/Tag.swift @@ -1,7 +1,7 @@ import Foundation -enum Tag{ +enum Tag { case friend case family case coworker diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift index 4057aa3b..de119204 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/User.swift @@ -3,7 +3,6 @@ import Foundation struct User { let userID: UUID - let tag: Tag let name: String let phoneNumber: String let age: Int From ddbcec439d1017700556e011add71062e8d43381 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 16:49:38 +0900 Subject: [PATCH 09/64] =?UTF-8?q?feat:=20PhoneBook=20=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 4 +++ .../Model/PhoneBook.swift | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index bf2ffb1b..bc8cb66b 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566532B43EB7900E75000 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566522B43EB7900E75000 /* Tag.swift */; }; + 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB942B43BB620083012B /* SceneDelegate.swift */; }; 08E3AB972B43BB620083012B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* ViewController.swift */; }; @@ -19,6 +20,7 @@ /* Begin PBXFileReference section */ 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566522B43EB7900E75000 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = "../New Group/AppDelegate.swift"; sourceTree = ""; }; 08E3AB942B43BB620083012B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -69,6 +71,7 @@ children = ( 08D566502B43E8E900E75000 /* User.swift */, 08D566522B43EB7900E75000 /* Tag.swift */, + 08D566542B43ED3900E75000 /* PhoneBook.swift */, ); path = Model; sourceTree = ""; @@ -175,6 +178,7 @@ 08D566512B43E8E900E75000 /* User.swift in Sources */, 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, 08D566532B43EB7900E75000 /* Tag.swift in Sources */, + 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, ); diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift new file mode 100644 index 00000000..539ca9da --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift @@ -0,0 +1,26 @@ + +import Foundation + +// MARK: - PhoneBooks Init & Deinit +final class PhoneBook { + + let categorizedPhoneBook: [Tag: User] + + init(categorizedPhoneBook: [Tag: User]) { + self.categorizedPhoneBook = categorizedPhoneBook + } + + deinit { print("PhoneBook has been deinit!!")} +} + +// MARK: - PhoneBook Method +extension PhoneBook { + + func add(user: User) { + + } + + func remove(user: User) { + + } +} From d179ea4bf46d3af5303b8df4856bf5578c51c48b Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 16:55:49 +0900 Subject: [PATCH 10/64] =?UTF-8?q?fix:=20AppDelegate=20=EA=B9=83=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios-contact-manager-ui.xcodeproj/project.pbxproj | 6 +++++- .../{New Group => App}/AppDelegate.swift | 0 2 files changed, 5 insertions(+), 1 deletion(-) rename ios-contact-manager-ui/ios-contact-manager-ui/{New Group => App}/AppDelegate.swift (100%) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index bc8cb66b..0b5c34fe 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566532B43EB7900E75000 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566522B43EB7900E75000 /* Tag.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; + 08D566572B43F8B200E75000 /* TableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566562B43F8B200E75000 /* TableView.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB942B43BB620083012B /* SceneDelegate.swift */; }; 08E3AB972B43BB620083012B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* ViewController.swift */; }; @@ -21,8 +22,9 @@ 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566522B43EB7900E75000 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; + 08D566562B43F8B200E75000 /* TableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableView.swift; sourceTree = ""; }; 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = "../New Group/AppDelegate.swift"; sourceTree = ""; }; + 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 08E3AB942B43BB620083012B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 08E3AB962B43BB620083012B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 08E3AB9B2B43BB650083012B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -62,6 +64,7 @@ 08D5664E2B43E8A200E75000 /* View */ = { isa = PBXGroup; children = ( + 08D566562B43F8B200E75000 /* TableView.swift */, ); path = View; sourceTree = ""; @@ -178,6 +181,7 @@ 08D566512B43E8E900E75000 /* User.swift in Sources */, 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, 08D566532B43EB7900E75000 /* Tag.swift in Sources */, + 08D566572B43F8B200E75000 /* TableView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/New Group/AppDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/AppDelegate.swift similarity index 100% rename from ios-contact-manager-ui/ios-contact-manager-ui/New Group/AppDelegate.swift rename to ios-contact-manager-ui/ios-contact-manager-ui/App/AppDelegate.swift From fb494b034e3ca6b7689774ab7bafb836361003a1 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 2 Jan 2024 16:56:02 +0900 Subject: [PATCH 11/64] =?UTF-8?q?feat:=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EB=B7=B0=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios-contact-manager-ui/View/TableView.swift | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift new file mode 100644 index 00000000..32196ce0 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift @@ -0,0 +1,7 @@ + +import UIKit + + +class TableView: UITableView { + +} From 897300ee34e77780d9c3fa4020dca05c6d839d1f Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Tue, 2 Jan 2024 17:18:21 +0900 Subject: [PATCH 12/64] =?UTF-8?q?feat:=20TableViewCell=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 12 +++- .../View/TableViewCell.swift | 15 +++++ .../View/TableViewCell.xib | 65 +++++++++++++++++++ 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 0b5c34fe..024fa375 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -16,6 +16,8 @@ 08E3AB972B43BB620083012B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* ViewController.swift */; }; 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9B2B43BB650083012B /* Assets.xcassets */; }; 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */; }; + 89566E522B43FAF70085E2CF /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89566E502B43FAF70085E2CF /* TableViewCell.swift */; }; + 89566E532B43FAF70085E2CF /* TableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89566E512B43FAF70085E2CF /* TableViewCell.xib */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -30,6 +32,8 @@ 08E3AB9B2B43BB650083012B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 08E3AB9E2B43BB650083012B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 08E3ABA02B43BB650083012B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 89566E502B43FAF70085E2CF /* TableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = ""; }; + 89566E512B43FAF70085E2CF /* TableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TableViewCell.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -65,6 +69,8 @@ isa = PBXGroup; children = ( 08D566562B43F8B200E75000 /* TableView.swift */, + 89566E502B43FAF70085E2CF /* TableViewCell.swift */, + 89566E512B43FAF70085E2CF /* TableViewCell.xib */, ); path = View; sourceTree = ""; @@ -167,6 +173,7 @@ buildActionMask = 2147483647; files = ( 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */, + 89566E532B43FAF70085E2CF /* TableViewCell.xib in Resources */, 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -179,6 +186,7 @@ buildActionMask = 2147483647; files = ( 08D566512B43E8E900E75000 /* User.swift in Sources */, + 89566E522B43FAF70085E2CF /* TableViewCell.swift in Sources */, 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, 08D566532B43EB7900E75000 /* Tag.swift in Sources */, 08D566572B43F8B200E75000 /* TableView.swift in Sources */, @@ -328,7 +336,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = VGM28F2FH7; + DEVELOPMENT_TEAM = WZFUFHJN8D; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ios-contact-manager-ui/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -355,7 +363,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = VGM28F2FH7; + DEVELOPMENT_TEAM = WZFUFHJN8D; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ios-contact-manager-ui/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift new file mode 100644 index 00000000..90f4a7be --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift @@ -0,0 +1,15 @@ + +import UIKit + +class TableViewCell: UITableViewCell { + @IBOutlet weak var nameLabel: UILabel! + @IBOutlet weak var phoneNumberLabel: UILabel! + + override func awakeFromNib() { + super.awakeFromNib() + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + } +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib new file mode 100644 index 00000000..29ac9a4b --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 31bf480d7a53f8ade01319a92ea6247558c72540 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Wed, 3 Jan 2024 11:28:53 +0900 Subject: [PATCH 13/64] =?UTF-8?q?feat:=20=EC=9D=98=EC=A1=B4=EC=84=B1=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=EB=A5=BC=20=EC=9C=84=ED=95=B4=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=84=88=20=EA=B0=9D=EC=B2=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 4 ++++ .../App/Container.swift | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 024fa375..b8e8c79e 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0851E79D2B44FC7600FDFBF1 /* Container.swift */; }; 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566532B43EB7900E75000 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566522B43EB7900E75000 /* Tag.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; @@ -21,6 +22,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0851E79D2B44FC7600FDFBF1 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = ""; }; 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566522B43EB7900E75000 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; @@ -53,6 +55,7 @@ 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */, 08E3AB942B43BB620083012B /* SceneDelegate.swift */, 08E3AB922B43BB620083012B /* AppDelegate.swift */, + 0851E79D2B44FC7600FDFBF1 /* Container.swift */, ); path = App; sourceTree = ""; @@ -192,6 +195,7 @@ 08D566572B43F8B200E75000 /* TableView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, + 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */, 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift new file mode 100644 index 00000000..6d0b00f7 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift @@ -0,0 +1,24 @@ + +import Foundation + +final class Container { + + static let shared = Container() + + private init() {} + + private var services: [String: Any] = [:] + + func bind(service: Service.Type, resolver: @escaping (Container) -> Service) { + let key = String(describing: Service.self) + self.services[key] = resolver(self) + } + + func resolve(_ type: Service.Type) -> Service { + let key = String(describing: Service.self) + guard let service = services[key] as? Service else { + fatalError("의존성 바인딩되어있지 않음!") + } + return service + } +} From 9cdef0a7737d8235cdc429466d2f7cdc511c5046 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Wed, 3 Jan 2024 11:38:12 +0900 Subject: [PATCH 14/64] =?UTF-8?q?fix:=20fatalError=20=ED=94=84=EB=A6=B0?= =?UTF-8?q?=ED=8A=B8=20=EB=AC=B8=EA=B5=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios-contact-manager-ui/App/Container.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift index 6d0b00f7..3ced0baf 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift @@ -17,7 +17,7 @@ final class Container { func resolve(_ type: Service.Type) -> Service { let key = String(describing: Service.self) guard let service = services[key] as? Service else { - fatalError("의존성 바인딩되어있지 않음!") + fatalError("주입할 객체가 service 딕셔너리에 바인딩되어있지 않음!") } return service } From 3aefa461e03e0b2af255439555039ec1a867c9dc Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 3 Jan 2024 13:52:18 +0900 Subject: [PATCH 15/64] =?UTF-8?q?feat:=20HeaderView=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 8 ++++ .../View/HeaderView.swift | 35 +++++++++++++++ .../View/HeaderView.xib | 43 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index b8e8c79e..bf2a29d9 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -19,6 +19,8 @@ 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */; }; 89566E522B43FAF70085E2CF /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89566E502B43FAF70085E2CF /* TableViewCell.swift */; }; 89566E532B43FAF70085E2CF /* TableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89566E512B43FAF70085E2CF /* TableViewCell.xib */; }; + 89566E552B4516F20085E2CF /* HeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89566E542B4516F20085E2CF /* HeaderView.xib */; }; + 89566E572B4519000085E2CF /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89566E562B4519000085E2CF /* HeaderView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -36,6 +38,8 @@ 08E3ABA02B43BB650083012B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 89566E502B43FAF70085E2CF /* TableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = ""; }; 89566E512B43FAF70085E2CF /* TableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TableViewCell.xib; sourceTree = ""; }; + 89566E542B4516F20085E2CF /* HeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HeaderView.xib; sourceTree = ""; }; + 89566E562B4519000085E2CF /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,6 +76,8 @@ isa = PBXGroup; children = ( 08D566562B43F8B200E75000 /* TableView.swift */, + 89566E542B4516F20085E2CF /* HeaderView.xib */, + 89566E562B4519000085E2CF /* HeaderView.swift */, 89566E502B43FAF70085E2CF /* TableViewCell.swift */, 89566E512B43FAF70085E2CF /* TableViewCell.xib */, ); @@ -178,6 +184,7 @@ 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */, 89566E532B43FAF70085E2CF /* TableViewCell.xib in Resources */, 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */, + 89566E552B4516F20085E2CF /* HeaderView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -193,6 +200,7 @@ 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, 08D566532B43EB7900E75000 /* Tag.swift in Sources */, 08D566572B43F8B200E75000 /* TableView.swift in Sources */, + 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */, diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift new file mode 100644 index 00000000..8f62c8ed --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift @@ -0,0 +1,35 @@ + +import UIKit + +// MARK: - HeaderView init & deinit +class HeaderView: UIView { + + @IBOutlet var contentView: UIView! + + override init(frame: CGRect) { + super.init(frame: frame) + setupHeaderView() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + setupHeaderView() + } +} + +// MARK: - Setup HeaderView +private extension HeaderView { + func setupHeaderView() { + let bundle = Bundle(for: HeaderView.self) + bundle.loadNibNamed("HeaderView", owner: self, options: nil) + addSubview(contentView) + + contentView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + topAnchor.constraint(equalTo: self.topAnchor), + leadingAnchor.constraint(equalTo: self.leadingAnchor), + trailingAnchor.constraint(equalTo: self.trailingAnchor), + bottomAnchor.constraint(equalTo: self.bottomAnchor) + ]) + } +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib new file mode 100644 index 00000000..22289615 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 50c6ac3cbf56077e0ccc5c734cf119835de3a360 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Wed, 3 Jan 2024 13:54:05 +0900 Subject: [PATCH 16/64] =?UTF-8?q?fix:=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=EB=B7=B0=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios-contact-manager-ui.xcodeproj/project.pbxproj | 4 ---- .../ios-contact-manager-ui/View/TableView.swift | 7 ------- .../ios-contact-manager-ui/View/TableViewCell.xib | 4 ++-- 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index bf2a29d9..cd38b451 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566532B43EB7900E75000 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566522B43EB7900E75000 /* Tag.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; - 08D566572B43F8B200E75000 /* TableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566562B43F8B200E75000 /* TableView.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB942B43BB620083012B /* SceneDelegate.swift */; }; 08E3AB972B43BB620083012B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* ViewController.swift */; }; @@ -28,7 +27,6 @@ 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566522B43EB7900E75000 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; - 08D566562B43F8B200E75000 /* TableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableView.swift; sourceTree = ""; }; 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 08E3AB942B43BB620083012B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -75,7 +73,6 @@ 08D5664E2B43E8A200E75000 /* View */ = { isa = PBXGroup; children = ( - 08D566562B43F8B200E75000 /* TableView.swift */, 89566E542B4516F20085E2CF /* HeaderView.xib */, 89566E562B4519000085E2CF /* HeaderView.swift */, 89566E502B43FAF70085E2CF /* TableViewCell.swift */, @@ -199,7 +196,6 @@ 89566E522B43FAF70085E2CF /* TableViewCell.swift in Sources */, 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, 08D566532B43EB7900E75000 /* Tag.swift in Sources */, - 08D566572B43F8B200E75000 /* TableView.swift in Sources */, 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift deleted file mode 100644 index 32196ce0..00000000 --- a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableView.swift +++ /dev/null @@ -1,7 +0,0 @@ - -import UIKit - - -class TableView: UITableView { - -} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib index 29ac9a4b..aef2d30d 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib @@ -1,8 +1,8 @@ - + - + From 25f2f17a5595e73416e83977b5975ce4cba87202 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Wed, 3 Jan 2024 14:36:58 +0900 Subject: [PATCH 17/64] =?UTF-8?q?feat:=20PhoneBookVC=EC=97=90=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=EB=B7=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 8 +-- .../App/SceneDelegate.swift | 2 +- .../View/TableViewCell.swift | 15 +++-- .../View/TableViewCell.xib | 2 +- .../PhoneBookViewController.swift | 66 +++++++++++++++++++ .../ViewController/ViewController.swift | 19 ------ 6 files changed, 81 insertions(+), 31 deletions(-) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift delete mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index cd38b451..26dca6ee 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB942B43BB620083012B /* SceneDelegate.swift */; }; - 08E3AB972B43BB620083012B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* ViewController.swift */; }; + 08E3AB972B43BB620083012B /* PhoneBookViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB962B43BB620083012B /* PhoneBookViewController.swift */; }; 08E3AB9C2B43BB650083012B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9B2B43BB650083012B /* Assets.xcassets */; }; 08E3AB9F2B43BB650083012B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */; }; 89566E522B43FAF70085E2CF /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89566E502B43FAF70085E2CF /* TableViewCell.swift */; }; @@ -30,7 +30,7 @@ 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 08E3AB922B43BB620083012B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 08E3AB942B43BB620083012B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 08E3AB962B43BB620083012B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 08E3AB962B43BB620083012B /* PhoneBookViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBookViewController.swift; sourceTree = ""; }; 08E3AB9B2B43BB650083012B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 08E3AB9E2B43BB650083012B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 08E3ABA02B43BB650083012B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -65,7 +65,7 @@ 08D5664D2B43E89000E75000 /* ViewController */ = { isa = PBXGroup; children = ( - 08E3AB962B43BB620083012B /* ViewController.swift */, + 08E3AB962B43BB620083012B /* PhoneBookViewController.swift */, ); path = ViewController; sourceTree = ""; @@ -194,7 +194,7 @@ files = ( 08D566512B43E8E900E75000 /* User.swift in Sources */, 89566E522B43FAF70085E2CF /* TableViewCell.swift in Sources */, - 08E3AB972B43BB620083012B /* ViewController.swift in Sources */, + 08E3AB972B43BB620083012B /* PhoneBookViewController.swift in Sources */, 08D566532B43EB7900E75000 /* Tag.swift in Sources */, 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift index c522215f..298a3146 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift @@ -10,6 +10,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window = UIWindow(windowScene: windowScene) window?.makeKeyAndVisible() window?.backgroundColor = .systemBackground - window?.rootViewController = ViewController() + window?.rootViewController = PhoneBookViewController() } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift index 90f4a7be..fd124ac5 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.swift @@ -5,11 +5,14 @@ class TableViewCell: UITableViewCell { @IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var phoneNumberLabel: UILabel! - override func awakeFromNib() { - super.awakeFromNib() + static let reuseID = "TableViewCell" + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib index aef2d30d..59b8b48e 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/TableViewCell.xib @@ -9,7 +9,7 @@ - + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift new file mode 100644 index 00000000..48f38811 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -0,0 +1,66 @@ + +import UIKit + +// MARK: - PhoneBookViewController Init & Deinit +final class PhoneBookViewController: UIViewController { + + let tableView = UITableView() + + deinit {print("PhoneBookViewController has been deinit!!")} +} + +// MARK: - LifeCycle +extension PhoneBookViewController { + override func viewDidLoad() { + setupTableView() + setupUI() + } +} + +//MARK: - Setup TableView +private extension PhoneBookViewController { + func setupTableView() { + tableView.delegate = self + tableView.dataSource = self + + view.addSubview(tableView) + tableView.translatesAutoresizingMaskIntoConstraints = false + tableView.register(TableViewCell.self, forCellReuseIdentifier: TableViewCell.reuseID) + tableView.tableFooterView = UIView() + } +} + +//MARK: - SetupUI +private extension PhoneBookViewController { + func setupUI() { + setupConstraints() + } + + func setupConstraints() { + NSLayoutConstraint.activate([ + tableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), + tableView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor), + tableView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor), + tableView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor) + ]) + } +} + + +// MARK: - TableView Delegate +extension PhoneBookViewController: UITableViewDelegate { + //Action +} + +extension PhoneBookViewController: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 //Dummy + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: TableViewCell.reuseID, for: indexPath) as! TableViewCell + return cell + } +} + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController.swift deleted file mode 100644 index 65d7c341..00000000 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ViewController.swift -// ios-contact-manager-ui -// -// Created by ㅣ on 1/2/24. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - -} - From 7c72ea0bd67110aabc00f56462627791eff8e178 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Wed, 3 Jan 2024 14:38:34 +0900 Subject: [PATCH 18/64] =?UTF-8?q?fix:=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=EB=B7=B0=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewController/PhoneBookViewController.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift index 48f38811..91882ed7 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -22,9 +22,6 @@ private extension PhoneBookViewController { func setupTableView() { tableView.delegate = self tableView.dataSource = self - - view.addSubview(tableView) - tableView.translatesAutoresizingMaskIntoConstraints = false tableView.register(TableViewCell.self, forCellReuseIdentifier: TableViewCell.reuseID) tableView.tableFooterView = UIView() } @@ -37,6 +34,8 @@ private extension PhoneBookViewController { } func setupConstraints() { + view.addSubview(tableView) + tableView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ tableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), tableView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor), From 51d12fc7dacdf21e8f64d004e1622664a183fd45 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Wed, 3 Jan 2024 15:26:11 +0900 Subject: [PATCH 19/64] =?UTF-8?q?feat:=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=EB=B7=B0-=ED=97=A4=EB=93=9C=EB=B7=B0=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 2 +- .../ios-contact-manager-ui/View/HeaderView.swift | 13 +++++++++---- .../ios-contact-manager-ui/View/HeaderView.xib | 12 ++++++------ .../ViewController/PhoneBookViewController.swift | 10 ++++++++++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 26dca6ee..4b887ed6 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -75,8 +75,8 @@ children = ( 89566E542B4516F20085E2CF /* HeaderView.xib */, 89566E562B4519000085E2CF /* HeaderView.swift */, - 89566E502B43FAF70085E2CF /* TableViewCell.swift */, 89566E512B43FAF70085E2CF /* TableViewCell.xib */, + 89566E502B43FAF70085E2CF /* TableViewCell.swift */, ); path = View; sourceTree = ""; diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift index 8f62c8ed..a183903e 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.swift @@ -15,6 +15,10 @@ class HeaderView: UIView { super.init(coder: coder) setupHeaderView() } + + override var intrinsicContentSize: CGSize { + return CGSize(width: UIView.noIntrinsicMetric, height: 144) + } } // MARK: - Setup HeaderView @@ -24,12 +28,13 @@ private extension HeaderView { bundle.loadNibNamed("HeaderView", owner: self, options: nil) addSubview(contentView) + contentView.backgroundColor = .lightGray contentView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ - topAnchor.constraint(equalTo: self.topAnchor), - leadingAnchor.constraint(equalTo: self.leadingAnchor), - trailingAnchor.constraint(equalTo: self.trailingAnchor), - bottomAnchor.constraint(equalTo: self.bottomAnchor) + contentView.topAnchor.constraint(equalTo: self.topAnchor), + contentView.leadingAnchor.constraint(equalTo: self.leadingAnchor), + contentView.trailingAnchor.constraint(equalTo: self.trailingAnchor), + contentView.bottomAnchor.constraint(equalTo: self.bottomAnchor) ]) } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib index 22289615..41977dbd 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib @@ -1,8 +1,8 @@ - + - + @@ -10,7 +10,7 @@ - + @@ -18,9 +18,9 @@ - @@ -92,6 +105,27 @@ + + + @@ -110,6 +144,9 @@ + + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 10a0bc31..1ac60914 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -3,6 +3,9 @@ import UIKit // MARK: - init & deinit final class RegisterViewController: UIViewController { + var wrongAgeInput = false + var wrongNameInput = false + var wrongPhoneNumInput = false @IBOutlet weak var nameTextField: UITextField! @IBOutlet weak var ageTextField: UITextField! @@ -11,9 +14,103 @@ final class RegisterViewController: UIViewController { @IBOutlet weak var saveButton: UIBarButtonItem! @IBOutlet weak var cancelButton: UIBarButtonItem! - deinit {print("RegisterViewController has been deinit!!")} - @IBAction func cancelButtonTapped(_ sender: UIBarButtonItem) { + @IBOutlet weak var tempErrorLabel: UILabel! + @IBOutlet weak var tempAgeErrorLabel: UILabel! + @IBOutlet weak var tempPhoneNumberErrorLabel: UILabel! + + + deinit { print("RegisterViewController has been deinit!!") } + + + @IBAction func nameTextFieldChanged(_ sender: UITextField) { + print("이름 입력 변화") + let userInput = nameTextField.text + + let minCount = 2 + let maxCount = 12 + let count = userInput!.count + + switch count { + case 0.. Bool { + let koreanNameRegex = + "^[가-힣ㄱ-ㅎㅏ-ㅣ]" + + return true } } From b776b964edf812cd28d7213d27ec0d9eb4eb1b8a Mon Sep 17 00:00:00 2001 From: suojae3 Date: Fri, 12 Jan 2024 16:47:51 +0900 Subject: [PATCH 40/64] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=8D=BC?= =?UTF-8?q?=ED=8B=B0=20=EB=9E=98=ED=8D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 4 ++++ .../Model/PhoneBook.swift | 1 + .../Model/PropertyWrapper.swift | 17 +++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 8334b687..99447170 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083425122B51260500EE3C40 /* PropertyWrapper.swift */; }; 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0851E79D2B44FC7600FDFBF1 /* Container.swift */; }; 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; @@ -24,6 +25,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 083425122B51260500EE3C40 /* PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyWrapper.swift; sourceTree = ""; }; 0851E79D2B44FC7600FDFBF1 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = ""; }; 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; @@ -90,6 +92,7 @@ children = ( 08D566502B43E8E900E75000 /* User.swift */, 08D566542B43ED3900E75000 /* PhoneBook.swift */, + 083425122B51260500EE3C40 /* PropertyWrapper.swift */, ); path = Model; sourceTree = ""; @@ -198,6 +201,7 @@ files = ( 89D579A42B4E291700FC31A1 /* RegisterViewController.swift in Sources */, 08D566512B43E8E900E75000 /* User.swift in Sources */, + 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */, 89566E522B43FAF70085E2CF /* PhoneBookTableViewCell.swift in Sources */, 08E3AB972B43BB620083012B /* PhoneBookViewController.swift in Sources */, 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift index bf315bed..351d537e 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift @@ -4,6 +4,7 @@ import Foundation // MARK: - PhoneBooks Init & Deinit final class PhoneBook { + @NotifyContactInfoChange var categorizedContactInfo: [User] = [ User(userID: UUID(), name: "전종혁", phoneNumber: "010-1111-2224", age: 20), User(userID: UUID(), name: "강차수", phoneNumber: "010-1111-2224", age: 20), diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift new file mode 100644 index 00000000..c62b8504 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift @@ -0,0 +1,17 @@ + +import Foundation + +@propertyWrapper +struct NotifyContactInfoChange { + + var value: [User] + + var wrappedValue: [User] { + get { value } + set { value = newValue} + } + + init(wrappedValue: [User]) { + self.value = wrappedValue + } +} From 4a9c377da6c81b5221c6f47dd83baeeffb5b6a38 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Sat, 13 Jan 2024 21:53:56 +0900 Subject: [PATCH 41/64] =?UTF-8?q?feat:=20Alert=20=EA=B5=AC=EC=A1=B0?= =?UTF-8?q?=EC=B2=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios-contact-manager-ui.xcodeproj/project.pbxproj | 4 ++++ .../ios-contact-manager-ui/ViewController/Alert.swift | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 99447170..9f2699f1 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083425122B51260500EE3C40 /* PropertyWrapper.swift */; }; 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0851E79D2B44FC7600FDFBF1 /* Container.swift */; }; + 08D333DB2B52BF4A00D64DDB /* Alert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D333DA2B52BF4A00D64DDB /* Alert.swift */; }; 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; @@ -27,6 +28,7 @@ /* Begin PBXFileReference section */ 083425122B51260500EE3C40 /* PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyWrapper.swift; sourceTree = ""; }; 0851E79D2B44FC7600FDFBF1 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = ""; }; + 08D333DA2B52BF4A00D64DDB /* Alert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alert.swift; sourceTree = ""; }; 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -72,6 +74,7 @@ 89D579A12B4E290500FC31A1 /* RegisterViewController.storyboard */, 89D579A32B4E291700FC31A1 /* RegisterViewController.swift */, 08E3AB962B43BB620083012B /* PhoneBookViewController.swift */, + 08D333DA2B52BF4A00D64DDB /* Alert.swift */, ); path = ViewController; sourceTree = ""; @@ -207,6 +210,7 @@ 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, + 08D333DB2B52BF4A00D64DDB /* Alert.swift in Sources */, 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */, 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, ); diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift new file mode 100644 index 00000000..7da9fdeb --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift @@ -0,0 +1,11 @@ + +import UIKit + +struct Alert { + static func create(title: String,with message: String,with confirmTitle: String) -> UIAlertController { + + let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: title, style: .default, handler: nil)) + return alert + } +} From bd7dd2f9d7e909f55505a6212f964f1a235134c1 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Mon, 15 Jan 2024 11:33:25 +0900 Subject: [PATCH 42/64] =?UTF-8?q?refactor:=20RegisterViewController=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterViewController.storyboard | 13 +-- .../RegisterViewController.swift | 110 +++++++++++------- 2 files changed, 76 insertions(+), 47 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard index 390024c2..d86c08ad 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard @@ -46,12 +46,11 @@ - + - - + @@ -68,12 +67,12 @@ - + - + - + @@ -90,7 +89,7 @@ - + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 1ac60914..e92f2577 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -18,53 +18,42 @@ final class RegisterViewController: UIViewController { @IBOutlet weak var tempAgeErrorLabel: UILabel! @IBOutlet weak var tempPhoneNumberErrorLabel: UILabel! - deinit { print("RegisterViewController has been deinit!!") } - - - @IBAction func nameTextFieldChanged(_ sender: UITextField) { - print("이름 입력 변화") - let userInput = nameTextField.text - + + @IBAction private func validateNameTextField(_ sender: UITextField) { + let userInput = nameTextField.text ?? " " let minCount = 2 let maxCount = 12 - let count = userInput!.count - - switch count { - case 0.. Bool { let phoneNumberRegex = "^(02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$|^(010)-?[0-9]{4}-?[0-9]{4}$" @@ -138,3 +125,46 @@ extension RegisterViewController { return true } } + +private extension RegisterViewController { + func validateMinimumNameCondition(input: String, condition: Int) -> Bool { + if input.count >= condition { + return true + } else { + tempErrorLabel.text = "2글자 이상의 이름을 입력해 주세요." + return false + } + } + + func validateMaximumNameCondition(input: String, condition: Int) -> Bool { + if input.count < condition { + return true + } else { + tempErrorLabel.text = "12글자 이하의 이름을 입력해 주세요." + return false + } + } + + func validateMinimumAgeCondition(input: Int, condition: Int) -> Bool { + if input >= condition { + return true + } else { + tempAgeErrorLabel.text = "1~99의 숫자를 입력해 주세요." + return false + } + } + + func validateMaximumAgeCondition(input: Int, condition: Int) -> Bool { + if input < condition { + return true + } else { + tempAgeErrorLabel.text = "1~99의 숫자를 입력해 주세요." + return false + } + } + + func changeTextBorderColor(textField: UITextField, color: CGColor) { + textField.layer.borderColor = color + textField.layer.borderWidth = 2 + } +} From 352c0aedf1bafe05f8b81f8e885416f556089e6f Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Mon, 15 Jan 2024 13:34:55 +0900 Subject: [PATCH 43/64] =?UTF-8?q?fix:=20nameTextField=20=EB=B2=84=EA=B7=B8?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewController/RegisterViewController.storyboard | 3 ++- .../ViewController/RegisterViewController.swift | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard index d86c08ad..471336c6 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard @@ -48,6 +48,7 @@ + @@ -92,7 +93,7 @@ - + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index e92f2577..065d3be6 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -30,7 +30,7 @@ final class RegisterViewController: UIViewController { changeTextBorderColor(textField: nameTextField, color: UIColor.systemBlue.cgColor) wrongNameInput = false } else { - changeTextBorderColor(textField: nameTextField, color: UIColor.systemBlue.cgColor) + changeTextBorderColor(textField: nameTextField, color: UIColor.systemPink.cgColor) wrongNameInput = true } } @@ -115,9 +115,8 @@ extension RegisterViewController { let phoneNumberRegex = "^(02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$|^(010)-?[0-9]{4}-?[0-9]{4}$" let phoneNumberTest = NSPredicate(format: "SELF MATCHES %@", phoneNumberRegex) return phoneNumberTest.evaluate(with: number) - - } + func isValidName(_ name: String) -> Bool { let koreanNameRegex = "^[가-힣ㄱ-ㅎㅏ-ㅣ]" From f3fef8ebf10735f31c2101f716a899097b3295f8 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Mon, 15 Jan 2024 16:02:31 +0900 Subject: [PATCH 44/64] =?UTF-8?q?refactor:=20=EB=A0=88=EC=A7=80=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=EB=B7=B0=EC=BB=A8=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Model/PhoneBook.swift | 27 ++-- .../Model/PropertyWrapper.swift | 7 +- .../ViewController/Alert.swift | 4 +- .../PhoneBookViewController.swift | 8 ++ .../RegisterViewController.storyboard | 28 +--- .../RegisterViewController.swift | 127 ++++++++---------- 6 files changed, 88 insertions(+), 113 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift index 351d537e..45f1ac52 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift @@ -1,9 +1,16 @@ import Foundation + +protocol updatePhoneBookDelegate: AnyObject { + func onUpdate() +} + // MARK: - PhoneBooks Init & Deinit final class PhoneBook { - + + weak var delegate: updatePhoneBookDelegate? + @NotifyContactInfoChange var categorizedContactInfo: [User] = [ User(userID: UUID(), name: "전종혁", phoneNumber: "010-1111-2224", age: 20), @@ -17,18 +24,12 @@ final class PhoneBook { User(userID: UUID(), name: "증철수", phoneNumber: "010-1113-2224", age: 20), User(userID: UUID(), name: "하철수", phoneNumber: "010-1112-2243", age: 3), ] - - deinit { print("PhoneBook has been deinit!!")} -} - -// MARK: - PhoneBook Method -extension PhoneBook { - func add(user: User) { - - } - - func remove(user: User) { - + init() { + _categorizedContactInfo.updateChange = { [weak self] in + self?.delegate?.onUpdate() + } } + deinit { print("PhoneBook has been deinit!!")} } + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift index c62b8504..e0be9323 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift @@ -5,13 +5,18 @@ import Foundation struct NotifyContactInfoChange { var value: [User] + var updateChange: (() -> Void)? var wrappedValue: [User] { get { value } - set { value = newValue} + set { + value = newValue + updateChange?() + } } init(wrappedValue: [User]) { self.value = wrappedValue + updateChange?() } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift index 7da9fdeb..e5aa2532 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift @@ -2,10 +2,10 @@ import UIKit struct Alert { - static func create(title: String,with message: String,with confirmTitle: String) -> UIAlertController { + static func create(title: String, message: String, confirmTitle: String) -> UIAlertController { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: title, style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: confirmTitle, style: .default, handler: nil)) return alert } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift index ab0beacd..cce59d76 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -14,6 +14,7 @@ final class PhoneBookViewController: UIViewController { extension PhoneBookViewController { override func viewDidLoad() { super.viewDidLoad() + phoneBook?.delegate = self setupTableView() setupUI() } @@ -91,3 +92,10 @@ extension PhoneBookViewController { + +// MARK: - Delegate +extension PhoneBookViewController: updatePhoneBookDelegate { + func onUpdate() { + tableView.reloadData() + } +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard index 471336c6..013b5478 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.storyboard @@ -1,8 +1,8 @@ - + - + @@ -105,27 +105,6 @@ - - - @@ -144,9 +123,6 @@ - - - diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 065d3be6..c77f4b2c 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -3,9 +3,6 @@ import UIKit // MARK: - init & deinit final class RegisterViewController: UIViewController { - var wrongAgeInput = false - var wrongNameInput = false - var wrongPhoneNumInput = false @IBOutlet weak var nameTextField: UITextField! @IBOutlet weak var ageTextField: UITextField! @@ -14,88 +11,101 @@ final class RegisterViewController: UIViewController { @IBOutlet weak var saveButton: UIBarButtonItem! @IBOutlet weak var cancelButton: UIBarButtonItem! - @IBOutlet weak var tempErrorLabel: UILabel! - @IBOutlet weak var tempAgeErrorLabel: UILabel! - @IBOutlet weak var tempPhoneNumberErrorLabel: UILabel! + var phoneBook: PhoneBook? + var wrongAgeInput = false + var wrongNameInput = false + var wrongPhoneNumInput = false + deinit { print("RegisterViewController has been deinit!!") } - + @IBAction private func validateNameTextField(_ sender: UITextField) { - let userInput = nameTextField.text ?? " " let minCount = 2 let maxCount = 12 - if validateMaximumNameCondition(input: userInput, condition: maxCount) && - validateMinimumNameCondition(input: userInput, condition: minCount) { - tempErrorLabel.text = "" + + if validateCountCondition(input: sender.text ?? "", condition: (minCount, maxCount)) && isValidName(sender.text ?? "") { changeTextBorderColor(textField: nameTextField, color: UIColor.systemBlue.cgColor) wrongNameInput = false } else { changeTextBorderColor(textField: nameTextField, color: UIColor.systemPink.cgColor) wrongNameInput = true - } + } } - @IBAction private func validateAgeTextField(_ sender: UITextField) { - print("나이 입력 변화") - let userInput = Int(ageTextField.text ?? String()) ?? Int() - print(userInput) + let minAge = 1 let maxAge = 99 - if validateMaximumAgeCondition(input: userInput, condition: maxAge) && - validateMinimumAgeCondition(input: userInput, condition: minAge) { - tempAgeErrorLabel.text = "" + + if validateCountCondition(input: sender.text ?? "", condition: (minAge, maxAge)) { changeTextBorderColor(textField: ageTextField, color: UIColor.systemBlue.cgColor) - wrongAgeInput = false + wrongAgeInput = true } else { changeTextBorderColor(textField: ageTextField, color: UIColor.systemPink.cgColor) - wrongAgeInput = true + wrongAgeInput = false } } @IBAction private func phoneNumberTextFieldChanged(_ sender: UITextField) { print("연락처 입력 변화") - let convertDigit = phoneNumberTextField.text!.replacingOccurrences(of: #"\D"#, with: "", options: .regularExpression) + let convertDigit = sender.text!.replacingOccurrences(of: #"\D"#, with: "", options: .regularExpression) let count = convertDigit.count switch count { case 0: - tempPhoneNumberErrorLabel.text = "휴대폰 번호를 입력해 주세요." phoneNumberTextField.text = convertDigit case 1...3: phoneNumberTextField.text = convertDigit case 4...7: phoneNumberTextField.text = convertDigit.prefix(3) + "-" + convertDigit.suffix(convertDigit.count-3) - tempPhoneNumberErrorLabel.text = "올바르지 않은 휴대폰 번호입니다." + wrongPhoneNumInput = true case 8...11: let startIndex = convertDigit.index(convertDigit.startIndex, offsetBy: 3) let endingIndex = convertDigit.index(convertDigit.startIndex, offsetBy: count-5) let middleNumber = convertDigit[startIndex...endingIndex] phoneNumberTextField.text = convertDigit.prefix(3) + "-" + middleNumber + "-" + convertDigit.suffix(4) - tempPhoneNumberErrorLabel.text = "올바른 휴대폰 번호입니다." wrongPhoneNumInput = false - default: wrongPhoneNumInput = true - tempPhoneNumberErrorLabel.text = "올바르지 않은 휴대폰 번호입니다." - } } @IBAction private func saveButtonTapped(_ sender: UIBarButtonItem) { - if wrongAgeInput == false && - wrongNameInput == false && - wrongPhoneNumInput == false { - print("연락처 저장됨") - dismiss(animated: true) - } else { - print(wrongNameInput,wrongAgeInput,wrongPhoneNumInput) - print("Alert") - } + validateTextField() + print("연락처 저장됨") + phoneBook?.categorizedContactInfo.append(User( + userID: UUID(), + name: nameTextField.text!, + phoneNumber: phoneNumberTextField.text!, + age: Int(ageTextField.text!)!) + ) + dismiss(animated: true) + } + + + private func validateTextField() { +// if !wrongAgeInput { +// let alert = Alert.create(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") +// present(alert, animated: true) +// return +// } +// +// if !wrongNameInput { +// let alert = Alert.create(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") +// present(alert, animated: true) +// return +// } +// +// if !wrongPhoneNumInput { +// let alert = Alert.create(title: "입력에러", message: "번호 입력창을 확인해주세요", confirmTitle: "확인") +// present(alert, animated: true) +// return +// } } + @IBAction private func cancelButtonTapped(_ sender: UIBarButtonItem) { dismiss(animated: true) } @@ -118,52 +128,27 @@ extension RegisterViewController { } func isValidName(_ name: String) -> Bool { - let koreanNameRegex = - "^[가-힣ㄱ-ㅎㅏ-ㅣ]" - + let koreanNameRegex = "^[가-힣ㄱ-ㅎㅏ-ㅣ]" return true } } private extension RegisterViewController { - func validateMinimumNameCondition(input: String, condition: Int) -> Bool { - if input.count >= condition { - return true - } else { - tempErrorLabel.text = "2글자 이상의 이름을 입력해 주세요." - return false - } - } - func validateMaximumNameCondition(input: String, condition: Int) -> Bool { - if input.count < condition { - return true - } else { - tempErrorLabel.text = "12글자 이하의 이름을 입력해 주세요." - return false - } - } - func validateMinimumAgeCondition(input: Int, condition: Int) -> Bool { - if input >= condition { - return true - } else { - tempAgeErrorLabel.text = "1~99의 숫자를 입력해 주세요." - return false - } - } - func validateMaximumAgeCondition(input: Int, condition: Int) -> Bool { - if input < condition { - return true - } else { - tempAgeErrorLabel.text = "1~99의 숫자를 입력해 주세요." - return false - } + func validateCountCondition(input: String, condition: (Int,Int)) -> Bool { + guard input.count >= condition.0 else { print("2글자 이상의 이름을 입력해 주세요."); return false } + guard input.count < condition.1 else { print("1~99의 숫자를 입력해 주세요."); return false } + return true } + + func changeTextBorderColor(textField: UITextField, color: CGColor) { textField.layer.borderColor = color textField.layer.borderWidth = 2 } } + + From 00031c2007844ead49ab653dc0253f00a33e9cb0 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Mon, 15 Jan 2024 17:07:39 +0900 Subject: [PATCH 45/64] =?UTF-8?q?feat:=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EB=8D=B8=EB=A6=AC=EA=B2=8C=EC=9D=B4=ED=8A=B8=20=ED=8C=A8?= =?UTF-8?q?=ED=84=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios-contact-manager-ui/Model/PhoneBook.swift | 3 ++- .../ios-contact-manager-ui/Model/PropertyWrapper.swift | 3 +-- .../ViewController/PhoneBookViewController.swift | 6 ++++-- .../ViewController/RegisterViewController.swift | 10 ++++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift index 45f1ac52..d7c89ee4 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift @@ -1,7 +1,6 @@ import Foundation - protocol updatePhoneBookDelegate: AnyObject { func onUpdate() } @@ -30,6 +29,8 @@ final class PhoneBook { self?.delegate?.onUpdate() } } + deinit { print("PhoneBook has been deinit!!")} } + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift index e0be9323..c50769d4 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PropertyWrapper.swift @@ -10,13 +10,12 @@ struct NotifyContactInfoChange { var wrappedValue: [User] { get { value } set { - value = newValue updateChange?() + value = newValue } } init(wrappedValue: [User]) { self.value = wrappedValue - updateChange?() } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift index cce59d76..9ae56817 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -60,7 +60,6 @@ private extension PhoneBookViewController { } -// MARK: - TableView Delegate // MARK: - TableView Delegate extension PhoneBookViewController: UITableViewDataSource { @@ -86,6 +85,7 @@ extension PhoneBookViewController { let storyboard = UIStoryboard(name: "RegisterViewController", bundle: nil) guard let registerViewController = storyboard.instantiateViewController(identifier: "RegisterViewController") as? RegisterViewController else {return} registerViewController.modalPresentationStyle = .formSheet + registerViewController.phoneBook = phoneBook self.present(registerViewController, animated: true) } } @@ -96,6 +96,8 @@ extension PhoneBookViewController { // MARK: - Delegate extension PhoneBookViewController: updatePhoneBookDelegate { func onUpdate() { - tableView.reloadData() + DispatchQueue.main.async { + self.tableView.reloadData() + } } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index c77f4b2c..0aea37e7 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -77,17 +77,19 @@ final class RegisterViewController: UIViewController { print("연락처 저장됨") phoneBook?.categorizedContactInfo.append(User( userID: UUID(), - name: nameTextField.text!, - phoneNumber: phoneNumberTextField.text!, - age: Int(ageTextField.text!)!) + name: nameTextField.text ?? "테스트", + phoneNumber: phoneNumberTextField.text ?? "01012345678", + age: Int(ageTextField.text ?? "") ?? 10) ) dismiss(animated: true) } private func validateTextField() { + +// let alert = Alert.create(title: "입력에러", message: "\(message) 입력창을 확인해주세요", confirmTitle: "확인") +// // if !wrongAgeInput { -// let alert = Alert.create(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") // present(alert, animated: true) // return // } From 41fd793be08b7b6730bc537d53dc1435deee8a54 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Mon, 15 Jan 2024 17:35:11 +0900 Subject: [PATCH 46/64] =?UTF-8?q?feat:=20Alert=EC=B0=BD=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 8 ++-- .../ViewController/Alert.swift | 11 ----- .../PhoneBookViewController.swift | 1 - .../RegisterViewController.swift | 42 ++++++++----------- .../ViewController+Extension.swift | 18 ++++++++ 5 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController+Extension.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 9f2699f1..0983e529 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -8,8 +8,8 @@ /* Begin PBXBuildFile section */ 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083425122B51260500EE3C40 /* PropertyWrapper.swift */; }; + 083CC5022B55245E00619E89 /* ViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083CC5012B55245D00619E89 /* ViewController+Extension.swift */; }; 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0851E79D2B44FC7600FDFBF1 /* Container.swift */; }; - 08D333DB2B52BF4A00D64DDB /* Alert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D333DA2B52BF4A00D64DDB /* Alert.swift */; }; 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; @@ -27,8 +27,8 @@ /* Begin PBXFileReference section */ 083425122B51260500EE3C40 /* PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyWrapper.swift; sourceTree = ""; }; + 083CC5012B55245D00619E89 /* ViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+Extension.swift"; sourceTree = ""; }; 0851E79D2B44FC7600FDFBF1 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = ""; }; - 08D333DA2B52BF4A00D64DDB /* Alert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alert.swift; sourceTree = ""; }; 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -74,7 +74,7 @@ 89D579A12B4E290500FC31A1 /* RegisterViewController.storyboard */, 89D579A32B4E291700FC31A1 /* RegisterViewController.swift */, 08E3AB962B43BB620083012B /* PhoneBookViewController.swift */, - 08D333DA2B52BF4A00D64DDB /* Alert.swift */, + 083CC5012B55245D00619E89 /* ViewController+Extension.swift */, ); path = ViewController; sourceTree = ""; @@ -210,7 +210,7 @@ 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, - 08D333DB2B52BF4A00D64DDB /* Alert.swift in Sources */, + 083CC5022B55245E00619E89 /* ViewController+Extension.swift in Sources */, 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */, 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, ); diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift deleted file mode 100644 index e5aa2532..00000000 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/Alert.swift +++ /dev/null @@ -1,11 +0,0 @@ - -import UIKit - -struct Alert { - static func create(title: String, message: String, confirmTitle: String) -> UIAlertController { - - let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: confirmTitle, style: .default, handler: nil)) - return alert - } -} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift index 9ae56817..4fd27ef1 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -92,7 +92,6 @@ extension PhoneBookViewController { - // MARK: - Delegate extension PhoneBookViewController: updatePhoneBookDelegate { func onUpdate() { diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 0aea37e7..9f37015c 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -77,9 +77,9 @@ final class RegisterViewController: UIViewController { print("연락처 저장됨") phoneBook?.categorizedContactInfo.append(User( userID: UUID(), - name: nameTextField.text ?? "테스트", - phoneNumber: phoneNumberTextField.text ?? "01012345678", - age: Int(ageTextField.text ?? "") ?? 10) + name: nameTextField.text ?? "", + phoneNumber: phoneNumberTextField.text ?? "", + age: Int(ageTextField.text ?? "") ?? 0) ) dismiss(animated: true) } @@ -87,24 +87,21 @@ final class RegisterViewController: UIViewController { private func validateTextField() { -// let alert = Alert.create(title: "입력에러", message: "\(message) 입력창을 확인해주세요", confirmTitle: "확인") -// -// if !wrongAgeInput { -// present(alert, animated: true) -// return -// } -// -// if !wrongNameInput { -// let alert = Alert.create(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") -// present(alert, animated: true) -// return -// } -// -// if !wrongPhoneNumInput { -// let alert = Alert.create(title: "입력에러", message: "번호 입력창을 확인해주세요", confirmTitle: "확인") -// present(alert, animated: true) -// return -// } + + if !wrongAgeInput { + presentAlert(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") + return + } + + if !wrongNameInput { + presentAlert(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") + return + } + + if !wrongPhoneNumInput { + presentAlert(title: "입력에러", message: "번호 입력창을 확인해주세요", confirmTitle: "확인") + return + } } @@ -146,11 +143,8 @@ private extension RegisterViewController { } - func changeTextBorderColor(textField: UITextField, color: CGColor) { textField.layer.borderColor = color textField.layer.borderWidth = 2 } } - - diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController+Extension.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController+Extension.swift new file mode 100644 index 00000000..126ac344 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/ViewController+Extension.swift @@ -0,0 +1,18 @@ + +import UIKit + +extension UIViewController { + + func presentAlert(title: String, + message: String, + confirmTitle: String, + confirmAction: ((UIAlertAction) -> Void)? = nil, + completion: (() -> Void)? = nil) { + let alertViewController = UIAlertController(title: title, message: message, preferredStyle: .alert) + + let confirmAction = UIAlertAction(title: confirmTitle, style: .default) + alertViewController.addAction(confirmAction) + + self.present(alertViewController, animated: true, completion: completion) + } +} From 100fe3e3358b26da8b6a6e6c204b766abfd28d25 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Mon, 15 Jan 2024 17:43:41 +0900 Subject: [PATCH 47/64] =?UTF-8?q?fix:=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewController/RegisterViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 9f37015c..298d64ed 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -81,7 +81,6 @@ final class RegisterViewController: UIViewController { phoneNumber: phoneNumberTextField.text ?? "", age: Int(ageTextField.text ?? "") ?? 0) ) - dismiss(animated: true) } From 56f81a9ca4a63258ad9141deac8a2dac326aa609 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Mon, 15 Jan 2024 17:50:13 +0900 Subject: [PATCH 48/64] =?UTF-8?q?feat:=20Alert=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewController/RegisterViewController.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 298d64ed..805905b4 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -73,7 +73,8 @@ final class RegisterViewController: UIViewController { } @IBAction private func saveButtonTapped(_ sender: UIBarButtonItem) { - validateTextField() + let validation = validateTextField() + guard validation == true else { return } print("연락처 저장됨") phoneBook?.categorizedContactInfo.append(User( userID: UUID(), @@ -81,26 +82,27 @@ final class RegisterViewController: UIViewController { phoneNumber: phoneNumberTextField.text ?? "", age: Int(ageTextField.text ?? "") ?? 0) ) + + self.dismiss(animated: true) } - private func validateTextField() { - - + private func validateTextField() -> Bool { if !wrongAgeInput { presentAlert(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") - return + return false } if !wrongNameInput { presentAlert(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") - return + return false } if !wrongPhoneNumInput { presentAlert(title: "입력에러", message: "번호 입력창을 확인해주세요", confirmTitle: "확인") - return + return false } + return true } From 02cc64f5c5ff96ef0fd4930a8b3c157611c83f16 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Mon, 15 Jan 2024 18:27:58 +0900 Subject: [PATCH 49/64] =?UTF-8?q?fix:=20flag=20=EB=B3=80=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EB=B0=8F=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterViewController.swift | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 805905b4..fe34ab63 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -13,9 +13,9 @@ final class RegisterViewController: UIViewController { var phoneBook: PhoneBook? - var wrongAgeInput = false - var wrongNameInput = false - var wrongPhoneNumInput = false + var isRightAgeInput = false + var isRightNameInput = false + var isRightPhoneNumInput = false deinit { print("RegisterViewController has been deinit!!") } @@ -23,12 +23,12 @@ final class RegisterViewController: UIViewController { let minCount = 2 let maxCount = 12 - if validateCountCondition(input: sender.text ?? "", condition: (minCount, maxCount)) && isValidName(sender.text ?? "") { + if validateCountCondition(input: sender.text ?? "", condition: (minCount, maxCount)){ changeTextBorderColor(textField: nameTextField, color: UIColor.systemBlue.cgColor) - wrongNameInput = false + isRightNameInput = true } else { changeTextBorderColor(textField: nameTextField, color: UIColor.systemPink.cgColor) - wrongNameInput = true + isRightNameInput = false } } @@ -39,10 +39,10 @@ final class RegisterViewController: UIViewController { if validateCountCondition(input: sender.text ?? "", condition: (minAge, maxAge)) { changeTextBorderColor(textField: ageTextField, color: UIColor.systemBlue.cgColor) - wrongAgeInput = true + isRightAgeInput = true } else { changeTextBorderColor(textField: ageTextField, color: UIColor.systemPink.cgColor) - wrongAgeInput = false + isRightAgeInput = false } } @@ -60,21 +60,22 @@ final class RegisterViewController: UIViewController { case 4...7: phoneNumberTextField.text = convertDigit.prefix(3) + "-" + convertDigit.suffix(convertDigit.count-3) - wrongPhoneNumInput = true + isRightPhoneNumInput = true case 8...11: let startIndex = convertDigit.index(convertDigit.startIndex, offsetBy: 3) let endingIndex = convertDigit.index(convertDigit.startIndex, offsetBy: count-5) let middleNumber = convertDigit[startIndex...endingIndex] phoneNumberTextField.text = convertDigit.prefix(3) + "-" + middleNumber + "-" + convertDigit.suffix(4) - wrongPhoneNumInput = false + isRightPhoneNumInput = true default: - wrongPhoneNumInput = true + isRightPhoneNumInput = false } } @IBAction private func saveButtonTapped(_ sender: UIBarButtonItem) { - let validation = validateTextField() - guard validation == true else { return } +// let validation = validateTextField() +// guard validation == true else { return } + validateTextField() print("연락처 저장됨") phoneBook?.categorizedContactInfo.append(User( userID: UUID(), @@ -87,22 +88,22 @@ final class RegisterViewController: UIViewController { } - private func validateTextField() -> Bool { - if !wrongAgeInput { + private func validateTextField() { + if !isRightAgeInput { presentAlert(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") - return false + return } - if !wrongNameInput { + if !isRightNameInput { presentAlert(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") - return false + return } - if !wrongPhoneNumInput { + if !isRightPhoneNumInput { presentAlert(title: "입력에러", message: "번호 입력창을 확인해주세요", confirmTitle: "확인") - return false + return } - return true + return } @@ -127,10 +128,7 @@ extension RegisterViewController { return phoneNumberTest.evaluate(with: number) } - func isValidName(_ name: String) -> Bool { - let koreanNameRegex = "^[가-힣ㄱ-ㅎㅏ-ㅣ]" - return true - } + } private extension RegisterViewController { From 5d0b8b9eb64ca0a9faf2e0d819e28302f5d55ada Mon Sep 17 00:00:00 2001 From: suojae3 Date: Mon, 15 Jan 2024 18:30:24 +0900 Subject: [PATCH 50/64] =?UTF-8?q?fix:=20count=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewController/RegisterViewController.swift | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index fe34ab63..d60f1f33 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -33,11 +33,10 @@ final class RegisterViewController: UIViewController { } @IBAction private func validateAgeTextField(_ sender: UITextField) { + let minCount = 1 + let maxCount = 3 - let minAge = 1 - let maxAge = 99 - - if validateCountCondition(input: sender.text ?? "", condition: (minAge, maxAge)) { + if validateCountCondition(input: sender.text ?? "", condition: (minCount, maxCount)) { changeTextBorderColor(textField: ageTextField, color: UIColor.systemBlue.cgColor) isRightAgeInput = true } else { @@ -73,8 +72,6 @@ final class RegisterViewController: UIViewController { } @IBAction private func saveButtonTapped(_ sender: UIBarButtonItem) { -// let validation = validateTextField() -// guard validation == true else { return } validateTextField() print("연락처 저장됨") phoneBook?.categorizedContactInfo.append(User( @@ -127,14 +124,10 @@ extension RegisterViewController { let phoneNumberTest = NSPredicate(format: "SELF MATCHES %@", phoneNumberRegex) return phoneNumberTest.evaluate(with: number) } - - } private extension RegisterViewController { - - func validateCountCondition(input: String, condition: (Int,Int)) -> Bool { guard input.count >= condition.0 else { print("2글자 이상의 이름을 입력해 주세요."); return false } guard input.count < condition.1 else { print("1~99의 숫자를 입력해 주세요."); return false } From a2096d9676441488d4b9d68dd0171c2769331d19 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 16 Jan 2024 11:32:22 +0900 Subject: [PATCH 51/64] =?UTF-8?q?fix:=20=EC=A0=95=EB=B3=B4=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EC=95=88=ED=95=B4=EB=8F=84=20=EC=A0=84=ED=99=94?= =?UTF-8?q?=EB=B2=88=ED=98=B8=EB=B6=80=20=EC=B6=94=EA=B0=80=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterViewController.swift | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index d60f1f33..2dafe7c8 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -50,19 +50,15 @@ final class RegisterViewController: UIViewController { let convertDigit = sender.text!.replacingOccurrences(of: #"\D"#, with: "", options: .regularExpression) - let count = convertDigit.count - switch count { - case 0: - phoneNumberTextField.text = convertDigit - case 1...3: + switch convertDigit.count { + case 0...3: phoneNumberTextField.text = convertDigit case 4...7: phoneNumberTextField.text = convertDigit.prefix(3) + "-" + convertDigit.suffix(convertDigit.count-3) - isRightPhoneNumInput = true - case 8...11: + case 4...11: let startIndex = convertDigit.index(convertDigit.startIndex, offsetBy: 3) - let endingIndex = convertDigit.index(convertDigit.startIndex, offsetBy: count-5) + let endingIndex = convertDigit.index(convertDigit.startIndex, offsetBy: convertDigit.count-5) let middleNumber = convertDigit[startIndex...endingIndex] phoneNumberTextField.text = convertDigit.prefix(3) + "-" + middleNumber + "-" + convertDigit.suffix(4) isRightPhoneNumInput = true @@ -72,7 +68,7 @@ final class RegisterViewController: UIViewController { } @IBAction private func saveButtonTapped(_ sender: UIBarButtonItem) { - validateTextField() + guard validateTextField() == true else { return } print("연락처 저장됨") phoneBook?.categorizedContactInfo.append(User( userID: UUID(), @@ -80,27 +76,27 @@ final class RegisterViewController: UIViewController { phoneNumber: phoneNumberTextField.text ?? "", age: Int(ageTextField.text ?? "") ?? 0) ) - self.dismiss(animated: true) } - private func validateTextField() { - if !isRightAgeInput { - presentAlert(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") - return - } + private func validateTextField() -> Bool { if !isRightNameInput { presentAlert(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") - return + return false + } + + if !isRightAgeInput { + presentAlert(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") + return false } if !isRightPhoneNumInput { presentAlert(title: "입력에러", message: "번호 입력창을 확인해주세요", confirmTitle: "확인") - return + return false } - return + return true } @@ -127,7 +123,6 @@ extension RegisterViewController { } private extension RegisterViewController { - func validateCountCondition(input: String, condition: (Int,Int)) -> Bool { guard input.count >= condition.0 else { print("2글자 이상의 이름을 입력해 주세요."); return false } guard input.count < condition.1 else { print("1~99의 숫자를 입력해 주세요."); return false } From fa42e0cb934332d236871a59cfab94a989c2b76b Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 16 Jan 2024 11:36:58 +0900 Subject: [PATCH 52/64] =?UTF-8?q?refactor:=20extension=EC=9D=84=20?= =?UTF-8?q?=ED=86=B5=ED=95=B4=20UI=EA=B4=80=EB=A0=A8=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=EC=9D=80=20=EB=94=B0=EB=A1=9C=20=ED=91=9C=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegisterViewController.swift | 53 ++++++++----------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 2dafe7c8..09380ff2 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -17,8 +17,6 @@ final class RegisterViewController: UIViewController { var isRightNameInput = false var isRightPhoneNumInput = false - deinit { print("RegisterViewController has been deinit!!") } - @IBAction private func validateNameTextField(_ sender: UITextField) { let minCount = 2 let maxCount = 12 @@ -56,7 +54,7 @@ final class RegisterViewController: UIViewController { case 4...7: phoneNumberTextField.text = convertDigit.prefix(3) + "-" + convertDigit.suffix(convertDigit.count-3) isRightPhoneNumInput = true - case 4...11: + case 8...11: let startIndex = convertDigit.index(convertDigit.startIndex, offsetBy: 3) let endingIndex = convertDigit.index(convertDigit.startIndex, offsetBy: convertDigit.count-5) let middleNumber = convertDigit[startIndex...endingIndex] @@ -79,19 +77,32 @@ final class RegisterViewController: UIViewController { self.dismiss(animated: true) } + @IBAction private func cancelButtonTapped(_ sender: UIBarButtonItem) { + dismiss(animated: true) + } - private func validateTextField() -> Bool { - + deinit { print("RegisterViewController has been deinit!!") } +} + +// MARK: - LifeCycle +extension RegisterViewController { + override func viewDidLoad() { + super.viewDidLoad() + } +} + +// MARK: - Validate Method +private extension RegisterViewController { + + func validateTextField() -> Bool { if !isRightNameInput { presentAlert(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") return false } - if !isRightAgeInput { presentAlert(title: "입력에러", message: "나이 입력창을 확인해주세요", confirmTitle: "확인") return false } - if !isRightPhoneNumInput { presentAlert(title: "입력에러", message: "번호 입력창을 확인해주세요", confirmTitle: "확인") return false @@ -99,36 +110,16 @@ final class RegisterViewController: UIViewController { return true } - - @IBAction private func cancelButtonTapped(_ sender: UIBarButtonItem) { - dismiss(animated: true) - } -} - -// MARK: - LifeCycle -extension RegisterViewController { - override func viewDidLoad() { - super.viewDidLoad() - - } -} - -// MARK: - Extension -extension RegisterViewController { - func isValidPhoneNumber(_ number: String) -> Bool { - let phoneNumberRegex = "^(02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$|^(010)-?[0-9]{4}-?[0-9]{4}$" - let phoneNumberTest = NSPredicate(format: "SELF MATCHES %@", phoneNumberRegex) - return phoneNumberTest.evaluate(with: number) - } -} - -private extension RegisterViewController { func validateCountCondition(input: String, condition: (Int,Int)) -> Bool { guard input.count >= condition.0 else { print("2글자 이상의 이름을 입력해 주세요."); return false } guard input.count < condition.1 else { print("1~99의 숫자를 입력해 주세요."); return false } return true } +} + +// MARK: - UI 관련 로직 +private extension RegisterViewController { func changeTextBorderColor(textField: UITextField, color: CGColor) { textField.layer.borderColor = color From 202634dea1ff1c0b0d38066bc1bc23e7e192a7e8 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 16 Jan 2024 14:57:04 +0900 Subject: [PATCH 53/64] =?UTF-8?q?feat:=20=EC=BD=94=EB=94=94=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=ED=8C=A8=ED=84=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 8 +++++ .../App/CoorninatorProtocol.swift | 10 ++++++ .../App/MainCoordinator.swift | 28 +++++++++++++++ .../App/SceneDelegate.swift | 35 ++++++++++++++----- .../PhoneBookViewController.swift | 9 +++-- .../RegisterViewController.swift | 9 +++-- 6 files changed, 84 insertions(+), 15 deletions(-) create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift create mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 0983e529..0a9be701 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -10,6 +10,8 @@ 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083425122B51260500EE3C40 /* PropertyWrapper.swift */; }; 083CC5022B55245E00619E89 /* ViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083CC5012B55245D00619E89 /* ViewController+Extension.swift */; }; 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0851E79D2B44FC7600FDFBF1 /* Container.swift */; }; + 086C4A182B56463700D1276E /* CoorninatorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086C4A172B56463700D1276E /* CoorninatorProtocol.swift */; }; + 086C4A1A2B56467C00D1276E /* MainCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086C4A192B56467C00D1276E /* MainCoordinator.swift */; }; 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08E3AB922B43BB620083012B /* AppDelegate.swift */; }; @@ -29,6 +31,8 @@ 083425122B51260500EE3C40 /* PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyWrapper.swift; sourceTree = ""; }; 083CC5012B55245D00619E89 /* ViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+Extension.swift"; sourceTree = ""; }; 0851E79D2B44FC7600FDFBF1 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = ""; }; + 086C4A172B56463700D1276E /* CoorninatorProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoorninatorProtocol.swift; sourceTree = ""; }; + 086C4A192B56467C00D1276E /* MainCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCoordinator.swift; sourceTree = ""; }; 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; 08E3AB8F2B43BB620083012B /* ios-contact-manager-ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-contact-manager-ui.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -64,6 +68,8 @@ 08E3AB942B43BB620083012B /* SceneDelegate.swift */, 0851E79D2B44FC7600FDFBF1 /* Container.swift */, 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */, + 086C4A172B56463700D1276E /* CoorninatorProtocol.swift */, + 086C4A192B56467C00D1276E /* MainCoordinator.swift */, ); path = App; sourceTree = ""; @@ -206,11 +212,13 @@ 08D566512B43E8E900E75000 /* User.swift in Sources */, 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */, 89566E522B43FAF70085E2CF /* PhoneBookTableViewCell.swift in Sources */, + 086C4A182B56463700D1276E /* CoorninatorProtocol.swift in Sources */, 08E3AB972B43BB620083012B /* PhoneBookViewController.swift in Sources */, 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, 08E3AB932B43BB620083012B /* AppDelegate.swift in Sources */, 083CC5022B55245E00619E89 /* ViewController+Extension.swift in Sources */, + 086C4A1A2B56467C00D1276E /* MainCoordinator.swift in Sources */, 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */, 08E3AB952B43BB620083012B /* SceneDelegate.swift in Sources */, ); diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift new file mode 100644 index 00000000..a7ae2f64 --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift @@ -0,0 +1,10 @@ + +import UIKit + +protocol Coorninator { + var childCoordninators: [Coorninator] { get set } + var navigationController: UINavigationController { get set } + + func start() + func goToRegisterViewController() +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift new file mode 100644 index 00000000..48ff157d --- /dev/null +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift @@ -0,0 +1,28 @@ + +import UIKit + +class MainCoordinator: Coorninator { + + + var childCoordninators = [Coorninator]() + var navigationController: UINavigationController + + let phoneBookViewController = Container.shared.resolve(PhoneBookViewController.self) + let registerViewController = Container.shared.resolve(RegisterViewController.self) + + init(navigationController: UINavigationController) { + self.navigationController = navigationController + } + + func start() { + phoneBookViewController.coordinator = self + navigationController.pushViewController(phoneBookViewController, animated: false) + } + + func goToRegisterViewController() { + registerViewController.coordinator = self + registerViewController.modalPresentationStyle = .formSheet + phoneBookViewController.present(registerViewController, animated: true) + + } +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift index 94631e41..d4b4e094 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift @@ -4,10 +4,29 @@ import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? - + var mainCoordniator: MainCoordinator? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } + setDependence() + + let navigationController = UINavigationController() + mainCoordniator = MainCoordinator(navigationController: navigationController) + + mainCoordniator?.start() + + window = UIWindow(windowScene: windowScene) + window?.makeKeyAndVisible() + window?.rootViewController = navigationController + window?.backgroundColor = .white + } +} + + +extension SceneDelegate { + func setDependence() { Container.shared.bind(service: PhoneBook.self) { _ in return PhoneBook() } @@ -19,12 +38,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { return phoneBookViewController } - let phoneBookViewController = Container.shared.resolve(PhoneBookViewController.self) - let navigationViewController = UINavigationController(rootViewController: phoneBookViewController) - - window = UIWindow(windowScene: windowScene) - window?.makeKeyAndVisible() - window?.rootViewController = navigationViewController - window?.backgroundColor = .white + Container.shared.bind(service: RegisterViewController.self) { resolver in + let phoneBook = resolver.resolve(PhoneBook.self) + let storyboard = UIStoryboard(name: "RegisterViewController", bundle: nil) + let registerViewController = storyboard.instantiateViewController(identifier: "RegisterViewController") as! RegisterViewController + registerViewController.phoneBook = phoneBook + return registerViewController + } } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift index 4fd27ef1..8391040d 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -6,6 +6,7 @@ final class PhoneBookViewController: UIViewController { let tableView = UITableView() var phoneBook: PhoneBook? = nil + weak var coordinator: MainCoordinator? deinit {print("PhoneBookViewController has been deinit!!")} } @@ -82,11 +83,9 @@ extension PhoneBookViewController: UITableViewDataSource { // MARK: - View Transition extension PhoneBookViewController { @objc func addButtonTapped() { - let storyboard = UIStoryboard(name: "RegisterViewController", bundle: nil) - guard let registerViewController = storyboard.instantiateViewController(identifier: "RegisterViewController") as? RegisterViewController else {return} - registerViewController.modalPresentationStyle = .formSheet - registerViewController.phoneBook = phoneBook - self.present(registerViewController, animated: true) + DispatchQueue.main.async { + self.coordinator?.goToRegisterViewController() + } } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 09380ff2..5108c13b 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -12,6 +12,7 @@ final class RegisterViewController: UIViewController { @IBOutlet weak var cancelButton: UIBarButtonItem! var phoneBook: PhoneBook? + weak var coordinator: MainCoordinator? var isRightAgeInput = false var isRightNameInput = false @@ -43,11 +44,12 @@ final class RegisterViewController: UIViewController { } } + // Textfield Delegate @IBAction private func phoneNumberTextFieldChanged(_ sender: UITextField) { print("연락처 입력 변화") - + let convertDigit = sender.text!.replacingOccurrences(of: #"\D"#, with: "", options: .regularExpression) - + switch convertDigit.count { case 0...3: phoneNumberTextField.text = convertDigit @@ -64,6 +66,7 @@ final class RegisterViewController: UIViewController { isRightPhoneNumInput = false } } + @IBAction private func saveButtonTapped(_ sender: UIBarButtonItem) { guard validateTextField() == true else { return } @@ -94,6 +97,7 @@ extension RegisterViewController { // MARK: - Validate Method private extension RegisterViewController { + // Alert func validateTextField() -> Bool { if !isRightNameInput { presentAlert(title: "입력에러", message: "이름 입력창을 확인해주세요", confirmTitle: "확인") @@ -110,6 +114,7 @@ private extension RegisterViewController { return true } + // TextCount func validateCountCondition(input: String, condition: (Int,Int)) -> Bool { guard input.count >= condition.0 else { print("2글자 이상의 이름을 입력해 주세요."); return false } guard input.count < condition.1 else { print("1~99의 숫자를 입력해 주세요."); return false } From 336d2d681bf823ab674eb17b53857ee57223b69d Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 16 Jan 2024 16:04:10 +0900 Subject: [PATCH 54/64] =?UTF-8?q?refactor:=20=EC=BB=A8=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=84=88=20=EA=B0=95=ED=95=9C=20=EC=B0=B8=EC=A1=B0=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EB=AF=B8=ED=95=B4=EA=B2=B0=EB=A1=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EB=B0=8F=20=EC=BD=94=EB=94=94=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=8C=A8=ED=84=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 4 -- .../App/Container.swift | 48 +++++++++---------- .../App/CoorninatorProtocol.swift | 10 ---- .../App/MainCoordinator.swift | 25 +++++++--- .../App/SceneDelegate.swift | 33 ++----------- .../PhoneBookViewController.swift | 2 +- 6 files changed, 46 insertions(+), 76 deletions(-) delete mode 100644 ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 0a9be701..42a78f4e 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083425122B51260500EE3C40 /* PropertyWrapper.swift */; }; 083CC5022B55245E00619E89 /* ViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083CC5012B55245D00619E89 /* ViewController+Extension.swift */; }; 0851E79E2B44FC7600FDFBF1 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0851E79D2B44FC7600FDFBF1 /* Container.swift */; }; - 086C4A182B56463700D1276E /* CoorninatorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086C4A172B56463700D1276E /* CoorninatorProtocol.swift */; }; 086C4A1A2B56467C00D1276E /* MainCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086C4A192B56467C00D1276E /* MainCoordinator.swift */; }; 08D566512B43E8E900E75000 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566502B43E8E900E75000 /* User.swift */; }; 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D566542B43ED3900E75000 /* PhoneBook.swift */; }; @@ -31,7 +30,6 @@ 083425122B51260500EE3C40 /* PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyWrapper.swift; sourceTree = ""; }; 083CC5012B55245D00619E89 /* ViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+Extension.swift"; sourceTree = ""; }; 0851E79D2B44FC7600FDFBF1 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = ""; }; - 086C4A172B56463700D1276E /* CoorninatorProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoorninatorProtocol.swift; sourceTree = ""; }; 086C4A192B56467C00D1276E /* MainCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCoordinator.swift; sourceTree = ""; }; 08D566502B43E8E900E75000 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 08D566542B43ED3900E75000 /* PhoneBook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneBook.swift; sourceTree = ""; }; @@ -68,7 +66,6 @@ 08E3AB942B43BB620083012B /* SceneDelegate.swift */, 0851E79D2B44FC7600FDFBF1 /* Container.swift */, 08E3AB9D2B43BB650083012B /* LaunchScreen.storyboard */, - 086C4A172B56463700D1276E /* CoorninatorProtocol.swift */, 086C4A192B56467C00D1276E /* MainCoordinator.swift */, ); path = App; @@ -212,7 +209,6 @@ 08D566512B43E8E900E75000 /* User.swift in Sources */, 083425132B51260500EE3C40 /* PropertyWrapper.swift in Sources */, 89566E522B43FAF70085E2CF /* PhoneBookTableViewCell.swift in Sources */, - 086C4A182B56463700D1276E /* CoorninatorProtocol.swift in Sources */, 08E3AB972B43BB620083012B /* PhoneBookViewController.swift in Sources */, 89566E572B4519000085E2CF /* HeaderView.swift in Sources */, 08D566552B43ED3900E75000 /* PhoneBook.swift in Sources */, diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift index 3ced0baf..ac553c71 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/Container.swift @@ -1,24 +1,24 @@ - -import Foundation - -final class Container { - - static let shared = Container() - - private init() {} - - private var services: [String: Any] = [:] - - func bind(service: Service.Type, resolver: @escaping (Container) -> Service) { - let key = String(describing: Service.self) - self.services[key] = resolver(self) - } - - func resolve(_ type: Service.Type) -> Service { - let key = String(describing: Service.self) - guard let service = services[key] as? Service else { - fatalError("주입할 객체가 service 딕셔너리에 바인딩되어있지 않음!") - } - return service - } -} +// +//import Foundation +// +//final class Container { +// +// static let shared = Container() +// +// private init() {} +// +// private var services: [String: Any] = [:] +// +// func bind(service: Service.Type, resolver: @escaping (Container) -> Service) { +// let key = String(describing: Service.self) +// self.services[key] = resolver(self) +// } +// +// func resolve(_ type: Service.Type) -> Service { +// let key = String(describing: Service.self) +// guard let service = services[key] as? Service else { +// fatalError("주입할 객체가 service 딕셔너리에 바인딩되어있지 않음!") +// } +// return service +// } +//} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift deleted file mode 100644 index a7ae2f64..00000000 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/CoorninatorProtocol.swift +++ /dev/null @@ -1,10 +0,0 @@ - -import UIKit - -protocol Coorninator { - var childCoordninators: [Coorninator] { get set } - var navigationController: UINavigationController { get set } - - func start() - func goToRegisterViewController() -} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift index 48ff157d..fc40611a 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/MainCoordinator.swift @@ -1,28 +1,39 @@ import UIKit -class MainCoordinator: Coorninator { - +protocol Coorninator { + var childCoordninators: [Coorninator] { get set } + var navigationController: UINavigationController { get set } + func start() + func goToRegisterViewController() +} + +final class MainCoordinator: Coorninator { + var childCoordninators = [Coorninator]() var navigationController: UINavigationController + private let phoneBook = PhoneBook() - let phoneBookViewController = Container.shared.resolve(PhoneBookViewController.self) - let registerViewController = Container.shared.resolve(RegisterViewController.self) - init(navigationController: UINavigationController) { self.navigationController = navigationController } func start() { + let phoneBookViewController = PhoneBookViewController() phoneBookViewController.coordinator = self + phoneBookViewController.phoneBook = phoneBook + navigationController.pushViewController(phoneBookViewController, animated: false) } func goToRegisterViewController() { + let storyboard = UIStoryboard(name: "RegisterViewController", bundle: nil) + let registerViewController = storyboard.instantiateViewController(identifier: "RegisterViewController") as! RegisterViewController registerViewController.coordinator = self - registerViewController.modalPresentationStyle = .formSheet - phoneBookViewController.present(registerViewController, animated: true) + registerViewController.phoneBook = phoneBook + registerViewController.modalPresentationStyle = .formSheet + navigationController.present(registerViewController, animated: true) } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift index d4b4e094..42a3795a 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/SceneDelegate.swift @@ -6,44 +6,17 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? var mainCoordniator: MainCoordinator? - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } - - setDependence() - + let navigationController = UINavigationController() + mainCoordniator = MainCoordinator(navigationController: navigationController) - mainCoordniator?.start() window = UIWindow(windowScene: windowScene) - window?.makeKeyAndVisible() window?.rootViewController = navigationController + window?.makeKeyAndVisible() window?.backgroundColor = .white } } - - -extension SceneDelegate { - func setDependence() { - Container.shared.bind(service: PhoneBook.self) { _ in - return PhoneBook() - } - - Container.shared.bind(service: PhoneBookViewController.self) { resolver in - let phoneBook = resolver.resolve(PhoneBook.self) - let phoneBookViewController = PhoneBookViewController() - phoneBookViewController.phoneBook = phoneBook - return phoneBookViewController - } - - Container.shared.bind(service: RegisterViewController.self) { resolver in - let phoneBook = resolver.resolve(PhoneBook.self) - let storyboard = UIStoryboard(name: "RegisterViewController", bundle: nil) - let registerViewController = storyboard.instantiateViewController(identifier: "RegisterViewController") as! RegisterViewController - registerViewController.phoneBook = phoneBook - return registerViewController - } - } -} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift index 8391040d..8cd51b7a 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -5,7 +5,7 @@ import UIKit final class PhoneBookViewController: UIViewController { let tableView = UITableView() - var phoneBook: PhoneBook? = nil + var phoneBook: PhoneBook? weak var coordinator: MainCoordinator? deinit {print("PhoneBookViewController has been deinit!!")} From b84a1978517bec093fe6ffe6d25f440d81a835f5 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Tue, 16 Jan 2024 17:17:20 +0900 Subject: [PATCH 55/64] =?UTF-8?q?fix:=20=ED=85=8D=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=ED=95=84=EB=93=9C=20=ED=85=8C=EB=91=90=EB=A6=AC=20=EC=83=89=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewController/RegisterViewController.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 5108c13b..9b26e05c 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -53,16 +53,21 @@ final class RegisterViewController: UIViewController { switch convertDigit.count { case 0...3: phoneNumberTextField.text = convertDigit + changeTextBorderColor(textField: phoneNumberTextField, color: UIColor.systemPink.cgColor) + isRightPhoneNumInput = false case 4...7: phoneNumberTextField.text = convertDigit.prefix(3) + "-" + convertDigit.suffix(convertDigit.count-3) - isRightPhoneNumInput = true + changeTextBorderColor(textField: phoneNumberTextField, color: UIColor.systemPink.cgColor) + isRightPhoneNumInput = false case 8...11: let startIndex = convertDigit.index(convertDigit.startIndex, offsetBy: 3) let endingIndex = convertDigit.index(convertDigit.startIndex, offsetBy: convertDigit.count-5) let middleNumber = convertDigit[startIndex...endingIndex] phoneNumberTextField.text = convertDigit.prefix(3) + "-" + middleNumber + "-" + convertDigit.suffix(4) + changeTextBorderColor(textField: phoneNumberTextField, color: UIColor.systemBlue.cgColor) isRightPhoneNumInput = true default: + changeTextBorderColor(textField: phoneNumberTextField, color: UIColor.systemPink.cgColor) isRightPhoneNumInput = false } } From 89ba4f0a7f1afcee0dcc6c66b2ab3ac65b4091a9 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 17 Jan 2024 10:10:19 +0900 Subject: [PATCH 56/64] =?UTF-8?q?feat:=20=EB=8B=A4=EC=9D=B4=EB=82=98?= =?UTF-8?q?=EB=AF=B9=20=ED=83=80=EC=9E=85=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/HeaderView.xib | 6 ++-- .../View/PhoneBookTableViewCell.xib | 16 +++++------ .../RegisterViewController.storyboard | 28 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib index 41977dbd..6cbc49c3 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib +++ b/ios-contact-manager-ui/ios-contact-manager-ui/View/HeaderView.xib @@ -1,8 +1,8 @@ - + - + @@ -18,7 +18,7 @@ - - + - - + + - - - + + + diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift index 91f3d843..faed2d09 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/RegisterViewController.swift @@ -83,6 +83,9 @@ final class RegisterViewController: UIViewController { age: Int(ageTextField.text ?? "") ?? 0 ) ) + nameIndexing.append(nameTextField.text ?? "") + phoneNumIndexing.append(phoneNumberTextField.text ?? "") + ageIndexing.append(Int(ageTextField.text ?? "") ?? 0) self.dismiss(animated: true) } From c62ef3cf109ea37cb160c223b2a87fbb3fe5c465 Mon Sep 17 00:00:00 2001 From: suojae3 Date: Sat, 20 Jan 2024 00:29:34 +0900 Subject: [PATCH 63/64] =?UTF-8?q?feat:=20=EC=82=AD=EC=A0=9C=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 4 ++-- .../App/PhoneBookCoordinator.swift | 2 +- .../Model/NotifyContactInfoChange.swift | 4 ++-- .../Model/PhoneBook.swift | 6 ++++++ .../PhoneBookViewController.swift | 18 +++++++++++++----- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index 01217fab..ae4b733a 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -364,7 +364,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = WZFUFHJN8D; + DEVELOPMENT_TEAM = VGM28F2FH7; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ios-contact-manager-ui/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -391,7 +391,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = WZFUFHJN8D; + DEVELOPMENT_TEAM = VGM28F2FH7; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ios-contact-manager-ui/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/App/PhoneBookCoordinator.swift b/ios-contact-manager-ui/ios-contact-manager-ui/App/PhoneBookCoordinator.swift index 0e54d66a..c64c65d2 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/App/PhoneBookCoordinator.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/App/PhoneBookCoordinator.swift @@ -20,7 +20,7 @@ final class PhoneBookCoordinator: Coordinator { func start() { let phoneBookViewController = PhoneBookViewController() phoneBookViewController.coordinator = self - phoneBookViewController.userData = phoneBook.categorizedContactInfo //시작값 셋팅 + phoneBookViewController.phoneBook = phoneBook phoneBook.setDelegate(with: phoneBookViewController) navigationController.pushViewController(phoneBookViewController, animated: true) } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/NotifyContactInfoChange.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/NotifyContactInfoChange.swift index a9574b62..6270a12d 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/NotifyContactInfoChange.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/NotifyContactInfoChange.swift @@ -2,7 +2,7 @@ import Foundation protocol UpdatePhoneBookDelegate: AnyObject { - func update(userInfo: [User]) + func update() } @propertyWrapper @@ -15,7 +15,7 @@ struct NotifyContactInfoChange { get { value } set { value = newValue - updateDelegate?.update(userInfo: value) + updateDelegate?.update() } } diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift index 3d483302..864348c8 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift @@ -12,6 +12,12 @@ final class PhoneBook { } deinit { print("PhoneBook has been deinit!!")} + } +extension PhoneBook { + func removeContact(at index: Int) { + categorizedContactInfo.remove(at: index) + } +} diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift index 31e2f8db..1e1cf60c 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/ViewController/PhoneBookViewController.swift @@ -4,6 +4,7 @@ import UIKit // MARK: - PhoneBookViewController Init & Deinit final class PhoneBookViewController: UIViewController { + var phoneBook: PhoneBook? var filteredArr: [String] = [] var filteredIdx: [Int] = [] @@ -14,7 +15,7 @@ final class PhoneBookViewController: UIViewController { return isActive && isSearchBarHasText } - var userData: [User]? = nil +// var userData: [User]? = nil let tableView = UITableView() weak var coordinator: RegisterUserInfoDelegate? @@ -83,7 +84,7 @@ extension PhoneBookViewController: UITableViewDataSource { if isFiltering { return filteredIdx.count } else { - return userData?.count ?? 0 + return phoneBook?.categorizedContactInfo.count ?? 0 } } @@ -97,13 +98,21 @@ extension PhoneBookViewController: UITableViewDataSource { } else { print("isFiltering: \(isFiltering)") guard let cell = tableView.dequeueReusableCell(withIdentifier: PhoneBookTableViewCell.reuseID, for: indexPath) as? PhoneBookTableViewCell else { return UITableViewCell() } - guard let user = userData?[indexPath.row] else { return UITableViewCell() } + guard let user = phoneBook?.categorizedContactInfo[indexPath.row] else { return UITableViewCell() } cell.nameLabel.text = "\(user.name)(\(user.age))" cell.phoneNumberLabel.text = user.phoneNumber return cell } } + + func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + phoneBook?.removeContact(at: indexPath.row) + tableView.deleteRows(at: [indexPath], with: .fade) + } + } + } // MARK: - View Transition private extension PhoneBookViewController { @@ -117,8 +126,7 @@ private extension PhoneBookViewController { // MARK: - Delegate extension PhoneBookViewController: UpdatePhoneBookDelegate { - func update(userInfo: [User]) { - userData = userInfo + func update() { DispatchQueue.main.async { [weak self] in self?.tableView.reloadData() } From 9982c3d2c0f88130d7255132273a696109a86b84 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Sat, 20 Jan 2024 01:06:56 +0900 Subject: [PATCH 64/64] =?UTF-8?q?feat:=20=EC=82=AD=EC=A0=9C=20=EC=88=98?= =?UTF-8?q?=ED=96=89=20=EC=8B=9C=20=EC=9D=B8=EB=8D=B1=EC=8A=A4=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios-contact-manager-ui.xcodeproj/project.pbxproj | 4 ++-- .../ios-contact-manager-ui/Model/PhoneBook.swift | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj index ae4b733a..01217fab 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj +++ b/ios-contact-manager-ui/ios-contact-manager-ui.xcodeproj/project.pbxproj @@ -364,7 +364,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = VGM28F2FH7; + DEVELOPMENT_TEAM = WZFUFHJN8D; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ios-contact-manager-ui/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -391,7 +391,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = VGM28F2FH7; + DEVELOPMENT_TEAM = WZFUFHJN8D; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ios-contact-manager-ui/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; diff --git a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift index 864348c8..84bc4df3 100644 --- a/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift +++ b/ios-contact-manager-ui/ios-contact-manager-ui/Model/PhoneBook.swift @@ -11,7 +11,7 @@ final class PhoneBook { _categorizedContactInfo.updateDelegate = delegate } - deinit { print("PhoneBook has been deinit!!")} + deinit { print("PhoneBook has been deinit!!") } } @@ -19,5 +19,8 @@ final class PhoneBook { extension PhoneBook { func removeContact(at index: Int) { categorizedContactInfo.remove(at: index) + nameIndexing.remove(at: index) + ageIndexing.remove(at: index) + phoneNumIndexing.remove(at: index) } }