diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c721ceb Binary files /dev/null and b/.DS_Store differ diff --git a/DogPicture/.DS_Store b/DogPicture/.DS_Store new file mode 100644 index 0000000..ce24eaa Binary files /dev/null and b/DogPicture/.DS_Store differ diff --git a/DogPicture/DogPicture.xcodeproj/project.pbxproj b/DogPicture/DogPicture.xcodeproj/project.pbxproj index dd40fb2..3df1861 100644 --- a/DogPicture/DogPicture.xcodeproj/project.pbxproj +++ b/DogPicture/DogPicture.xcodeproj/project.pbxproj @@ -3,29 +3,75 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ + 0B51B1FE26A8210E00216054 /* CameraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B51B1F926A8210E00216054 /* CameraViewController.swift */; }; + 0B51B1FF26A8210E00216054 /* CameraRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B51B1FA26A8210E00216054 /* CameraRouter.swift */; }; + 0B51B20026A8210E00216054 /* CameraInteracter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B51B1FB26A8210E00216054 /* CameraInteracter.swift */; }; + 0B51B20126A8210E00216054 /* CameraProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B51B1FC26A8210E00216054 /* CameraProtocol.swift */; }; + 0B51B20226A8210E00216054 /* CameraPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B51B1FD26A8210E00216054 /* CameraPresenter.swift */; }; + 0B73460F26861D62007CE6CF /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B73460E26861D62007CE6CF /* SettingViewController.swift */; }; + 0B73461126861D76007CE6CF /* SettingInteracter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B73461026861D76007CE6CF /* SettingInteracter.swift */; }; + 0B73461326861D87007CE6CF /* SettingProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B73461226861D87007CE6CF /* SettingProtocol.swift */; }; + 0B73461526861D98007CE6CF /* SettingPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B73461426861D98007CE6CF /* SettingPresenter.swift */; }; + 0B73461826861DB5007CE6CF /* SettingRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B73461726861DB5007CE6CF /* SettingRouter.swift */; }; + 0B73461A2686F6F8007CE6CF /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B7346192686F6F8007CE6CF /* Image.swift */; }; + 0B734631268CA2C7007CE6CF /* TabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B734630268CA2C7007CE6CF /* TabViewController.swift */; }; + 0BD2208A26E776B10064A8F6 /* HomeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD2208926E776B10064A8F6 /* HomeTableViewCell.swift */; }; 0BF238362660C2EE007E48AC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238352660C2EE007E48AC /* AppDelegate.swift */; }; 0BF238382660C2EE007E48AC /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238372660C2EE007E48AC /* SceneDelegate.swift */; }; - 0BF2383A2660C2EE007E48AC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238392660C2EE007E48AC /* ViewController.swift */; }; - 0BF2383D2660C2EE007E48AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0BF2383B2660C2EE007E48AC /* Main.storyboard */; }; 0BF238402660C2EE007E48AC /* DogPicture.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 0BF2383E2660C2EE007E48AC /* DogPicture.xcdatamodeld */; }; 0BF238422660C2F1007E48AC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0BF238412660C2F1007E48AC /* Assets.xcassets */; }; 0BF238452660C2F1007E48AC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0BF238432660C2F1007E48AC /* LaunchScreen.storyboard */; }; + 0BF2384F2660D5BE007E48AC /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF2384E2660D5BE007E48AC /* HomeViewController.swift */; }; + 0BF238512660D5DD007E48AC /* HomePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238502660D5DD007E48AC /* HomePresenter.swift */; }; + 0BF238532660D5EE007E48AC /* HomeProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238522660D5EE007E48AC /* HomeProtocol.swift */; }; + 0BF238552660D5FE007E48AC /* HomeViewRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238542660D5FE007E48AC /* HomeViewRouter.swift */; }; + 0BF238572660D628007E48AC /* HomeInteracter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238562660D628007E48AC /* HomeInteracter.swift */; }; + 0BF238592660D64D007E48AC /* MemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238582660D64D007E48AC /* MemoViewController.swift */; }; + 0BF2385B2660D667007E48AC /* MemoViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF2385A2660D667007E48AC /* MemoViewPresenter.swift */; }; + 0BF2385D2660D693007E48AC /* MemoViewRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF2385C2660D693007E48AC /* MemoViewRouter.swift */; }; + 0BF2385F2660D6A6007E48AC /* MemoViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF2385E2660D6A6007E48AC /* MemoViewProtocol.swift */; }; + 0BF238612660D6CE007E48AC /* MemoViewInteracter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF238602660D6CE007E48AC /* MemoViewInteracter.swift */; }; + 652E208B710784652D955719 /* Pods_DogPicture.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC4945DD6F70BA9462A5133C /* Pods_DogPicture.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0B51B1F926A8210E00216054 /* CameraViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraViewController.swift; sourceTree = ""; }; + 0B51B1FA26A8210E00216054 /* CameraRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraRouter.swift; sourceTree = ""; }; + 0B51B1FB26A8210E00216054 /* CameraInteracter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraInteracter.swift; sourceTree = ""; }; + 0B51B1FC26A8210E00216054 /* CameraProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraProtocol.swift; sourceTree = ""; }; + 0B51B1FD26A8210E00216054 /* CameraPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraPresenter.swift; sourceTree = ""; }; + 0B73460E26861D62007CE6CF /* SettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = ""; }; + 0B73461026861D76007CE6CF /* SettingInteracter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingInteracter.swift; sourceTree = ""; }; + 0B73461226861D87007CE6CF /* SettingProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingProtocol.swift; sourceTree = ""; }; + 0B73461426861D98007CE6CF /* SettingPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingPresenter.swift; sourceTree = ""; }; + 0B73461726861DB5007CE6CF /* SettingRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingRouter.swift; sourceTree = ""; }; + 0B7346192686F6F8007CE6CF /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = ""; }; + 0B734630268CA2C7007CE6CF /* TabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabViewController.swift; sourceTree = ""; }; + 0BD2208926E776B10064A8F6 /* HomeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeTableViewCell.swift; sourceTree = ""; }; 0BF238322660C2EE007E48AC /* DogPicture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DogPicture.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0BF238352660C2EE007E48AC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 0BF238372660C2EE007E48AC /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 0BF238392660C2EE007E48AC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 0BF2383C2660C2EE007E48AC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 0BF2383F2660C2EE007E48AC /* DogPicture.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = DogPicture.xcdatamodel; sourceTree = ""; }; 0BF238412660C2F1007E48AC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 0BF238442660C2F1007E48AC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 0BF238462660C2F1007E48AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0BF2384E2660D5BE007E48AC /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; + 0BF238502660D5DD007E48AC /* HomePresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomePresenter.swift; sourceTree = ""; }; + 0BF238522660D5EE007E48AC /* HomeProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeProtocol.swift; sourceTree = ""; }; + 0BF238542660D5FE007E48AC /* HomeViewRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewRouter.swift; sourceTree = ""; }; + 0BF238562660D628007E48AC /* HomeInteracter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeInteracter.swift; sourceTree = ""; }; + 0BF238582660D64D007E48AC /* MemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewController.swift; sourceTree = ""; }; + 0BF2385A2660D667007E48AC /* MemoViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewPresenter.swift; sourceTree = ""; }; + 0BF2385C2660D693007E48AC /* MemoViewRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewRouter.swift; sourceTree = ""; }; + 0BF2385E2660D6A6007E48AC /* MemoViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewProtocol.swift; sourceTree = ""; }; + 0BF238602660D6CE007E48AC /* MemoViewInteracter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewInteracter.swift; sourceTree = ""; }; + 6719164F8D930F4F41189534 /* Pods-DogPicture.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DogPicture.debug.xcconfig"; path = "Target Support Files/Pods-DogPicture/Pods-DogPicture.debug.xcconfig"; sourceTree = ""; }; + 73F0D253AF45C332428DC6CA /* Pods-DogPicture.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DogPicture.release.xcconfig"; path = "Target Support Files/Pods-DogPicture/Pods-DogPicture.release.xcconfig"; sourceTree = ""; }; + DC4945DD6F70BA9462A5133C /* Pods_DogPicture.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DogPicture.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -33,17 +79,86 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 652E208B710784652D955719 /* Pods_DogPicture.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0B73460126834780007CE6CF /* Camera */ = { + isa = PBXGroup; + children = ( + 0B73462E268B36F9007CE6CF /* CameraView */, + 0B734623268B19C3007CE6CF /* Library */, + ); + path = Camera; + sourceTree = ""; + }; + 0B7346022683479C007CE6CF /* Setting */ = { + isa = PBXGroup; + children = ( + 0B73460E26861D62007CE6CF /* SettingViewController.swift */, + 0B73461026861D76007CE6CF /* SettingInteracter.swift */, + 0B73461226861D87007CE6CF /* SettingProtocol.swift */, + 0B73461426861D98007CE6CF /* SettingPresenter.swift */, + 0B73461726861DB5007CE6CF /* SettingRouter.swift */, + ); + path = Setting; + sourceTree = ""; + }; + 0B734603268347D6007CE6CF /* MainView */ = { + isa = PBXGroup; + children = ( + 0B73461B2686F700007CE6CF /* Entities */, + 0BF2384C2660D501007E48AC /* Home */, + 0BF2384D2660D527007E48AC /* Memo */, + ); + path = MainView; + sourceTree = ""; + }; + 0B73461B2686F700007CE6CF /* Entities */ = { + isa = PBXGroup; + children = ( + 0B7346192686F6F8007CE6CF /* Image.swift */, + ); + path = Entities; + sourceTree = ""; + }; + 0B734623268B19C3007CE6CF /* Library */ = { + isa = PBXGroup; + children = ( + ); + path = Library; + sourceTree = ""; + }; + 0B73462E268B36F9007CE6CF /* CameraView */ = { + isa = PBXGroup; + children = ( + 0B51B1F926A8210E00216054 /* CameraViewController.swift */, + 0B51B1FD26A8210E00216054 /* CameraPresenter.swift */, + 0B51B1FB26A8210E00216054 /* CameraInteracter.swift */, + 0B51B1FA26A8210E00216054 /* CameraRouter.swift */, + 0B51B1FC26A8210E00216054 /* CameraProtocol.swift */, + ); + path = CameraView; + sourceTree = ""; + }; + 0B73462F268CA28C007CE6CF /* TabBar */ = { + isa = PBXGroup; + children = ( + 0B734630268CA2C7007CE6CF /* TabViewController.swift */, + ); + path = TabBar; + sourceTree = ""; + }; 0BF238292660C2EE007E48AC = { isa = PBXGroup; children = ( 0BF238342660C2EE007E48AC /* DogPicture */, 0BF238332660C2EE007E48AC /* Products */, + 26DCC1AEDCCD0ACC3C11726A /* Pods */, + D2DEA8282397FA9B6E4359B9 /* Frameworks */, ); sourceTree = ""; }; @@ -58,10 +173,12 @@ 0BF238342660C2EE007E48AC /* DogPicture */ = { isa = PBXGroup; children = ( + 0B73462F268CA28C007CE6CF /* TabBar */, + 0B734603268347D6007CE6CF /* MainView */, + 0B73460126834780007CE6CF /* Camera */, + 0B7346022683479C007CE6CF /* Setting */, 0BF238352660C2EE007E48AC /* AppDelegate.swift */, 0BF238372660C2EE007E48AC /* SceneDelegate.swift */, - 0BF238392660C2EE007E48AC /* ViewController.swift */, - 0BF2383B2660C2EE007E48AC /* Main.storyboard */, 0BF238412660C2F1007E48AC /* Assets.xcassets */, 0BF238432660C2F1007E48AC /* LaunchScreen.storyboard */, 0BF238462660C2F1007E48AC /* Info.plist */, @@ -70,6 +187,48 @@ path = DogPicture; sourceTree = ""; }; + 0BF2384C2660D501007E48AC /* Home */ = { + isa = PBXGroup; + children = ( + 0BF2384E2660D5BE007E48AC /* HomeViewController.swift */, + 0BD2208926E776B10064A8F6 /* HomeTableViewCell.swift */, + 0BF238502660D5DD007E48AC /* HomePresenter.swift */, + 0BF238522660D5EE007E48AC /* HomeProtocol.swift */, + 0BF238542660D5FE007E48AC /* HomeViewRouter.swift */, + 0BF238562660D628007E48AC /* HomeInteracter.swift */, + ); + path = Home; + sourceTree = ""; + }; + 0BF2384D2660D527007E48AC /* Memo */ = { + isa = PBXGroup; + children = ( + 0BF238582660D64D007E48AC /* MemoViewController.swift */, + 0BF2385A2660D667007E48AC /* MemoViewPresenter.swift */, + 0BF2385C2660D693007E48AC /* MemoViewRouter.swift */, + 0BF2385E2660D6A6007E48AC /* MemoViewProtocol.swift */, + 0BF238602660D6CE007E48AC /* MemoViewInteracter.swift */, + ); + path = Memo; + sourceTree = ""; + }; + 26DCC1AEDCCD0ACC3C11726A /* Pods */ = { + isa = PBXGroup; + children = ( + 6719164F8D930F4F41189534 /* Pods-DogPicture.debug.xcconfig */, + 73F0D253AF45C332428DC6CA /* Pods-DogPicture.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + D2DEA8282397FA9B6E4359B9 /* Frameworks */ = { + isa = PBXGroup; + children = ( + DC4945DD6F70BA9462A5133C /* Pods_DogPicture.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -77,9 +236,11 @@ isa = PBXNativeTarget; buildConfigurationList = 0BF238492660C2F1007E48AC /* Build configuration list for PBXNativeTarget "DogPicture" */; buildPhases = ( + 7E38BDD2A5DCCA955534E197 /* [CP] Check Pods Manifest.lock */, 0BF2382E2660C2EE007E48AC /* Sources */, 0BF2382F2660C2EE007E48AC /* Frameworks */, 0BF238302660C2EE007E48AC /* Resources */, + ED58E8449DCB65415197F3A9 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -129,35 +290,90 @@ files = ( 0BF238452660C2F1007E48AC /* LaunchScreen.storyboard in Resources */, 0BF238422660C2F1007E48AC /* Assets.xcassets in Resources */, - 0BF2383D2660C2EE007E48AC /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 7E38BDD2A5DCCA955534E197 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-DogPicture-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + ED58E8449DCB65415197F3A9 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DogPicture/Pods-DogPicture-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DogPicture/Pods-DogPicture-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DogPicture/Pods-DogPicture-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 0BF2382E2660C2EE007E48AC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0BF2383A2660C2EE007E48AC /* ViewController.swift in Sources */, + 0BF2385B2660D667007E48AC /* MemoViewPresenter.swift in Sources */, + 0BF238552660D5FE007E48AC /* HomeViewRouter.swift in Sources */, + 0BD2208A26E776B10064A8F6 /* HomeTableViewCell.swift in Sources */, + 0B51B20026A8210E00216054 /* CameraInteracter.swift in Sources */, + 0BF2384F2660D5BE007E48AC /* HomeViewController.swift in Sources */, + 0BF238592660D64D007E48AC /* MemoViewController.swift in Sources */, + 0BF2385D2660D693007E48AC /* MemoViewRouter.swift in Sources */, + 0B73461526861D98007CE6CF /* SettingPresenter.swift in Sources */, + 0B51B20126A8210E00216054 /* CameraProtocol.swift in Sources */, + 0B734631268CA2C7007CE6CF /* TabViewController.swift in Sources */, + 0BF2385F2660D6A6007E48AC /* MemoViewProtocol.swift in Sources */, + 0BF238612660D6CE007E48AC /* MemoViewInteracter.swift in Sources */, + 0B51B1FE26A8210E00216054 /* CameraViewController.swift in Sources */, 0BF238402660C2EE007E48AC /* DogPicture.xcdatamodeld in Sources */, 0BF238362660C2EE007E48AC /* AppDelegate.swift in Sources */, + 0BF238532660D5EE007E48AC /* HomeProtocol.swift in Sources */, + 0B73461326861D87007CE6CF /* SettingProtocol.swift in Sources */, + 0B73460F26861D62007CE6CF /* SettingViewController.swift in Sources */, + 0B51B20226A8210E00216054 /* CameraPresenter.swift in Sources */, + 0BF238572660D628007E48AC /* HomeInteracter.swift in Sources */, + 0B51B1FF26A8210E00216054 /* CameraRouter.swift in Sources */, + 0BF238512660D5DD007E48AC /* HomePresenter.swift in Sources */, + 0B73461126861D76007CE6CF /* SettingInteracter.swift in Sources */, + 0B73461826861DB5007CE6CF /* SettingRouter.swift in Sources */, 0BF238382660C2EE007E48AC /* SceneDelegate.swift in Sources */, + 0B73461A2686F6F8007CE6CF /* Image.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 0BF2383B2660C2EE007E48AC /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 0BF2383C2660C2EE007E48AC /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; 0BF238432660C2F1007E48AC /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -287,6 +503,7 @@ }; 0BF2384A2660C2F1007E48AC /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 6719164F8D930F4F41189534 /* Pods-DogPicture.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -306,6 +523,7 @@ }; 0BF2384B2660C2F1007E48AC /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 73F0D253AF45C332428DC6CA /* Pods-DogPicture.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; diff --git a/DogPicture/DogPicture.xcodeproj/xcshareddata/xcschemes/DogPicture.xcscheme b/DogPicture/DogPicture.xcodeproj/xcshareddata/xcschemes/DogPicture.xcscheme new file mode 100644 index 0000000..ccf480b --- /dev/null +++ b/DogPicture/DogPicture.xcodeproj/xcshareddata/xcschemes/DogPicture.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DogPicture/DogPicture.xcworkspace/contents.xcworkspacedata b/DogPicture/DogPicture.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..00f7639 --- /dev/null +++ b/DogPicture/DogPicture.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/DogPicture/DogPicture.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/DogPicture/DogPicture.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/DogPicture/DogPicture.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/DogPicture/DogPicture/AppDelegate.swift b/DogPicture/DogPicture/AppDelegate.swift index 51b758a..55ceaa3 100644 --- a/DogPicture/DogPicture/AppDelegate.swift +++ b/DogPicture/DogPicture/AppDelegate.swift @@ -7,14 +7,18 @@ import UIKit import CoreData - @main class AppDelegate: UIResponder, UIApplicationDelegate { - + var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + let tabVC = TabViewController() + tabVC.view.backgroundColor = UIColor.white + window = UIWindow(frame: UIScreen.main.bounds) + window?.rootViewController = tabVC + window?.makeKeyAndVisible() return true } @@ -33,7 +37,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } // MARK: - Core Data stack - + + lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation diff --git a/DogPicture/DogPicture/Assets.xcassets/Image.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/Image.imageset/Contents.json new file mode 100644 index 0000000..a19a549 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/Image.imageset/Contents.json @@ -0,0 +1,20 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p1.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p1.imageset/Contents.json new file mode 100644 index 0000000..a0bde46 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p1.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p1.imageset/p1.jpeg b/DogPicture/DogPicture/Assets.xcassets/p1.imageset/p1.jpeg new file mode 100644 index 0000000..45013e4 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p1.imageset/p1.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p10.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p10.imageset/Contents.json new file mode 100644 index 0000000..d739f8c --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p10.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p10.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p10.imageset/p10.jpeg b/DogPicture/DogPicture/Assets.xcassets/p10.imageset/p10.jpeg new file mode 100644 index 0000000..b055086 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p10.imageset/p10.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p11.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p11.imageset/Contents.json new file mode 100644 index 0000000..8702892 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p11.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p11.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p11.imageset/p11.jpeg b/DogPicture/DogPicture/Assets.xcassets/p11.imageset/p11.jpeg new file mode 100644 index 0000000..b90b70d Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p11.imageset/p11.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p12.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p12.imageset/Contents.json new file mode 100644 index 0000000..c56aa29 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p12.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p12.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p12.imageset/p12.jpeg b/DogPicture/DogPicture/Assets.xcassets/p12.imageset/p12.jpeg new file mode 100644 index 0000000..2e4bc04 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p12.imageset/p12.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p13.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p13.imageset/Contents.json new file mode 100644 index 0000000..5214f9e --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p13.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p13.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p13.imageset/p13.jpeg b/DogPicture/DogPicture/Assets.xcassets/p13.imageset/p13.jpeg new file mode 100644 index 0000000..2c522d5 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p13.imageset/p13.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p14.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p14.imageset/Contents.json new file mode 100644 index 0000000..f63efac --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p14.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p14.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p14.imageset/p14.jpeg b/DogPicture/DogPicture/Assets.xcassets/p14.imageset/p14.jpeg new file mode 100644 index 0000000..1ab079e Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p14.imageset/p14.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p15.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p15.imageset/Contents.json new file mode 100644 index 0000000..922d318 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p15.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p15.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p15.imageset/p15.jpeg b/DogPicture/DogPicture/Assets.xcassets/p15.imageset/p15.jpeg new file mode 100644 index 0000000..68b650c Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p15.imageset/p15.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p16.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p16.imageset/Contents.json new file mode 100644 index 0000000..19f756a --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p16.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p16.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p16.imageset/p16.jpeg b/DogPicture/DogPicture/Assets.xcassets/p16.imageset/p16.jpeg new file mode 100644 index 0000000..77dd550 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p16.imageset/p16.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p17.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p17.imageset/Contents.json new file mode 100644 index 0000000..e962245 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p17.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p17.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p17.imageset/p17.jpeg b/DogPicture/DogPicture/Assets.xcassets/p17.imageset/p17.jpeg new file mode 100644 index 0000000..bffa38a Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p17.imageset/p17.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p18.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p18.imageset/Contents.json new file mode 100644 index 0000000..8e076f4 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p18.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p18.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p18.imageset/p18.jpeg b/DogPicture/DogPicture/Assets.xcassets/p18.imageset/p18.jpeg new file mode 100644 index 0000000..90e6000 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p18.imageset/p18.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p19.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p19.imageset/Contents.json new file mode 100644 index 0000000..6c026fb --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p19.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p19.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p19.imageset/p19.jpeg b/DogPicture/DogPicture/Assets.xcassets/p19.imageset/p19.jpeg new file mode 100644 index 0000000..22a068c Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p19.imageset/p19.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p2.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p2.imageset/Contents.json new file mode 100644 index 0000000..2abc66d --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p2.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p2.imageset/p2.jpeg b/DogPicture/DogPicture/Assets.xcassets/p2.imageset/p2.jpeg new file mode 100644 index 0000000..c903459 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p2.imageset/p2.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p20.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p20.imageset/Contents.json new file mode 100644 index 0000000..f3bfc7d --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p20.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p20.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p20.imageset/p20.jpeg b/DogPicture/DogPicture/Assets.xcassets/p20.imageset/p20.jpeg new file mode 100644 index 0000000..7bc47d1 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p20.imageset/p20.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p21.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p21.imageset/Contents.json new file mode 100644 index 0000000..4371cbf --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p21.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p21.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p21.imageset/p21.jpeg b/DogPicture/DogPicture/Assets.xcassets/p21.imageset/p21.jpeg new file mode 100644 index 0000000..f016161 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p21.imageset/p21.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p22.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p22.imageset/Contents.json new file mode 100644 index 0000000..edd9a08 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p22.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p22.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p22.imageset/p22.jpeg b/DogPicture/DogPicture/Assets.xcassets/p22.imageset/p22.jpeg new file mode 100644 index 0000000..81e34cf Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p22.imageset/p22.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p23.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p23.imageset/Contents.json new file mode 100644 index 0000000..ce2d87d --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p23.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p23.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p23.imageset/p23.jpeg b/DogPicture/DogPicture/Assets.xcassets/p23.imageset/p23.jpeg new file mode 100644 index 0000000..653f17c Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p23.imageset/p23.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p24.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p24.imageset/Contents.json new file mode 100644 index 0000000..90851a1 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p24.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p24.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p24.imageset/p24.jpeg b/DogPicture/DogPicture/Assets.xcassets/p24.imageset/p24.jpeg new file mode 100644 index 0000000..be3b8f6 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p24.imageset/p24.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p25.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p25.imageset/Contents.json new file mode 100644 index 0000000..dd4a3f0 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p25.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p25.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p25.imageset/p25.jpeg b/DogPicture/DogPicture/Assets.xcassets/p25.imageset/p25.jpeg new file mode 100644 index 0000000..399bb78 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p25.imageset/p25.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p26.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p26.imageset/Contents.json new file mode 100644 index 0000000..be95bf2 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p26.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p26.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p26.imageset/p26.jpeg b/DogPicture/DogPicture/Assets.xcassets/p26.imageset/p26.jpeg new file mode 100644 index 0000000..67d2257 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p26.imageset/p26.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p27.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p27.imageset/Contents.json new file mode 100644 index 0000000..1b49e5b --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p27.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p27.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p27.imageset/p27.jpeg b/DogPicture/DogPicture/Assets.xcassets/p27.imageset/p27.jpeg new file mode 100644 index 0000000..887bd51 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p27.imageset/p27.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p28.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p28.imageset/Contents.json new file mode 100644 index 0000000..93d426a --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p28.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p28.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p28.imageset/p28.jpeg b/DogPicture/DogPicture/Assets.xcassets/p28.imageset/p28.jpeg new file mode 100644 index 0000000..cec1eef Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p28.imageset/p28.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p29.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p29.imageset/Contents.json new file mode 100644 index 0000000..35aff6a --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p29.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p29.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p29.imageset/p29.jpeg b/DogPicture/DogPicture/Assets.xcassets/p29.imageset/p29.jpeg new file mode 100644 index 0000000..1d56099 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p29.imageset/p29.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p3.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p3.imageset/Contents.json new file mode 100644 index 0000000..77bebca --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p3.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p3.imageset/p3.jpeg b/DogPicture/DogPicture/Assets.xcassets/p3.imageset/p3.jpeg new file mode 100644 index 0000000..affbee8 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p3.imageset/p3.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p30.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p30.imageset/Contents.json new file mode 100644 index 0000000..e129be6 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p30.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p30.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p30.imageset/p30.jpeg b/DogPicture/DogPicture/Assets.xcassets/p30.imageset/p30.jpeg new file mode 100644 index 0000000..88fdbbe Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p30.imageset/p30.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p4.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p4.imageset/Contents.json new file mode 100644 index 0000000..3aaa283 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p4.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p4.imageset/p4.jpeg b/DogPicture/DogPicture/Assets.xcassets/p4.imageset/p4.jpeg new file mode 100644 index 0000000..0b33197 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p4.imageset/p4.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p5.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p5.imageset/Contents.json new file mode 100644 index 0000000..e47654a --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p5.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p5.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p5.imageset/p5.jpeg b/DogPicture/DogPicture/Assets.xcassets/p5.imageset/p5.jpeg new file mode 100644 index 0000000..728c6c0 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p5.imageset/p5.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p6.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p6.imageset/Contents.json new file mode 100644 index 0000000..fac2a5e --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p6.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p6.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p6.imageset/p6.jpeg b/DogPicture/DogPicture/Assets.xcassets/p6.imageset/p6.jpeg new file mode 100644 index 0000000..c0940d2 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p6.imageset/p6.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p7.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p7.imageset/Contents.json new file mode 100644 index 0000000..1516c0e --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p7.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p7.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p7.imageset/p7.jpeg b/DogPicture/DogPicture/Assets.xcassets/p7.imageset/p7.jpeg new file mode 100644 index 0000000..215685a Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p7.imageset/p7.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p8.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p8.imageset/Contents.json new file mode 100644 index 0000000..b7baf20 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p8.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p8.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p8.imageset/p8.jpeg b/DogPicture/DogPicture/Assets.xcassets/p8.imageset/p8.jpeg new file mode 100644 index 0000000..5f816f6 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p8.imageset/p8.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/p9.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/p9.imageset/Contents.json new file mode 100644 index 0000000..69a3cd5 --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/p9.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "p9.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/p9.imageset/p9.jpeg b/DogPicture/DogPicture/Assets.xcassets/p9.imageset/p9.jpeg new file mode 100644 index 0000000..b376275 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/p9.imageset/p9.jpeg differ diff --git a/DogPicture/DogPicture/Assets.xcassets/plusButton.imageset/Contents.json b/DogPicture/DogPicture/Assets.xcassets/plusButton.imageset/Contents.json new file mode 100644 index 0000000..59c979e --- /dev/null +++ b/DogPicture/DogPicture/Assets.xcassets/plusButton.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "plusButton.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DogPicture/DogPicture/Assets.xcassets/plusButton.imageset/plusButton.png b/DogPicture/DogPicture/Assets.xcassets/plusButton.imageset/plusButton.png new file mode 100644 index 0000000..87cd3b2 Binary files /dev/null and b/DogPicture/DogPicture/Assets.xcassets/plusButton.imageset/plusButton.png differ diff --git a/DogPicture/DogPicture/Camera/CameraView/CameraInteracter.swift b/DogPicture/DogPicture/Camera/CameraView/CameraInteracter.swift new file mode 100644 index 0000000..32894d4 --- /dev/null +++ b/DogPicture/DogPicture/Camera/CameraView/CameraInteracter.swift @@ -0,0 +1,16 @@ +// +// HomeInteracter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import UIKit + +class CameraInteracter: CameraInteracterInputProtocol { + weak var presenter: CameraInteracterOutputProtocol? +} + +extension CameraInteracter: CameraInteracterOutputProtocol { + +} diff --git a/DogPicture/DogPicture/Camera/CameraView/CameraPresenter.swift b/DogPicture/DogPicture/Camera/CameraView/CameraPresenter.swift new file mode 100644 index 0000000..ab0826c --- /dev/null +++ b/DogPicture/DogPicture/Camera/CameraView/CameraPresenter.swift @@ -0,0 +1,26 @@ +// +// CameraPresenter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import UIKit + +class CameraPresenter: CameraPresenterProtocol { + func showCamera() { + print("x") + } + + weak var view: CameraViewProtocol? + var interacter: CameraInteracterInputProtocol? + var router: CameraRouterProtocol? + + + + +} + +extension CameraPresenter: CameraInteracterOutputProtocol { + +} diff --git a/DogPicture/DogPicture/Camera/CameraView/CameraProtocol.swift b/DogPicture/DogPicture/Camera/CameraView/CameraProtocol.swift new file mode 100644 index 0000000..1060ac8 --- /dev/null +++ b/DogPicture/DogPicture/Camera/CameraView/CameraProtocol.swift @@ -0,0 +1,36 @@ +// +// CameraProtocol.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import UIKit + +protocol CameraViewProtocol: AnyObject { + var presenter: CameraPresenterProtocol? { get set } + +} + +protocol CameraRouterProtocol: AnyObject { + static func createCameraModule() -> UIViewController + +} + +protocol CameraPresenterProtocol: AnyObject { + var view: CameraViewProtocol? { get set } + var interacter: CameraInteracterInputProtocol? { get set } + var router: CameraRouterProtocol? { get set } + + func showCamera() + +} + +protocol CameraInteracterInputProtocol: AnyObject { + var presenter: CameraInteracterOutputProtocol? { get set } + +} + +protocol CameraInteracterOutputProtocol: AnyObject { + +} diff --git a/DogPicture/DogPicture/Camera/CameraView/CameraRouter.swift b/DogPicture/DogPicture/Camera/CameraView/CameraRouter.swift new file mode 100644 index 0000000..3f1ef5e --- /dev/null +++ b/DogPicture/DogPicture/Camera/CameraView/CameraRouter.swift @@ -0,0 +1,31 @@ +// +// CameraRouter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import UIKit + +class CameraRouter: CameraRouterProtocol { + static func createCameraModule() -> UIViewController { + if let view: CameraViewProtocol = CameraViewController() as? CameraViewProtocol { + let presenter: CameraPresenterProtocol & CameraInteracterOutputProtocol = CameraPresenter() + let interacter: CameraInteracterInputProtocol = CameraInteracter() + let router: CameraRouterProtocol = CameraRouter() + + presenter.view = view + view.presenter = presenter + presenter.router = router + presenter.interacter = interacter + interacter.presenter = presenter + + if let cameraView = view as? UIViewController { + return cameraView + } + } + return UIViewController() + } + + +} diff --git a/DogPicture/DogPicture/Camera/CameraView/CameraViewController.swift b/DogPicture/DogPicture/Camera/CameraView/CameraViewController.swift new file mode 100644 index 0000000..6d00482 --- /dev/null +++ b/DogPicture/DogPicture/Camera/CameraView/CameraViewController.swift @@ -0,0 +1,67 @@ +// +// CameraViewController.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import UIKit + +class CameraViewController: UIViewController { + var presenter: CameraPresenterProtocol? + let captureButton = UIButton() + let photoViewButton = UIImageView() + + override func viewDidLoad() { + super.viewDidLoad() + attribute() + layout() + self.title = "Tab_Camera" + self.view.backgroundColor = .white + } + + func attribute() { + captureButton.do { + $0.frame(forAlignmentRect: CGRect(x: 0, y: 0, width: 100, height: 100)) + $0.layer.cornerRadius = 50 + $0.layer.borderWidth = 10 + $0.layer.borderColor = UIColor.white.cgColor + } + photoViewButton.do { + $0.frame = view.bounds + } + } + + func layout() { + [ captureButton, photoViewButton ] .forEach() { view.addSubview($0) } + + captureButton.do { + $0.translatesAutoresizingMaskIntoConstraints = false + + } + + photoViewButton.do { + $0.translatesAutoresizingMaskIntoConstraints = false + + } + } +} + +extension CameraViewController: CameraViewProtocol { + +} + +extension CameraViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { + picker.dismiss(animated: true, completion: nil) + + } + + func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { + picker.dismiss(animated: true, completion: nil) + + } +} + + + diff --git a/DogPicture/DogPicture/Camera/Library/LibraryInteracter.swift b/DogPicture/DogPicture/Camera/Library/LibraryInteracter.swift new file mode 100644 index 0000000..f708e21 --- /dev/null +++ b/DogPicture/DogPicture/Camera/Library/LibraryInteracter.swift @@ -0,0 +1,16 @@ +// +// LibraryInteracter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/29. +// + +import UIKit + +class LibraryInteracter: LibraryInteracterInputProtocol { + +} + +extension LibraryInteracter: LibraryInteracterOutputProtocol { + +} diff --git a/DogPicture/DogPicture/Camera/Library/LibraryPresenter.swift b/DogPicture/DogPicture/Camera/Library/LibraryPresenter.swift new file mode 100644 index 0000000..703f062 --- /dev/null +++ b/DogPicture/DogPicture/Camera/Library/LibraryPresenter.swift @@ -0,0 +1,12 @@ +// +// LibraryPresenter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/29. +// + +import UIKit + +class LibarayPresenter: LibraryPresenterProtocol { + +} diff --git a/DogPicture/DogPicture/Camera/Library/LibraryProtocol.swift b/DogPicture/DogPicture/Camera/Library/LibraryProtocol.swift new file mode 100644 index 0000000..9c0a340 --- /dev/null +++ b/DogPicture/DogPicture/Camera/Library/LibraryProtocol.swift @@ -0,0 +1,30 @@ +// +// LibraryProtocol.swift +// DogPicture +// +// Created by 김동우 on 2021/06/29. +// + +import UIKit + +protocol LibraryViewControllerProtocol: AnyObject { + +} + +protocol LibraryRouterProtocol: AnyObject { + static func createLibraryModule() -> UIViewController +} + +protocol LibraryPresenterProtocol: AnyObject { + +} + +protocol LibraryInteracterInputProtocol: AnyObject { + +} + +protocol LibraryInteracterOutputProtocol: AnyObject { + +} + + diff --git a/DogPicture/DogPicture/Camera/Library/LibraryRouter.swift b/DogPicture/DogPicture/Camera/Library/LibraryRouter.swift new file mode 100644 index 0000000..3ce8a85 --- /dev/null +++ b/DogPicture/DogPicture/Camera/Library/LibraryRouter.swift @@ -0,0 +1,16 @@ +// +// LibraryRouter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/29. +// + +import UIKit + +class LibraryRouter: LibraryRouterProtocol { + static func createLibraryModule() -> UIViewController { + <#code#> + } + + +} diff --git a/DogPicture/DogPicture/Camera/Library/LibraryViewController.swift b/DogPicture/DogPicture/Camera/Library/LibraryViewController.swift new file mode 100644 index 0000000..135d480 --- /dev/null +++ b/DogPicture/DogPicture/Camera/Library/LibraryViewController.swift @@ -0,0 +1,22 @@ +// +// LibraryViewController.swift +// DogPicture +// +// Created by 김동우 on 2021/06/29. +// + +import UIKit + +class LibraryViewController: UIViewController { + + + + override func viewDidLoad() { + super.viewDidLoad() + + } +} + +extension LibraryViewController: LibraryViewControllerProtocol { + +} diff --git a/DogPicture/DogPicture/Info.plist b/DogPicture/DogPicture/Info.plist index 5b531f7..2688b32 100644 --- a/DogPicture/DogPicture/Info.plist +++ b/DogPicture/DogPicture/Info.plist @@ -33,8 +33,6 @@ Default Configuration UISceneDelegateClassName $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main @@ -43,8 +41,6 @@ UILaunchStoryboardName LaunchScreen - UIMainStoryboardFile - Main UIRequiredDeviceCapabilities armv7 diff --git a/DogPicture/DogPicture/MainView/Entities/CoreDataTest.xcdatamodeld/CoreDataTest.xcdatamodel/contents b/DogPicture/DogPicture/MainView/Entities/CoreDataTest.xcdatamodeld/CoreDataTest.xcdatamodel/contents new file mode 100644 index 0000000..6543832 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Entities/CoreDataTest.xcdatamodeld/CoreDataTest.xcdatamodel/contents @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/DogPicture/DogPicture/MainView/Entities/Image.swift b/DogPicture/DogPicture/MainView/Entities/Image.swift new file mode 100644 index 0000000..0d8cc2b --- /dev/null +++ b/DogPicture/DogPicture/MainView/Entities/Image.swift @@ -0,0 +1,21 @@ +// +// Image.swift +// DogPicture +// +// Created by 김동우 on 2021/06/26. +// + +import UIKit + +class Image { + static let shared = Image() + var petitImages: [String] = [ "p1", "p2", "p3", "p4", "p5", + "p6", "p7", "p8", "p9", "p10", + "p11", "p12", "p13", "p14", "p15", + "p16", "p17", "p18", "p19", "p20", + "p21", "p22", "p23", "p24", "p25", + "p26", "p27", "p28", "p29", "p30"] + func getDogImageList() -> [String] { + return petitImages + } +} diff --git a/DogPicture/DogPicture/MainView/Entities/MemoContent+CoreDataClass.swift b/DogPicture/DogPicture/MainView/Entities/MemoContent+CoreDataClass.swift new file mode 100644 index 0000000..71e830f --- /dev/null +++ b/DogPicture/DogPicture/MainView/Entities/MemoContent+CoreDataClass.swift @@ -0,0 +1,15 @@ +// +// MemoContent+CoreDataClass.swift +// +// +// Created by 김동우 on 2021/06/28. +// +// + +import Foundation +import CoreData + +@objc(MemoContent) +public class MemoContent: NSManagedObject { + +} diff --git a/DogPicture/DogPicture/MainView/Entities/MemoContent+CoreDataProperties.swift b/DogPicture/DogPicture/MainView/Entities/MemoContent+CoreDataProperties.swift new file mode 100644 index 0000000..51fda16 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Entities/MemoContent+CoreDataProperties.swift @@ -0,0 +1,27 @@ +// +// MemoContent+CoreDataProperties.swift +// +// +// Created by 김동우 on 2021/06/28. +// +// + +import Foundation +import CoreData + + +extension MemoContent { + + @nonobjc public class func fetchRequest() -> NSFetchRequest { + return NSFetchRequest(entityName: "MemoContent") + } + + + @NSManaged public var title: String? + @NSManaged public var content: String? + @NSManaged public var createAt: Date? +} + +extension MemoContent : Identifiable { + +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeInteracter.swift b/DogPicture/DogPicture/MainView/Home/HomeInteracter.swift new file mode 100644 index 0000000..006ccbc --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeInteracter.swift @@ -0,0 +1,17 @@ +// +// HomeViewInteracter.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +class HomeInteracter: HomeInteracterInputProtocol { + + + weak var presenter: HomeInteracterOutputProtocol? + + func getDogImage() { + let dogImages = Image.shared.getDogImageList() + presenter?.retrivedDogImage(images: dogImages) + } +} diff --git a/DogPicture/DogPicture/MainView/Home/HomePresenter.swift b/DogPicture/DogPicture/MainView/Home/HomePresenter.swift new file mode 100644 index 0000000..136c85c --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomePresenter.swift @@ -0,0 +1,40 @@ +// +// HomeViewPresenter.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// +import Foundation +import UIKit + +class HomePresenter: HomePresenterProtocol { + + weak var view: HomeViewProtocol? + var interacter: HomeInteracterInputProtocol? + var router: HomeRouterProtocol? + + func viewDidLoad() { + interacter?.getDogImage() + } + + func showMemo(for name: String) { + router?.presentMemoScreen(from: view!, forname: name) + } + + func calenderDidTap(tag: Int) { + view?.refershCalender(tag: tag) + } +} + +extension HomePresenter: HomeInteracterOutputProtocol { + func retrivedDogImage(images: [String]) { + view?.showImages(images: images) + } + + func didRetrieveImage(_ images: [String]) { + print(images) + } + + func onError() { + } +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeProtocol.swift b/DogPicture/DogPicture/MainView/Home/HomeProtocol.swift new file mode 100644 index 0000000..0dd45cd --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeProtocol.swift @@ -0,0 +1,41 @@ +// +// HomeViewProtocol.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +import UIKit + +protocol HomeViewProtocol: AnyObject { + var presenter: HomePresenterProtocol? { get set } + + func showImages(images: [String]) + func refershCalender(tag: Int) +} + +protocol HomeRouterProtocol: AnyObject { + static func createHomeModule() -> UIViewController + + func presentMemoScreen(from view: HomeViewProtocol, forname name: String) +} + +protocol HomePresenterProtocol: AnyObject { + var view: HomeViewProtocol? { get set } + var interacter: HomeInteracterInputProtocol? { get set } + var router: HomeRouterProtocol? { get set } + + func viewDidLoad() + func showMemo(for name: String) + func calenderDidTap(tag: Int) +} + +protocol HomeInteracterInputProtocol: AnyObject { + var presenter: HomeInteracterOutputProtocol? { get set } + + func getDogImage() +} + +protocol HomeInteracterOutputProtocol: AnyObject { + func retrivedDogImage(images: [String]) +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeTableViewCell.swift b/DogPicture/DogPicture/MainView/Home/HomeTableViewCell.swift new file mode 100644 index 0000000..b6f8a8e --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeTableViewCell.swift @@ -0,0 +1,51 @@ +// +// HomeTableViewCell.swift +// DogPicture +// +// Created by 김동우 on 2021/09/07. +// + +import UIKit + +class HomeTableViewCell: UITableViewCell { + static let identifier = "HomeCell" + + var cardView = UIView() + var cellImageView = UIImageView() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + contentView.backgroundColor = .orange + attribute() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func attribute() { + [ cardView ].forEach() { contentView.addSubview($0) } + cardView.addSubview(cellImageView) + + cardView.do { + $0.backgroundColor = .systemPink + $0.frame = CGRect(x: 20, + y: 20, + width: 350, + height: 350) + $0.viewRadius(view: cardView, cornerRadius: 30, maskToBounds: true) + $0.viewShadow(view: cardView) + } + layout() + + } + func layout() { + cellImageView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: self.topAnchor).isActive = true + $0.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true + $0.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true + $0.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true + } + } +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeVIewSegmentedHeader.swift b/DogPicture/DogPicture/MainView/Home/HomeVIewSegmentedHeader.swift new file mode 100644 index 0000000..a737f92 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeVIewSegmentedHeader.swift @@ -0,0 +1,106 @@ +// +// HomeVIewSegmentedHeader.swift +// DogPicture +// +// Created by 김동우 on 2021/09/02. +// + +import UIKit + +class HomeViewSegmentedHeader: UITableViewHeaderFooterView { + static let identifier = "SegmentedHeader" + + var segmentedScrollView = UIScrollView() + var segmentedScrollContentView = UIView() + var segmentedStackView = UIStackView() + var segmentedButton: [UIButton] = [] + let segmentedButtonTitles = ["1월", "2월", "3월", "4월", "5월", + "6월", "7월", "8월", "9월", "10월", + "11월", "12월"] + var tagNumber = 0 + var textColor: UIColor = .black + var selectorTextColor: UIColor = .red + + override init(reuseIdentifier: String?) { + super.init(reuseIdentifier: reuseIdentifier) + + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func layoutSubviews() { + super.layoutSubviews() + createViews() + layout() + } + + func createViews() { + self.addSubview(segmentedScrollView) + segmentedScrollView.addSubview(segmentedScrollContentView) + segmentedScrollContentView.addSubview(segmentedStackView) + + segmentedScrollView.do { + $0.backgroundColor = .systemBlue + $0.contentSize = CGSize(width: 840, height: 70) + } + + segmentedStackView.do { + $0.backgroundColor = .systemGreen + $0.axis = .horizontal + $0.alignment = .fill + $0.distribution = .fillEqually + } + for buttonTitles in segmentedButtonTitles { + let button = UIButton(type: .system) + button.do { + $0.tag = tagNumber + $0.setTitle(buttonTitles, for: .normal) + $0.addTarget(self, + action: #selector(segmentLineAnimation(sender:)), + for: .touchUpInside) + $0.setTitleColor(textColor, for: .normal) + } + segmentedStackView.addArrangedSubview(button) + segmentedButton.append(button) + tagNumber += 1 + } + segmentedButton[0].setTitleColor(selectorTextColor, for: .normal) + } + + func layout() { + segmentedScrollView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: self.safeAreaLayoutGuide.topAnchor).isActive = true + $0.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true + $0.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true + $0.heightAnchor.constraint(equalToConstant: 70).isActive = true + } + + segmentedScrollContentView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: segmentedScrollView.topAnchor).isActive = true + $0.leadingAnchor.constraint(equalTo: segmentedScrollView.leadingAnchor).isActive = true + $0.bottomAnchor.constraint(equalTo: segmentedScrollView.frameLayoutGuide.bottomAnchor).isActive = true + $0.widthAnchor.constraint(equalToConstant: segmentedScrollView.contentSize.width).isActive = true + } + + segmentedStackView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: segmentedScrollContentView.topAnchor).isActive = true + $0.leadingAnchor.constraint(equalTo: segmentedScrollContentView.leadingAnchor).isActive = true + $0.widthAnchor.constraint(equalToConstant: CGFloat(segmentedButtonTitles.count*70)).isActive = true + $0.heightAnchor.constraint(equalToConstant: 50).isActive = true + } + } + + @objc func segmentLineAnimation(sender: UIButton) { + for btn in segmentedButton { + btn.setTitleColor(textColor, for: .normal) + if tag == btn.tag { + btn.setTitleColor(selectorTextColor, for: .normal) + } + } + } +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeViewController.swift b/DogPicture/DogPicture/MainView/Home/HomeViewController.swift new file mode 100644 index 0000000..3212c0d --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeViewController.swift @@ -0,0 +1,213 @@ +// +// HomeViewController.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +import UIKit +import Then + +class HomeViewController: UIViewController { + var presenter: HomePresenterProtocol? + + var headerView = UIView() + var mainHeaderView = UIView() + var randomImageView = UIImageView() + var segmentedScrollView = UIScrollView() + var segmentedScrollContentView = UIView() + var segmentedStackView = UIStackView() + var segmentedButton: [UIButton] = [] + let segmentedButtonTitles = ["1월", "2월", "3월", "4월", "5월", + "6월", "7월", "8월", "9월", "10월", + "11월", "12월"] + + var homeTableView = UITableView() + var dogImageHolder: [UIImage] = [] + let models = ["쁘띠1", "쁘띠2", "쁘띠3", "쁘띠4", "쁘띠5", + "쁘띠6", "쁘띠7", "쁘띠8", "쁘띠9", "쁘띠10", + "쁘띠11", "쁘띠12", "쁘띠13", "쁘띠14", "쁘띠15", + "쁘띠16", "쁘띠17", "쁘띠18", "쁘띠19", "쁘띠20", + "쁘띠21", "쁘띠22", "쁘띠23", "쁘띠24", "쁘띠25", + "쁘띠26", "쁘띠27", "쁘띠28", "쁘띠29", "쁘띠30"] + var textColor: UIColor = .black + var selectroViewColor: UIColor = .red + var selectorTextColor: UIColor = .red + + var tagNumber = 0 + + override func viewDidLoad() { + super.viewDidLoad() + presenter?.viewDidLoad() + view.backgroundColor = .white + navigationController?.isNavigationBarHidden = true + updateView() + } + + func updateView() { + attribute() + layout() + } + + func attribute() { + view.addSubview(homeTableView) + headerView.addSubview(segmentedScrollView) + segmentedScrollView.addSubview(segmentedScrollContentView) + segmentedScrollContentView.addSubview(segmentedStackView) + + homeTableView.do { + $0.separatorStyle = .none + $0.dataSource = self + $0.delegate = self + $0.frame = view.bounds + $0.backgroundColor = .systemBlue + $0.register(HomeTableViewCell.self, forCellReuseIdentifier: "HomeCell") + } + + mainHeaderView.do { + $0.backgroundColor = .brown + } + + randomImageView.do { + $0.image = UIImage(named: "p4") + } + + segmentedScrollView.do { + $0.backgroundColor = .systemPink + $0.contentSize = CGSize(width: 840, height: 70) + $0.showsHorizontalScrollIndicator = false + } + + segmentedStackView.do { + $0.backgroundColor = .systemGreen + $0.axis = .horizontal + $0.alignment = .fill + $0.distribution = .fillEqually + } + + for buttonTitles in segmentedButtonTitles { + let button = UIButton(type: .system) + button.do { + $0.tag = tagNumber + $0.setTitle(buttonTitles, for: .normal) + $0.addTarget(self, + action: #selector(segmentLineAnimation(sender:)), + for: .touchUpInside) + $0.setTitleColor(textColor, for: .normal) + } + segmentedStackView.addArrangedSubview(button) + segmentedButton.append(button) + tagNumber += 1 + } + segmentedButton[0].setTitleColor(selectorTextColor, for: .normal) + } + + func layout() { + homeTableView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: view.topAnchor).isActive = true + $0.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + $0.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + $0.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true + } + headerViewLayout() + } + + func headerViewLayout() { + segmentedScrollView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.widthAnchor.constraint(equalToConstant: 390).isActive = true + $0.heightAnchor.constraint(equalToConstant: 70).isActive = true + } + + segmentedScrollContentView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: segmentedScrollView.safeAreaLayoutGuide.topAnchor).isActive = true + $0.leadingAnchor.constraint(equalTo: segmentedScrollView.leadingAnchor).isActive = true + $0.bottomAnchor.constraint(equalTo: segmentedScrollView.frameLayoutGuide.bottomAnchor).isActive = true + $0.widthAnchor.constraint(equalToConstant: segmentedScrollView.contentSize.width).isActive = true + } + + segmentedStackView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: segmentedScrollContentView.topAnchor).isActive = true + $0.leadingAnchor.constraint(equalTo: segmentedScrollContentView.leadingAnchor).isActive = true + $0.widthAnchor.constraint(equalToConstant: CGFloat(segmentedButtonTitles.count*70)).isActive = true + $0.heightAnchor.constraint(equalToConstant: 50).isActive = true + } + } + + @objc func segmentLineAnimation(sender: UIButton) { + presenter?.calenderDidTap(tag: sender.tag) + } +} + +extension HomeViewController: UITableViewDataSource, UITableViewDelegate { + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: HomeTableViewCell.identifier) as! HomeTableViewCell + cell.textLabel?.text = models[indexPath.row] + cell.cellImageView.image = dogImageHolder[indexPath.row] + return cell + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 390 + } + + func numberOfSections(in tableView: UITableView) -> Int { + return 2 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + switch section { + case 0: + return 0 + case 1: + return models.count + default: + return 0 + } + } + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + switch section { + case 0: + return 300 + case 1: + return 70 + default: + return 0 + } + } + + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + switch section { + case 0: + return randomImageView + case 1: + return headerView + default: + return nil + } + } +} + +extension HomeViewController: HomeViewProtocol { + + func showImages(images: [String]) { + for imageName in images { + guard let dogImages = UIImage(named: imageName) else { return } + dogImageHolder.append(dogImages) + } + } + + func refershCalender(tag: Int) { + for btn in segmentedButton { + btn.setTitleColor(textColor, for: .normal) + if tag == btn.tag { + btn.setTitleColor(selectorTextColor, for: .normal) + print(btn.tag) + } + } + } +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeViewRouter.swift b/DogPicture/DogPicture/MainView/Home/HomeViewRouter.swift new file mode 100644 index 0000000..bb55e4c --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeViewRouter.swift @@ -0,0 +1,37 @@ +// +// HomeViewWireFrame.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +import UIKit + +class HomeViewRouter: HomeRouterProtocol { + + class func createHomeModule() -> UIViewController { + if let view: HomeViewProtocol = HomeViewController() as? HomeViewProtocol { + let presenter: HomePresenterProtocol & HomeInteracterOutputProtocol = HomePresenter() + let interacter: HomeInteracterInputProtocol = HomeInteracter() + let router: HomeRouterProtocol = HomeViewRouter() + + view.presenter = presenter + presenter.view = view + presenter.router = router + presenter.interacter = interacter + interacter.presenter = presenter + + if let HomeView = view as? UIViewController { + return HomeView + } + } + return UIViewController() + } + + func presentMemoScreen(from view: HomeViewProtocol, forname name: String) { + let MemoViewController = MemoViewRouter.createMemoViewRouter(from: name) + if let memoView = view as? UIViewController { + memoView.present(MemoViewController, animated: true) + } + } +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeViewStickyHeader.swift b/DogPicture/DogPicture/MainView/Home/HomeViewStickyHeader.swift new file mode 100644 index 0000000..c027000 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeViewStickyHeader.swift @@ -0,0 +1,68 @@ +// +// HomeViewStickyHeader.swift +// DogPicture +// +// Created by 김동우 on 2021/09/02. +// + +import Foundation +import UIKit + +class HomeViewStickyHeaderView: UIView { + static let identifier = "StickyHeader" + + private var containerView = UIView() + private var imageViewHeight = NSLayoutConstraint() + private var imageViewBottom = NSLayoutConstraint() + private var containerViewHeight = NSLayoutConstraint() + + var randomImageView = UIImageView() + + // MARK: - Init + + override init(frame: CGRect) { + super.init(frame: frame) + createViews() + layout() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + } + + func createViews() { + addSubview(containerView) + containerView.addSubview(randomImageView) + + randomImageView.do { + $0.clipsToBounds = true + $0.contentMode = .scaleAspectFill + } + + + } + func layout() { + containerView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.heightAnchor.constraint(equalToConstant: 450).isActive = true + $0.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true + $0.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true + $0.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true + } + randomImageView.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true + $0.heightAnchor.constraint(equalToConstant: 450).isActive = true + $0.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true + $0.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true + } + } + + public func scrollViewDidScroll(scrollView: UIScrollView) { + containerViewHeight.constant = scrollView.contentInset.top + let offsetY = -(scrollView.contentOffset.y + scrollView.contentInset.top) + containerView.clipsToBounds = offsetY <= 0 + imageViewBottom.constant = offsetY >= 0 ? 0 : -offsetY / 2 + imageViewHeight.constant = max(offsetY + scrollView.contentInset.top, scrollView.contentInset.top) + } +} diff --git a/DogPicture/DogPicture/MainView/Home/HomeViewTableHeader.swift b/DogPicture/DogPicture/MainView/Home/HomeViewTableHeader.swift new file mode 100644 index 0000000..728621b --- /dev/null +++ b/DogPicture/DogPicture/MainView/Home/HomeViewTableHeader.swift @@ -0,0 +1,51 @@ +// +// HomeViewHeaderFooter.swift +// DogPicture +// +// Created by 김동우 on 2021/09/02. +// + +import UIKit + +class HomeViewTableHeader: UITableViewHeaderFooterView { + static let indentifier = "TableHeader" + + var randomImageView = UIImageView() + var randomImageLabel = UILabel() + + override func layoutSubviews() { + super.layoutSubviews() + attribute() + self.backgroundColor = .systemPink + } + + func attribute() { + randomImageView.do { + $0.contentMode = .scaleAspectFit + $0.image = UIImage(named: "chu2") // 랜덤 Image 로직 추가예정 + $0.frame = CGRect(x: 0, + y: 0, + width: contentView.frame.size.width, + height: contentView.frame.size.height) + } + randomImageLabel.do { + $0.text = "#이미지뷰#랜덤이미지" // 랜덤 text 로직 추가예정 + $0.font = .systemFont(ofSize: 22, weight: .semibold) + $0.textAlignment = .center + $0.sizeToFit() + $0.frame = CGRect(x: 0, + y: contentView.frame.size.height-10-randomImageLabel.frame.size.height, + width: 100, + height: 50) + } + } + + override init(reuseIdentifier: String?) { + super.init(reuseIdentifier: reuseIdentifier) + [ randomImageView, randomImageLabel ].forEach() { contentView.addSubview($0) } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/DogPicture/DogPicture/MainView/Memo/MemoViewController.swift b/DogPicture/DogPicture/MainView/Memo/MemoViewController.swift new file mode 100644 index 0000000..3546f89 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Memo/MemoViewController.swift @@ -0,0 +1,54 @@ +// +// MemoViewController.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +import UIKit + +class MemoViewController: UIViewController { + var presenter: MemoViewPresenterProtocol? + var chuImage = UIImageView() + let memoNavBar = UINavigationBar() + let memoNavBarItem = UINavigationItem() + + override func viewDidLoad() { + super.viewDidLoad() + presenter?.viewDidLoad() + layout() + attribute() + + } + + func layout() { + memoNavBar.do { + $0.frame = CGRect(x: 0, y: 0, width: view.frame.size.width, height: 44) + } + memoNavBarItem.do { + $0.title = "MemoView" + } + chuImage.do { + $0.frame = view.bounds + } + } + + func attribute() { + [ memoNavBar, chuImage ] .forEach() { view.addSubview($0) } + + chuImage.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20).isActive = true + $0.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20).isActive = true + $0.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true + $0.widthAnchor.constraint(equalToConstant: 100).isActive = true + $0.heightAnchor.constraint(equalToConstant: 200).isActive = true + } + } +} + +extension MemoViewController: MemoViewProtocol { + func showMemoView(forImage name: String) { + chuImage.image = UIImage(named: name) + } +} diff --git a/DogPicture/DogPicture/MainView/Memo/MemoViewInteracter.swift b/DogPicture/DogPicture/MainView/Memo/MemoViewInteracter.swift new file mode 100644 index 0000000..b963e2b --- /dev/null +++ b/DogPicture/DogPicture/MainView/Memo/MemoViewInteracter.swift @@ -0,0 +1,57 @@ +// +// MemoViewInteracter.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +import UIKit +import CoreData + +class MemoViewInteracter: MemoViewInteracterInputProtocol { + weak var presenter: MemoViewInteracterOutputProtocol? + + let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext + + // CoreData + + func getAllItems() { + do { +// let items = try context.fetch(MemoContent.fetchRequest()) + } + catch { + // error + } + } + + +} + +extension MemoViewInteracter: MemoViewInteracterOutputProtocol { + func createItem(title: String, content: String) { +// let newItem = MemoContent(context: context) +// newItem.content = content +// newItem.title = title +// newItem.createAt = Date() + do { + try context.save() + } + catch { + + } + } + + + +// func updateItem(item: MemoContent, newTitle: String) { +// item.title = newTitle +// do { +// try context.save() +// } +// catch { +// +// } +// } + + +} diff --git a/DogPicture/DogPicture/MainView/Memo/MemoViewPresenter.swift b/DogPicture/DogPicture/MainView/Memo/MemoViewPresenter.swift new file mode 100644 index 0000000..b744236 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Memo/MemoViewPresenter.swift @@ -0,0 +1,21 @@ +// +// MemoViewPresenter.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +class MemoViewPresenter: MemoViewPresenterProtocol { + weak var view: MemoViewProtocol? + var interacter: MemoViewInteracterInputProtocol? + var router: MemoViewRouterProtocol? + var name: String? + + func viewDidLoad() { + view?.showMemoView(forImage: name ?? "") + } +} + +extension MemoViewPresenter: MemoViewInteracterOutputProtocol { + +} diff --git a/DogPicture/DogPicture/MainView/Memo/MemoViewProtocol.swift b/DogPicture/DogPicture/MainView/Memo/MemoViewProtocol.swift new file mode 100644 index 0000000..471d2c6 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Memo/MemoViewProtocol.swift @@ -0,0 +1,39 @@ +// +// MemoViewProtocol.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +import UIKit + +protocol MemoViewProtocol: AnyObject { + var presenter: MemoViewPresenterProtocol? { get set } + + // PRESENTER -> VIEW + func showMemoView(forImage name: String) +} + +protocol MemoViewRouterProtocol: AnyObject { + static func createMemoViewRouter(from post: String) -> UIViewController +} + +protocol MemoViewPresenterProtocol: AnyObject { + var view: MemoViewProtocol? { get set } + var interacter: MemoViewInteracterInputProtocol? { get set } + var router: MemoViewRouterProtocol? { get set } + var name: String? { get set } + + // VIEW -> PRESENTER + func viewDidLoad() + +} + +protocol MemoViewInteracterInputProtocol: AnyObject { + var presenter: MemoViewInteracterOutputProtocol? { get set } + func getAllItems() +} + +protocol MemoViewInteracterOutputProtocol: AnyObject { + +} diff --git a/DogPicture/DogPicture/MainView/Memo/MemoViewRouter.swift b/DogPicture/DogPicture/MainView/Memo/MemoViewRouter.swift new file mode 100644 index 0000000..9a95808 --- /dev/null +++ b/DogPicture/DogPicture/MainView/Memo/MemoViewRouter.swift @@ -0,0 +1,32 @@ +// +// MemoViewRouter.swift +// DogPicture +// +// Created by 김동우 on 2021/05/28. +// + +import UIKit + +class MemoViewRouter: MemoViewRouterProtocol { + static func createMemoViewRouter(from name: String) -> UIViewController { + if let view: MemoViewProtocol = MemoViewController() as? MemoViewProtocol { + let presenter: MemoViewPresenterProtocol & MemoViewInteracterOutputProtocol = MemoViewPresenter() + let router: MemoViewRouterProtocol = MemoViewRouter() + let interacter: MemoViewInteracterInputProtocol = MemoViewInteracter() + + view.presenter = presenter + presenter.view = view + presenter.name = name + presenter.router = router + presenter.interacter = interacter + interacter.presenter = presenter + + + if let MemoView = view as? UIViewController { + return MemoView + } + } + return UIViewController() + } + +} diff --git a/DogPicture/DogPicture/SceneDelegate.swift b/DogPicture/DogPicture/SceneDelegate.swift index 7b7e618..9c136b7 100644 --- a/DogPicture/DogPicture/SceneDelegate.swift +++ b/DogPicture/DogPicture/SceneDelegate.swift @@ -13,10 +13,21 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { 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 } + /// 1. Capture the scene if there is one into a variable + guard let windowScene = (scene as? UIWindowScene) else { return } + + /// 2. Create a new UIWindow using the windowScene constructor which takes in a window scene + let window = UIWindow(windowScene: windowScene) + + /// 3. Create your view hierachy programmatically + let viewController = TabViewController() + + /// 4. Set the root view controller of the window with your view controller + window.rootViewController = viewController + + /// 5. Set the window and make it keyAndVisible + self.window = window + window.makeKeyAndVisible() } func sceneDidDisconnect(_ scene: UIScene) { @@ -49,7 +60,4 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // Save changes in the application's managed object context when the application transitions to the background. (UIApplication.shared.delegate as? AppDelegate)?.saveContext() } - - } - diff --git a/DogPicture/DogPicture/Setting/SettingInteracter.swift b/DogPicture/DogPicture/Setting/SettingInteracter.swift new file mode 100644 index 0000000..a94aa3d --- /dev/null +++ b/DogPicture/DogPicture/Setting/SettingInteracter.swift @@ -0,0 +1,8 @@ +// +// SettingInteracter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import Foundation diff --git a/DogPicture/DogPicture/Setting/SettingPresenter.swift b/DogPicture/DogPicture/Setting/SettingPresenter.swift new file mode 100644 index 0000000..ea2ddba --- /dev/null +++ b/DogPicture/DogPicture/Setting/SettingPresenter.swift @@ -0,0 +1,8 @@ +// +// SettingPresenter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import Foundation diff --git a/DogPicture/DogPicture/Setting/SettingProtocol.swift b/DogPicture/DogPicture/Setting/SettingProtocol.swift new file mode 100644 index 0000000..ea10e0b --- /dev/null +++ b/DogPicture/DogPicture/Setting/SettingProtocol.swift @@ -0,0 +1,10 @@ +// +// SettingProtocol.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import Foundation + + diff --git a/DogPicture/DogPicture/Setting/SettingRouter.swift b/DogPicture/DogPicture/Setting/SettingRouter.swift new file mode 100644 index 0000000..6231077 --- /dev/null +++ b/DogPicture/DogPicture/Setting/SettingRouter.swift @@ -0,0 +1,8 @@ +// +// SettingRouter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import Foundation diff --git a/DogPicture/DogPicture/Setting/SettingViewController.swift b/DogPicture/DogPicture/Setting/SettingViewController.swift new file mode 100644 index 0000000..ffe2d7c --- /dev/null +++ b/DogPicture/DogPicture/Setting/SettingViewController.swift @@ -0,0 +1,23 @@ +// +// SettingViewController.swift +// DogPicture +// +// Created by 김동우 on 2021/06/25. +// + +import UIKit + +class SettingViewController: UIViewController { + + let house = UIButton() + + override func viewDidLoad() { + super.viewDidLoad() + self.title = "Tab_Setting" + self.view.backgroundColor = .white + } + + func attribute() { + } + +} diff --git a/DogPicture/DogPicture/TabBar/MenuModuleBuilder.swift b/DogPicture/DogPicture/TabBar/MenuModuleBuilder.swift new file mode 100644 index 0000000..7964507 --- /dev/null +++ b/DogPicture/DogPicture/TabBar/MenuModuleBuilder.swift @@ -0,0 +1,14 @@ +// +// MenuModuleBuilder.swift +// DogPicture +// +// Created by 김동우 on 2021/06/30. +// + +import UIKit + +class MenuModuleBuilder { + static func build() -> UITabBarController { + fatalError() + } +} diff --git a/DogPicture/DogPicture/TabBar/MenuViewInteracter.swift b/DogPicture/DogPicture/TabBar/MenuViewInteracter.swift new file mode 100644 index 0000000..ea0d62d --- /dev/null +++ b/DogPicture/DogPicture/TabBar/MenuViewInteracter.swift @@ -0,0 +1,11 @@ +// +// MenuViewInteracter.swift +// DogPicture +// +// Created by 김동우 on 2021/07/14. +// + +class MenuViewInteracter: MenuViewInteracterInputProtocol { + + weak var presenter: MenuViewInteracterOutputProtocol? +} diff --git a/DogPicture/DogPicture/TabBar/MenuViewPresenter.swift b/DogPicture/DogPicture/TabBar/MenuViewPresenter.swift new file mode 100644 index 0000000..0578001 --- /dev/null +++ b/DogPicture/DogPicture/TabBar/MenuViewPresenter.swift @@ -0,0 +1,19 @@ +// +// MenuPresenter.swift +// DogPicture +// +// Created by 김동우 on 2021/07/13. +// + +import Foundation + +class MenuViewPresenter: MenuViewPresenterProtocol { + weak var view: MenuViewProtocol? + var interacter: MenuViewInteracterInputProtocol? + var router: MenuViewRouterProtocol? + +} + +extension MenuViewPresenter: MenuViewInteracterOutputProtocol { + +} diff --git a/DogPicture/DogPicture/TabBar/MenuViewProtocol.swift b/DogPicture/DogPicture/TabBar/MenuViewProtocol.swift new file mode 100644 index 0000000..5afa8e7 --- /dev/null +++ b/DogPicture/DogPicture/TabBar/MenuViewProtocol.swift @@ -0,0 +1,31 @@ +// +// MenuProtocol.swift +// DogPicture +// +// Created by 김동우 on 2021/06/30. +// + +import UIKit + +protocol MenuViewProtocol: AnyObject { + var presenter: MenuViewPresenterProtocol? { get set } +} + +protocol MenuViewRouterProtocol: AnyObject { + static func createMenuModule() -> UIViewController +} + +protocol MenuViewPresenterProtocol: AnyObject { + var view: MenuViewProtocol? { get set } + var interacter: MenuViewInteracterInputProtocol? { get set } + var router: MenuViewRouterProtocol? { get set } + +} + +protocol MenuViewInteracterInputProtocol: AnyObject { + var presenter: MenuViewInteracterOutputProtocol? { get set } +} + +protocol MenuViewInteracterOutputProtocol: AnyObject { + +} diff --git a/DogPicture/DogPicture/TabBar/MenuViewRouter.swift b/DogPicture/DogPicture/TabBar/MenuViewRouter.swift new file mode 100644 index 0000000..eaed807 --- /dev/null +++ b/DogPicture/DogPicture/TabBar/MenuViewRouter.swift @@ -0,0 +1,28 @@ +// +// MenuRouter.swift +// DogPicture +// +// Created by 김동우 on 2021/06/30. +// + +import UIKit + +class MenuViewRouter: MenuViewRouterProtocol { + class func createMenuModule() -> UIViewController { + if let view: MenuViewProtocol = MenuViewController() as? MenuViewProtocol { + let presenter: MenuViewPresenterProtocol & MenuViewInteracterOutputProtocol = MenuViewPresenter() + let interacter: MenuViewInteracterInputProtocol = MenuViewInteracter() + let router: MenuViewRouterProtocol = MenuViewRouter() + + view.presenter = presenter + presenter.view = view + presenter.router = router + interacter.presenter = presenter + + if let MenuView = view as? UIViewController { + return MenuView + } + } + return UIViewController() + } +} diff --git a/DogPicture/DogPicture/TabBar/TabViewController.swift b/DogPicture/DogPicture/TabBar/TabViewController.swift new file mode 100644 index 0000000..1acd1f9 --- /dev/null +++ b/DogPicture/DogPicture/TabBar/TabViewController.swift @@ -0,0 +1,397 @@ +// +// MenuViewController.swift +// DogPicture +// +// Created by 김동우 on 2021/06/30. +// + +import UIKit + +class TabViewController: UITabBarController { + let centerView = UIView() + let centerButton = UIButton() + let homeButton = UIButton() + let cameraButton = UIButton() + let libraryButton = UIButton() + let settingButton = UIButton() + let writeButton = UIButton() + + var isCenterButtonExpanded: Bool = false + var isAnimationRan: Bool = false + let person = UIViewController() + + override func viewDidLoad() { + super.viewDidLoad() + self.tabBar.isHidden = true + createCustomTabBarController() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + createTabBarItemsAttribute() + createTabItem() + } + + func createCustomTabBarController() { + self.createCustomTabBarItem(btn: self.homeButton, title: "첫번째 버튼", tag: 0) + self.createCustomTabBarItem(btn: self.cameraButton, title: "두번째 버튼", tag: 1) + self.createCustomTabBarItem(btn: self.settingButton, title: "세번째 버튼", tag: 2) + } + + func createCustomTabBarItem(btn: UIButton, title: String, tag: Int) { + btn.tag = tag + btn.setTitleColor(.white, for: .normal) + btn.setTitleColor(.yellow, for: .selected) + btn.addTarget(self, action: #selector(onTabBarItemClick(_:)), for: .touchUpInside) + } + + func createTabItem() { + guard let tabHomeImage = UIImage(systemName: "house"), + let tabHomeSelectedImage = UIImage(systemName: "house.fill"), + let tabCameraImage = UIImage(systemName: "camera"), + let tabCameraSelectedImage = UIImage(systemName: "camera.fill"), + let tabPersonImage = UIImage(systemName: "person"), + let tabPersonSelectedImage = UIImage(systemName: "person.fill"), + let tabSettingImage = UIImage(systemName: "gearshape"), + let tabSettingSelectedIamge = UIImage(systemName: "gearshape.fill") else { return } + + let tabHome = generateNavigationControllerAndTabBarController(vc: HomeViewRouter.createHomeModule(), + title: "Tab_Home", + image: tabHomeImage, + selectedImage: tabHomeSelectedImage) + let tabCamera = generateNavigationControllerAndTabBarController(vc: CameraRouter.createCameraModule(), + title: "Tab_Camera", + image: tabCameraImage, + selectedImage: tabCameraSelectedImage) + let tabPerson = generateNavigationControllerAndTabBarController(vc: person, + title: "PersonView", + image: tabPersonImage, + selectedImage: tabPersonSelectedImage) + let tabSetting = generateNavigationControllerAndTabBarController(vc: SettingViewController(), + title: "SettingView", + image: tabSettingImage, + selectedImage: tabSettingSelectedIamge) + + self.setViewControllers([tabHome, tabCamera, tabPerson, tabSetting], animated: false) + } + + func createTabBarItemsAttribute() { + + [ centerView, centerButton, homeButton, cameraButton, libraryButton, settingButton ] + .forEach() { view.addSubview($0) } + + centerView.do { + $0.backgroundColor = .darkGray + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: (UIScreen.main.bounds.maxX*(70/390))/2, maskToBounds: false) + $0.viewShadow(view: $0) + $0.frame = CGRect(x: UIScreen.main.bounds.maxX*(160/390), + y: UIScreen.main.bounds.maxY*(9/10), + width: UIScreen.main.bounds.maxX*(70/390), + height: UIScreen.main.bounds.maxY*(70/844)) + } + centerButton.do { + $0.setImage(UIImage(systemName: "plus"), for: .normal) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: (UIScreen.main.bounds.maxX*(70/390))/2, maskToBounds: false) + $0.viewShadow(view: $0) + $0.addTarget(self, action: #selector(self.centerButtonDipTap), for: .touchUpInside) + $0.frame = CGRect(x: UIScreen.main.bounds.maxX*(160/390), + y: UIScreen.main.bounds.maxY*(9/10), + width: UIScreen.main.bounds.maxX*(70/390), + height: UIScreen.main.bounds.maxY*(70/844)) + $0.imageView?.contentMode = .scaleAspectFit + $0.imageEdgeInsets = UIEdgeInsets(top: UIScreen.main.bounds.maxX*(60/390), + left: UIScreen.main.bounds.maxX*(60/390), + bottom: UIScreen.main.bounds.maxX*(60/390), + right: UIScreen.main.bounds.maxX*(60/390)) + } + homeButton.do { + $0.setImage(UIImage(systemName: "house"), for: .normal) + $0.setImage(UIImage(systemName: "house.fill"), for: .selected) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: (UIScreen.main.bounds.maxX*(55/390))/2, maskToBounds: false) + $0.viewShadow(view: $0) + $0.alpha = 0.0 + $0.isHidden = true + $0.frame = CGRect(x: UIScreen.main.bounds.maxX*(30/390), + y: UIScreen.main.bounds.maxY*(9.1/10), + width: UIScreen.main.bounds.maxX*(55/390), + height: UIScreen.main.bounds.maxY*(55/844)) + $0.imageView?.contentMode = .scaleAspectFit + $0.imageEdgeInsets = UIEdgeInsets(top: UIScreen.main.bounds.maxX*(45/390), + left: UIScreen.main.bounds.maxX*(45/390), + bottom: UIScreen.main.bounds.maxX*(45/390), + right: UIScreen.main.bounds.maxX*(45/390)) + } + cameraButton.do { + $0.setImage(UIImage(systemName: "camera"), for: .normal) + $0.setImage(UIImage(systemName: "camera.fill"), for: .selected) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: (UIScreen.main.bounds.maxX*(55/390))/2, maskToBounds: false) + $0.viewShadow(view: $0) + $0.alpha = 0.0 + $0.isHidden = true + $0.frame = CGRect(x: UIScreen.main.bounds.maxX*(93.75/390), + y: UIScreen.main.bounds.maxY*(9.1/10), + width: UIScreen.main.bounds.maxX*(55/390), + height: UIScreen.main.bounds.maxY*(55/844)) + $0.imageView?.contentMode = .scaleAspectFit + $0.imageEdgeInsets = UIEdgeInsets(top: UIScreen.main.bounds.maxX*(45/390), + left: UIScreen.main.bounds.maxX*(45/390), + bottom: UIScreen.main.bounds.maxX*(45/390), + right: UIScreen.main.bounds.maxX*(45/390)) + } + libraryButton.do { + $0.setImage(UIImage(systemName: "rectangle.3.offgrid"), for: .normal) + $0.setImage(UIImage(systemName: "rectangle.3.offgrid.fill"), for: .selected) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: (UIScreen.main.bounds.maxX*(55/390))/2, maskToBounds: false) + $0.viewShadow(view: $0) + $0.alpha = 0.0 + $0.isHidden = true + $0.frame = CGRect(x: UIScreen.main.bounds.maxX*(236.25/390), + y: UIScreen.main.bounds.maxY*(9.1/10), + width: UIScreen.main.bounds.maxX*(55/390), + height: UIScreen.main.bounds.maxY*(55/844)) + $0.imageView?.contentMode = .scaleAspectFit + $0.imageEdgeInsets = UIEdgeInsets(top: UIScreen.main.bounds.maxX*(45/390), + left: UIScreen.main.bounds.maxX*(45/390), + bottom: UIScreen.main.bounds.maxX*(45/390), + right: UIScreen.main.bounds.maxX*(45/390)) + } + settingButton.do { + $0.setImage(UIImage(systemName: "gearshape"), for: .normal) + $0.setImage(UIImage(systemName: "gearshape.fill"), for: .selected) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: (UIScreen.main.bounds.maxX*(55/390))/2, maskToBounds: false) + $0.viewShadow(view: $0) + $0.alpha = 0.0 + $0.isHidden = true + $0.frame = CGRect(x: UIScreen.main.bounds.maxX*(305/390), + y: UIScreen.main.bounds.maxY*(9.1/10), + width: UIScreen.main.bounds.maxX*(55/390), + height: UIScreen.main.bounds.maxY*(55/844)) + $0.imageView?.contentMode = .scaleAspectFit + $0.imageEdgeInsets = UIEdgeInsets(top: UIScreen.main.bounds.maxX*(45/390), + left: UIScreen.main.bounds.maxX*(45/390), + bottom: UIScreen.main.bounds.maxX*(45/390), + right: UIScreen.main.bounds.maxX*(45/390)) + } + } + + fileprivate func generateNavigationControllerAndTabBarController(vc: UIViewController, + title: String, + image: UIImage, + selectedImage: UIImage) -> UINavigationController { + let item = UITabBarItem(title: title, image: image, selectedImage: selectedImage) + let navigationController = UINavigationController(rootViewController: vc) + navigationController.title = title + navigationController.tabBarItem.image = image + navigationController.tabBarItem.selectedImage = selectedImage + navigationController.tabBarItem.image?.withTintColor(.white) + vc.navigationItem.title = title + vc.tabBarItem = item + return navigationController + } + + @objc func onTabBarItemClick(_ sender: UIButton) { + homeButton.isSelected = false + cameraButton.isSelected = false + settingButton.isSelected = false + sender.isSelected = true + animateCenterButtonRotatedAndSmallerAnimation(view: centerView, button: centerButton) + selectedIndex = sender.tag + homeButton.isHidden = true + cameraButton.isHidden = true + libraryButton.isHidden = true + settingButton.isHidden = true + homeButton.alpha = 0.0 + cameraButton.alpha = 0.0 + libraryButton.alpha = 0.0 + settingButton.alpha = 0.0 + centerView.isUserInteractionEnabled = true + view.isUserInteractionEnabled = true + isCenterButtonExpanded = false + } + + @objc func centerButtonDipTap(sender: UIButton) { + centerView.isUserInteractionEnabled = false + view.isUserInteractionEnabled = false + + if (isCenterButtonExpanded == false) { + view.isUserInteractionEnabled = true + animateCenterTabViewShakeWhenCenterTabViewExpanded(view: self.centerView) + animationThatRotatingCenterButtonWhenCenterViewExpands(button: centerButton) + animateSpinAndShakeTabBarItemWhenTabViewExpanded(button: homeButton) + animateSpinAndShakeTabBarItemWhenTabViewExpanded(button: cameraButton) + animateSpinAndShakeTabBarItemWhenTabViewExpanded(button: libraryButton) + animateSpinAndShakeTabBarItemWhenTabViewExpanded(button: settingButton) + homeButton.isHidden = false + cameraButton.isHidden = false + libraryButton.isHidden = false + settingButton.isHidden = false + isCenterButtonExpanded = true + } else { + animateCenterButtonRotatedAndSmallerAnimation(view: centerView, button: centerButton) + homeButton.isHidden = true + cameraButton.isHidden = true + libraryButton.isHidden = true + settingButton.isHidden = true + homeButton.alpha = 0.0 + cameraButton.alpha = 0.0 + libraryButton.alpha = 0.0 + settingButton.alpha = 0.0 + view.isUserInteractionEnabled = true + isCenterButtonExpanded = false + } + } +} + +extension TabViewController { + + func animationThatRotatingCenterButtonWhenCenterViewExpands(button: UIButton) { + UIView.animateKeyframes(withDuration: 0.9, delay: 0.1, options: [], animations: { + UIView.addKeyframe(withRelativeStartTime: 0.0, relativeDuration: 0.25) { + button.transform = CGAffineTransform(rotationAngle: (180.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.25, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: -((270.0 * .pi) / 180)) + } + UIView.addKeyframe(withRelativeStartTime: 0.35, relativeDuration: 0.15) { + button.transform = CGAffineTransform(rotationAngle: -(360.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: -(405.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.60, relativeDuration: 0.15) { + button.transform = CGAffineTransform(rotationAngle: -(395.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.75, relativeDuration: 0.125) { + button.transform = CGAffineTransform(rotationAngle: -(408.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.775, relativeDuration: 0.05) { + button.transform = CGAffineTransform(rotationAngle: -(405.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.9, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: -(405.0 * .pi) / 180) + } + }) + } + + func animateCenterButtonRotatedAndSmallerAnimation(view: UIView, button: UIButton) { + UIView.animate(withDuration: 0.5, + delay: 0, + usingSpringWithDamping: 1, + initialSpringVelocity: 1, + options: .curveEaseInOut, + animations: { + view.frame = CGRect(x: UIScreen.main.bounds.maxX*(160/390), + y: UIScreen.main.bounds.maxY*(9/10), + width: UIScreen.main.bounds.maxX*(70/390), + height: UIScreen.main.bounds.maxY*(70/844)) + UIView.animateKeyframes(withDuration: 1, delay: 0.1, options: [], animations: { + UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 0.6) { + button.transform = CGAffineTransform.identity + } + UIView.addKeyframe(withRelativeStartTime: 0.60, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: (5.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.7, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: -(5.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.8, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: (3.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.9, relativeDuration: 0.1) { + button.transform = CGAffineTransform.identity + } + }) + }) + } + + func animateCenterTabViewShakeWhenCenterTabViewExpanded(view: UIView) { + UIView.animateKeyframes(withDuration: 1, delay: 0, options: [], animations: { + UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 0.2, animations: { + view.frame = CGRect(x: UIScreen.main.bounds.maxX*(5/390), + y: UIScreen.main.bounds.maxY*(9/10), + width: UIScreen.main.bounds.maxX*(380/390), + height: UIScreen.main.bounds.maxY*(70/844)) + + }) + UIView.addKeyframe(withRelativeStartTime: 0.2, relativeDuration: 0.3, animations: { + view.frame = CGRect(x: UIScreen.main.bounds.maxX*(12.5/390), + y: UIScreen.main.bounds.maxY*(9/10), + width: UIScreen.main.bounds.maxX*(365/390), + height: UIScreen.main.bounds.maxY*(70/844)) + }) + UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.3, animations: { + view.frame = CGRect(x: UIScreen.main.bounds.maxX*(8/390), + y: UIScreen.main.bounds.maxY*(9/10), + width: UIScreen.main.bounds.maxX*(374/390), + height: UIScreen.main.bounds.maxY*(70/844)) + }) + UIView.addKeyframe(withRelativeStartTime: 0.8, relativeDuration: 0.3, animations: { + view.frame = CGRect(x: UIScreen.main.bounds.maxX*(10/390), + y: UIScreen.main.bounds.maxY*(9/10), + width: UIScreen.main.bounds.maxX*(370/390), + height: UIScreen.main.bounds.maxY*(70/844)) + }) + }) + } + + func animateSpinAndShakeTabBarItemWhenTabViewExpanded(button: UIButton) { + UIView.animateKeyframes(withDuration: 0.9, delay: 0.15, options: [], animations: { + UIView.addKeyframe(withRelativeStartTime: 0.0, relativeDuration: 0.25) { + button.transform = CGAffineTransform(rotationAngle: (180.0 * .pi) / 180) + button.alpha = 0.7 + } + UIView.addKeyframe(withRelativeStartTime: 0.25, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: -((270.0 * .pi) / 180)) + button.alpha = 0.8 + } + UIView.addKeyframe(withRelativeStartTime: 0.35, relativeDuration: 0.15) { + button.transform = CGAffineTransform(rotationAngle: -(360.0 * .pi) / 180) + button.alpha = 0.9 + } + UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.1) { + button.transform = CGAffineTransform(rotationAngle: -(370.0 * .pi) / 180) + button.alpha = 1.0 + } + UIView.addKeyframe(withRelativeStartTime: 0.60, relativeDuration: 0.15) { + button.transform = CGAffineTransform(rotationAngle: -(350.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.75, relativeDuration: 0.125) { + button.transform = CGAffineTransform(rotationAngle: -(363.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.775, relativeDuration: 0.05) { + button.transform = CGAffineTransform(rotationAngle: -(360.0 * .pi) / 180) + } + UIView.addKeyframe(withRelativeStartTime: 0.9, relativeDuration: 0.1) { + button.transform = CGAffineTransform.identity + } + }) + } + + func animationWhenRollingTabBarItemFromLeftside(button: UIButton) { + + } + + func animationWhenRollingTabBarItemFromLightside(button: UIButton) { + + } +} + + +extension UIView { + func viewRadius(view: UIView, cornerRadius: CGFloat, maskToBounds: Bool) { + view.layer.cornerRadius = cornerRadius + view.layer.masksToBounds = maskToBounds + } + func viewShadow(view: UIView) { + view.layer.shadowColor = UIColor.black.cgColor + view.layer.shadowOffset = CGSize(width: 1, height: 1) + view.layer.shadowRadius = 3 + view.layer.shadowOpacity = 0.5 + } +} diff --git a/DogPicture/DogPicture/TabBar/TabViewControllerCopy.swift b/DogPicture/DogPicture/TabBar/TabViewControllerCopy.swift new file mode 100644 index 0000000..0d31963 --- /dev/null +++ b/DogPicture/DogPicture/TabBar/TabViewControllerCopy.swift @@ -0,0 +1,240 @@ +// +// MenuViewController.swift +// DogPicture +// +// Created by 김동우 on 2021/06/30. +// + +import UIKit + +class TabViewControllerCopy: UITabBarController { + let centerButton = UIButton() + let cameraButton = UIButton() + let libraryButton = UIButton() + var centerButtonExpanded: Bool = true + let person = UIViewController() + + override func viewDidLoad() { + super.viewDidLoad() + self.delegate = self + //여기서 centerButton layout 잡아주고 + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + setupTabBarStyle() + createTabBarItemsAttribute() + createTabBarItemsLayout() + createTabItem() + } + + override func viewDidAppear(_ animated: Bool) { + //centerButton으로부터 좌표 가져와서 라이브러리 찍어주는거 + } + + func setupTabBarStyle() { + self.tabBar.do { + $0.itemPositioning = .fill + $0.itemWidth = 10 + $0.barTintColor = UIColor.black + $0.barStyle = .default + $0.isTranslucent = true + $0.tintColor = UIColor.cyan + $0.unselectedItemTintColor = .white + + $0.viewRadius(view: $0, cornerRadius: 30, maskToBounds: true) + $0.viewShadow(view: $0) + } + } + + func createTabItem() { + guard let tabHomeImage = UIImage(systemName: "house"), + let tabHomeSelectedImage = UIImage(systemName: "house.fill"), + let tabCameraImage = UIImage(systemName: "camera"), + let tabCameraSelectedImage = UIImage(systemName: "camera.fill"), + let tabPersonImage = UIImage(systemName: "person"), + let tabPersonSelectedImage = UIImage(systemName: "person.fill"), + let tabSettingImage = UIImage(systemName: "gearshape"), + let tabSettingSelectedIamge = UIImage(systemName: "gearshape.fill") else { + return + } + + let tabHome = generateNavigationControllerAndTabBarController(vc: HomeViewRouter.createHomeModule(), + title: "Tab_Home", + image: tabHomeImage, + selectedImage: tabHomeSelectedImage) + let tabCamera = generateNavigationControllerAndTabBarController(vc: CameraRouter.createCameraModule(), + title: "Tab_Camera", + image: tabCameraImage, + selectedImage: tabCameraSelectedImage) + let tabPerson = generateNavigationControllerAndTabBarController(vc: person, + title: "PersonView", + image: tabPersonImage, + selectedImage: tabPersonSelectedImage) + let tabSetting = generateNavigationControllerAndTabBarController(vc: SettingViewController(), + title: "SettingView", + image: tabSettingImage, + selectedImage: tabSettingSelectedIamge) + + UINavigationBar.appearance().prefersLargeTitles = true + + tabCamera.tabBarItem.titlePositionAdjustment.horizontal = -20 + tabPerson.tabBarItem.titlePositionAdjustment.horizontal = 20 + + self.setViewControllers([tabHome, tabCamera, tabPerson, tabSetting], animated: false) + } + + func createTabBarItemsAttribute() { + // view.bringSubviewToFront(centerButton) + centerButton.do { + $0.backgroundColor = .darkGray + $0.setImage(UIImage(systemName: "plus"), for: .normal) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: 30, maskToBounds: false) + $0.viewShadow(view: $0) + // $0.bringSubviewToFront(view) + $0.addTarget(self, action: #selector(self.centerButtonDipTap), for: .touchUpInside) + } + cameraButton.do { + $0.backgroundColor = .lightGray + $0.setImage(UIImage(systemName: "camera"), for: .normal) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: 27.5, maskToBounds: false) + $0.viewShadow(view: $0) + $0.isHidden = true + } + libraryButton.do { + $0.backgroundColor = .lightGray + $0.setImage(UIImage(systemName: "rectangle.on.rectangle"), for: .normal) + $0.tintColor = .white + $0.viewRadius(view: $0, cornerRadius: 27.5, maskToBounds: false) + $0.viewShadow(view: $0) + $0.isHidden = true + } + } + + func createTabBarItemsLayout() { + [ centerButton, cameraButton, libraryButton ].forEach() { view.addSubview($0) } + + centerButton.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.widthAnchor.constraint(equalToConstant: 60).isActive = true + $0.heightAnchor.constraint(equalToConstant: 60).isActive = true + $0.centerXAnchor.constraint(equalTo: tabBar.centerXAnchor).isActive = true + $0.centerYAnchor.constraint(equalTo: tabBar.topAnchor).isActive = true + } + cameraButton.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.widthAnchor.constraint(equalToConstant: 55).isActive = true + $0.heightAnchor.constraint(equalToConstant: 55).isActive = true + $0.centerXAnchor.constraint(equalTo: centerButton.centerXAnchor).isActive = true + $0.centerYAnchor.constraint(equalTo: centerButton.centerYAnchor).isActive = true + } + libraryButton.do { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.widthAnchor.constraint(equalToConstant: 55).isActive = true + $0.heightAnchor.constraint(equalToConstant: 55).isActive = true + $0.centerXAnchor.constraint(equalTo: centerButton.centerXAnchor).isActive = true + $0.centerYAnchor.constraint(equalTo: centerButton.centerYAnchor).isActive = true + } + } + + fileprivate func generateNavigationControllerAndTabBarController(vc: UIViewController, + title: String, + image: UIImage, + selectedImage: UIImage) -> UINavigationController { + + let item = UITabBarItem(title: title, image: image, selectedImage: selectedImage) + let navigationController = UINavigationController(rootViewController: vc) + navigationController.title = title + navigationController.tabBarItem.image = image + navigationController.tabBarItem.selectedImage = selectedImage + navigationController.tabBarItem.image?.withTintColor(.white) + vc.navigationItem.title = title + vc.tabBarItem = item + return navigationController + } + + @objc func centerButtonDipTap(sender: UIButton) { + centerButton.isUserInteractionEnabled = false + if (centerButtonExpanded == true) { + UIView.animate(withDuration: 2, + delay: 0, + usingSpringWithDamping: 1, + initialSpringVelocity: 1, + options: .curveEaseInOut, + animations: { + self.cameraButton.alpha = 1 + self.cameraButton.isHidden = false + self.cameraButton.frame = CGRect(x: self.view.bounds.width/3, + y: self.view.bounds.height/1.24, + width: 55, height: 55) + }) { _ in + self.centerButton.isUserInteractionEnabled = true + } + let screenWidth = UIScreen.main.bounds.width + UIView.animate(withDuration: 2, + delay: 0, + usingSpringWithDamping: 1, + initialSpringVelocity: 1, + options: .curveEaseInOut, + animations: { + self.libraryButton.alpha = 1 + self.libraryButton.isHidden = false + self.libraryButton.frame = CGRect(x: self.view.bounds.width/1.9, + y: self.view.bounds.height/1.24, + width: DogPicture.convertWidth(screenWidth), + height: DogPicture.convertWidth(screenWidth)) + // 싱글턴 + // (singleton) + }) { [weak self] _ in + guard let self = self else { + return + } + self.centerButton.isUserInteractionEnabled = true + } + centerButton.setImage(UIImage(systemName: "xmark"), for: .normal) + centerButtonExpanded = false + } else { + UIView.animate(withDuration: 2, + delay: 0, + usingSpringWithDamping: 1, + initialSpringVelocity: 1, + options: .curveEaseInOut, + animations: { + self.cameraButton.alpha = 0 + self.cameraButton.center = self.centerButton.center + }) { [weak self] _ in + guard let self = self else { + return + } + self.cameraButton.isHidden = true + self.centerButton.isUserInteractionEnabled = true + } + UIView.animate(withDuration: 2, + delay: 0, + usingSpringWithDamping: 1, + initialSpringVelocity: 1, + options: .curveEaseInOut, + animations: { + self.libraryButton.alpha = 0 + self.libraryButton.center = self.centerButton.center + }) { [weak self] _ in + guard let self = self else { + return + } + self.libraryButton.isHidden = true + self.centerButton.isUserInteractionEnabled = true + } + centerButton.setImage(UIImage(systemName: "plus"), for: .normal) + centerButtonExpanded = true + } + } +} + +extension TabViewControllerCopy: UITabBarControllerDelegate { + func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { + + } +} + diff --git a/DogPicture/DogPicture/ViewController.swift b/DogPicture/DogPicture/ViewController.swift index 1ee33e2..5dd0a34 100644 --- a/DogPicture/DogPicture/ViewController.swift +++ b/DogPicture/DogPicture/ViewController.swift @@ -13,7 +13,10 @@ class ViewController: UIViewController { super.viewDidLoad() // Do any additional setup after loading the view. } - + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } } diff --git a/DogPicture/Podfile.lock b/DogPicture/Podfile.lock new file mode 100644 index 0000000..97175bb --- /dev/null +++ b/DogPicture/Podfile.lock @@ -0,0 +1,28 @@ +PODS: + - Alamofire (5.4.3) + - SnapKit (5.0.1) + - SwiftLint (0.43.1) + - Then (2.7.0) + +DEPENDENCIES: + - Alamofire + - SnapKit + - SwiftLint + - Then + +SPEC REPOS: + trunk: + - Alamofire + - SnapKit + - SwiftLint + - Then + +SPEC CHECKSUMS: + Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9 + SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb + SwiftLint: 99f82d07b837b942dd563c668de129a03fc3fb52 + Then: acfe0be7e98221c6204e12f8161459606d5d822d + +PODFILE CHECKSUM: 1b8999f5bf269c4f538639f05c698fac335786c8 + +COCOAPODS: 1.10.1