diff --git a/.DS_Store b/.DS_Store index df014fa..e190083 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/KH/.DS_Store b/KH/.DS_Store index ba184d0..ee8f71a 100644 Binary files a/KH/.DS_Store and b/KH/.DS_Store differ diff --git a/KH/PR1_ToDoList_Use_AlertController/.DS_Store b/KH/PR1_ToDoList_Use_AlertController/.DS_Store index 1561e34..21a6d0e 100644 Binary files a/KH/PR1_ToDoList_Use_AlertController/.DS_Store and b/KH/PR1_ToDoList_Use_AlertController/.DS_Store differ diff --git a/KH/PR2_LightInstagram/.DS_Store b/KH/PR2_LightInstagram/.DS_Store deleted file mode 100644 index 64c6efb..0000000 Binary files a/KH/PR2_LightInstagram/.DS_Store and /dev/null differ diff --git a/KH/PR2_LightInstagram/LightInstagram/.DS_Store b/KH/PR2_LightInstagram/LightInstagram/.DS_Store deleted file mode 100644 index 087a996..0000000 Binary files a/KH/PR2_LightInstagram/LightInstagram/.DS_Store and /dev/null differ diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.pbxproj b/KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.pbxproj deleted file mode 100644 index 2d40c5f..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.pbxproj +++ /dev/null @@ -1,652 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 55; - objects = { - -/* Begin PBXBuildFile section */ - F59EDB8E285D94930068E5CD /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = F59EDB8D285D94930068E5CD /* SnapKit */; }; - FD0B73C6283A993F00B6B7E8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD0B73C5283A993F00B6B7E8 /* AppDelegate.swift */; }; - FD0B73C8283A993F00B6B7E8 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD0B73C7283A993F00B6B7E8 /* SceneDelegate.swift */; }; - FD0B73CA283A993F00B6B7E8 /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD0B73C9283A993F00B6B7E8 /* FeedViewController.swift */; }; - FD0B73D0283A993F00B6B7E8 /* LightInstagram.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = FD0B73CE283A993F00B6B7E8 /* LightInstagram.xcdatamodeld */; }; - FD0B73D2283A993F00B6B7E8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FD0B73D1283A993F00B6B7E8 /* Assets.xcassets */; }; - FD0B73E0283A993F00B6B7E8 /* LightInstagramTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD0B73DF283A993F00B6B7E8 /* LightInstagramTests.swift */; }; - FD0B73EA283A993F00B6B7E8 /* LightInstagramUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD0B73E9283A993F00B6B7E8 /* LightInstagramUITests.swift */; }; - FD0B73EC283A993F00B6B7E8 /* LightInstagramUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD0B73EB283A993F00B6B7E8 /* LightInstagramUITestsLaunchTests.swift */; }; - FD689814283B401D003D434C /* UserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD689813283B401D003D434C /* UserViewController.swift */; }; - FD689816283B4031003D434C /* AddEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD689815283B4031003D434C /* AddEditViewController.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - FD0B73DC283A993F00B6B7E8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = FD0B73BA283A993F00B6B7E8 /* Project object */; - proxyType = 1; - remoteGlobalIDString = FD0B73C1283A993F00B6B7E8; - remoteInfo = LightInstagram; - }; - FD0B73E6283A993F00B6B7E8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = FD0B73BA283A993F00B6B7E8 /* Project object */; - proxyType = 1; - remoteGlobalIDString = FD0B73C1283A993F00B6B7E8; - remoteInfo = LightInstagram; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - FD0B73C2283A993F00B6B7E8 /* LightInstagram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LightInstagram.app; sourceTree = BUILT_PRODUCTS_DIR; }; - FD0B73C5283A993F00B6B7E8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - FD0B73C7283A993F00B6B7E8 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - FD0B73C9283A993F00B6B7E8 /* FeedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = ""; }; - FD0B73CF283A993F00B6B7E8 /* LightInstagram.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = LightInstagram.xcdatamodel; sourceTree = ""; }; - FD0B73D1283A993F00B6B7E8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - FD0B73D6283A993F00B6B7E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - FD0B73DB283A993F00B6B7E8 /* LightInstagramTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LightInstagramTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - FD0B73DF283A993F00B6B7E8 /* LightInstagramTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightInstagramTests.swift; sourceTree = ""; }; - FD0B73E5283A993F00B6B7E8 /* LightInstagramUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LightInstagramUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - FD0B73E9283A993F00B6B7E8 /* LightInstagramUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightInstagramUITests.swift; sourceTree = ""; }; - FD0B73EB283A993F00B6B7E8 /* LightInstagramUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightInstagramUITestsLaunchTests.swift; sourceTree = ""; }; - FD61B3E2283AA1E200B1C141 /* SnapKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = SnapKit.xcframework; path = Carthage/Build/SnapKit.xcframework; sourceTree = ""; }; - FD689813283B401D003D434C /* UserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserViewController.swift; sourceTree = ""; }; - FD689815283B4031003D434C /* AddEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddEditViewController.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - FD0B73BF283A993F00B6B7E8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F59EDB8E285D94930068E5CD /* SnapKit in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FD0B73D8283A993F00B6B7E8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FD0B73E2283A993F00B6B7E8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - FD0B73B9283A993F00B6B7E8 = { - isa = PBXGroup; - children = ( - FD0B73C4283A993F00B6B7E8 /* LightInstagram */, - FD0B73DE283A993F00B6B7E8 /* LightInstagramTests */, - FD0B73E8283A993F00B6B7E8 /* LightInstagramUITests */, - FD0B73C3283A993F00B6B7E8 /* Products */, - FD61B3E1283AA1E200B1C141 /* Frameworks */, - ); - sourceTree = ""; - }; - FD0B73C3283A993F00B6B7E8 /* Products */ = { - isa = PBXGroup; - children = ( - FD0B73C2283A993F00B6B7E8 /* LightInstagram.app */, - FD0B73DB283A993F00B6B7E8 /* LightInstagramTests.xctest */, - FD0B73E5283A993F00B6B7E8 /* LightInstagramUITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - FD0B73C4283A993F00B6B7E8 /* LightInstagram */ = { - isa = PBXGroup; - children = ( - FD0B73C5283A993F00B6B7E8 /* AppDelegate.swift */, - FD0B73C7283A993F00B6B7E8 /* SceneDelegate.swift */, - FD0B73D1283A993F00B6B7E8 /* Assets.xcassets */, - FD0B73D6283A993F00B6B7E8 /* Info.plist */, - FD68980F283B36CF003D434C /* Model */, - FD689810283B36D6003D434C /* ViewCon */, - ); - path = LightInstagram; - sourceTree = ""; - }; - FD0B73DE283A993F00B6B7E8 /* LightInstagramTests */ = { - isa = PBXGroup; - children = ( - FD0B73DF283A993F00B6B7E8 /* LightInstagramTests.swift */, - ); - path = LightInstagramTests; - sourceTree = ""; - }; - FD0B73E8283A993F00B6B7E8 /* LightInstagramUITests */ = { - isa = PBXGroup; - children = ( - FD0B73E9283A993F00B6B7E8 /* LightInstagramUITests.swift */, - FD0B73EB283A993F00B6B7E8 /* LightInstagramUITestsLaunchTests.swift */, - ); - path = LightInstagramUITests; - sourceTree = ""; - }; - FD61B3E1283AA1E200B1C141 /* Frameworks */ = { - isa = PBXGroup; - children = ( - FD61B3E2283AA1E200B1C141 /* SnapKit.xcframework */, - ); - name = Frameworks; - sourceTree = ""; - }; - FD68980F283B36CF003D434C /* Model */ = { - isa = PBXGroup; - children = ( - FD0B73CE283A993F00B6B7E8 /* LightInstagram.xcdatamodeld */, - ); - path = Model; - sourceTree = ""; - }; - FD689810283B36D6003D434C /* ViewCon */ = { - isa = PBXGroup; - children = ( - FD0B73C9283A993F00B6B7E8 /* FeedViewController.swift */, - FD689813283B401D003D434C /* UserViewController.swift */, - FD689815283B4031003D434C /* AddEditViewController.swift */, - ); - path = ViewCon; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - FD0B73C1283A993F00B6B7E8 /* LightInstagram */ = { - isa = PBXNativeTarget; - buildConfigurationList = FD0B73EF283A993F00B6B7E8 /* Build configuration list for PBXNativeTarget "LightInstagram" */; - buildPhases = ( - FD0B73BE283A993F00B6B7E8 /* Sources */, - FD0B73BF283A993F00B6B7E8 /* Frameworks */, - FD0B73C0283A993F00B6B7E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = LightInstagram; - packageProductDependencies = ( - F59EDB8D285D94930068E5CD /* SnapKit */, - ); - productName = LightInstagram; - productReference = FD0B73C2283A993F00B6B7E8 /* LightInstagram.app */; - productType = "com.apple.product-type.application"; - }; - FD0B73DA283A993F00B6B7E8 /* LightInstagramTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = FD0B73F2283A993F00B6B7E8 /* Build configuration list for PBXNativeTarget "LightInstagramTests" */; - buildPhases = ( - FD0B73D7283A993F00B6B7E8 /* Sources */, - FD0B73D8283A993F00B6B7E8 /* Frameworks */, - FD0B73D9283A993F00B6B7E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - FD0B73DD283A993F00B6B7E8 /* PBXTargetDependency */, - ); - name = LightInstagramTests; - productName = LightInstagramTests; - productReference = FD0B73DB283A993F00B6B7E8 /* LightInstagramTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - FD0B73E4283A993F00B6B7E8 /* LightInstagramUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = FD0B73F5283A993F00B6B7E8 /* Build configuration list for PBXNativeTarget "LightInstagramUITests" */; - buildPhases = ( - FD0B73E1283A993F00B6B7E8 /* Sources */, - FD0B73E2283A993F00B6B7E8 /* Frameworks */, - FD0B73E3283A993F00B6B7E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - FD0B73E7283A993F00B6B7E8 /* PBXTargetDependency */, - ); - name = LightInstagramUITests; - productName = LightInstagramUITests; - productReference = FD0B73E5283A993F00B6B7E8 /* LightInstagramUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - FD0B73BA283A993F00B6B7E8 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1330; - LastUpgradeCheck = 1330; - TargetAttributes = { - FD0B73C1283A993F00B6B7E8 = { - CreatedOnToolsVersion = 13.3; - }; - FD0B73DA283A993F00B6B7E8 = { - CreatedOnToolsVersion = 13.3; - TestTargetID = FD0B73C1283A993F00B6B7E8; - }; - FD0B73E4283A993F00B6B7E8 = { - CreatedOnToolsVersion = 13.3; - TestTargetID = FD0B73C1283A993F00B6B7E8; - }; - }; - }; - buildConfigurationList = FD0B73BD283A993F00B6B7E8 /* Build configuration list for PBXProject "LightInstagram" */; - compatibilityVersion = "Xcode 13.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = FD0B73B9283A993F00B6B7E8; - packageReferences = ( - F59EDB8C285D94930068E5CD /* XCRemoteSwiftPackageReference "SnapKit" */, - ); - productRefGroup = FD0B73C3283A993F00B6B7E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - FD0B73C1283A993F00B6B7E8 /* LightInstagram */, - FD0B73DA283A993F00B6B7E8 /* LightInstagramTests */, - FD0B73E4283A993F00B6B7E8 /* LightInstagramUITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - FD0B73C0283A993F00B6B7E8 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FD0B73D2283A993F00B6B7E8 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FD0B73D9283A993F00B6B7E8 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FD0B73E3283A993F00B6B7E8 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - FD0B73BE283A993F00B6B7E8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FD0B73CA283A993F00B6B7E8 /* FeedViewController.swift in Sources */, - FD689816283B4031003D434C /* AddEditViewController.swift in Sources */, - FD689814283B401D003D434C /* UserViewController.swift in Sources */, - FD0B73D0283A993F00B6B7E8 /* LightInstagram.xcdatamodeld in Sources */, - FD0B73C6283A993F00B6B7E8 /* AppDelegate.swift in Sources */, - FD0B73C8283A993F00B6B7E8 /* SceneDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FD0B73D7283A993F00B6B7E8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FD0B73E0283A993F00B6B7E8 /* LightInstagramTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FD0B73E1283A993F00B6B7E8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FD0B73EC283A993F00B6B7E8 /* LightInstagramUITestsLaunchTests.swift in Sources */, - FD0B73EA283A993F00B6B7E8 /* LightInstagramUITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - FD0B73DD283A993F00B6B7E8 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = FD0B73C1283A993F00B6B7E8 /* LightInstagram */; - targetProxy = FD0B73DC283A993F00B6B7E8 /* PBXContainerItemProxy */; - }; - FD0B73E7283A993F00B6B7E8 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = FD0B73C1283A993F00B6B7E8 /* LightInstagram */; - targetProxy = FD0B73E6283A993F00B6B7E8 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - FD0B73ED283A993F00B6B7E8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - FD0B73EE283A993F00B6B7E8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - FD0B73F0283A993F00B6B7E8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ZMXTCSPNUZ; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = LightInstagram/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightInstagram; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - FD0B73F1283A993F00B6B7E8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ZMXTCSPNUZ; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = LightInstagram/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightInstagram; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - FD0B73F3283A993F00B6B7E8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightInstagramTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LightInstagram.app/LightInstagram"; - }; - name = Debug; - }; - FD0B73F4283A993F00B6B7E8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightInstagramTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LightInstagram.app/LightInstagram"; - }; - name = Release; - }; - FD0B73F6283A993F00B6B7E8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightInstagramUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = LightInstagram; - }; - name = Debug; - }; - FD0B73F7283A993F00B6B7E8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightInstagramUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = LightInstagram; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - FD0B73BD283A993F00B6B7E8 /* Build configuration list for PBXProject "LightInstagram" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FD0B73ED283A993F00B6B7E8 /* Debug */, - FD0B73EE283A993F00B6B7E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - FD0B73EF283A993F00B6B7E8 /* Build configuration list for PBXNativeTarget "LightInstagram" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FD0B73F0283A993F00B6B7E8 /* Debug */, - FD0B73F1283A993F00B6B7E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - FD0B73F2283A993F00B6B7E8 /* Build configuration list for PBXNativeTarget "LightInstagramTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FD0B73F3283A993F00B6B7E8 /* Debug */, - FD0B73F4283A993F00B6B7E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - FD0B73F5283A993F00B6B7E8 /* Build configuration list for PBXNativeTarget "LightInstagramUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FD0B73F6283A993F00B6B7E8 /* Debug */, - FD0B73F7283A993F00B6B7E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - F59EDB8C285D94930068E5CD /* XCRemoteSwiftPackageReference "SnapKit" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/SnapKit/SnapKit.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 5.0.0; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - F59EDB8D285D94930068E5CD /* SnapKit */ = { - isa = XCSwiftPackageProductDependency; - package = F59EDB8C285D94930068E5CD /* XCRemoteSwiftPackageReference "SnapKit" */; - productName = SnapKit; - }; -/* End XCSwiftPackageProductDependency section */ - -/* Begin XCVersionGroup section */ - FD0B73CE283A993F00B6B7E8 /* LightInstagram.xcdatamodeld */ = { - isa = XCVersionGroup; - children = ( - FD0B73CF283A993F00B6B7E8 /* LightInstagram.xcdatamodel */, - ); - currentVersion = FD0B73CF283A993F00B6B7E8 /* LightInstagram.xcdatamodel */; - path = LightInstagram.xcdatamodeld; - sourceTree = ""; - versionGroupType = wrapper.xcdatamodel; - }; -/* End XCVersionGroup section */ - }; - rootObject = FD0B73BA283A993F00B6B7E8 /* Project object */; -} diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/AppDelegate.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/AppDelegate.swift deleted file mode 100644 index 48b547d..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/AppDelegate.swift +++ /dev/null @@ -1,81 +0,0 @@ -// -// AppDelegate.swift -// LightInstagram -// -// Created by ROLF J. on 2022/05/23. -// - -import UIKit -import CoreData - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } - - // MARK: - Core Data stack - - lazy var persistentContainer: NSPersistentContainer = { - /* - The persistent container for the application. This implementation - creates and returns a container, having loaded the store for the - application to it. This property is optional since there are legitimate - error conditions that could cause the creation of the store to fail. - */ - let container = NSPersistentContainer(name: "LightInstagram") - container.loadPersistentStores(completionHandler: { (storeDescription, error) in - if let error = error as NSError? { - // Replace this implementation with code to handle the error appropriately. - // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. - - /* - Typical reasons for an error here include: - * The parent directory does not exist, cannot be created, or disallows writing. - * The persistent store is not accessible, due to permissions or data protection when the device is locked. - * The device is out of space. - * The store could not be migrated to the current model version. - Check the error message to determine what the actual problem was. - */ - fatalError("Unresolved error \(error), \(error.userInfo)") - } - }) - return container - }() - - // MARK: - Core Data Saving support - - func saveContext () { - let context = persistentContainer.viewContext - if context.hasChanges { - do { - try context.save() - } catch { - // Replace this implementation with code to handle the error appropriately. - // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. - let nserror = error as NSError - fatalError("Unresolved error \(nserror), \(nserror.userInfo)") - } - } - } - -} - diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/.DS_Store b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/.DS_Store deleted file mode 100644 index 2c4d817..0000000 Binary files a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/.DS_Store and /dev/null differ diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/FeedCell.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/FeedCell.swift deleted file mode 100644 index d61150a..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/FeedCell.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// FeedCell.swift -// LightInstagram -// -// Created by ROLF J. on 2022/05/23. -// - -import Foundation -import UIKit - -struct feedCell { - var feedUserImage = UIImage() // userImage - var feedUserName = String?.self // 맨 위 userImage 우측, 아래 textField 우측 - - var feedImage = UIImage() // feedImage - - var feedLike = UILabel() // Rand()명이 좋아합니다. - var feedTitle = UILabel() // feed에 적을 글 - - var feedUploadTime = UILabel() // date() 함수로 출력 -} diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/LightInstagram.xcdatamodeld/.xccurrentversion b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/LightInstagram.xcdatamodeld/.xccurrentversion deleted file mode 100644 index 516fe38..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/LightInstagram.xcdatamodeld/.xccurrentversion +++ /dev/null @@ -1,16 +0,0 @@ - - - - - SchemeUserState - - Instagram_Light.xcscheme_^#shared#^_ - - orderHint - 0 - - - _XCCurrentVersionName - LightInstagram.xcdatamodel - - diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/LightInstagram.xcdatamodeld/LightInstagram.xcdatamodel/contents b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/LightInstagram.xcdatamodeld/LightInstagram.xcdatamodel/contents deleted file mode 100644 index b6e103f..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Model/LightInstagram.xcdatamodeld/LightInstagram.xcdatamodel/contents +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/SceneDelegate.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/SceneDelegate.swift deleted file mode 100644 index 17f04bd..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/SceneDelegate.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// SceneDelegate.swift -// LightInstagram -// -// Created by ROLF J. on 2022/05/23. -// - -import UIKit - -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - - var window: UIWindow? - - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let windowScene = (scene as? UIWindowScene) else { return } - window = UIWindow(windowScene: windowScene) - let mainViewController = FeedViewController() - - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() - } - - func sceneDidDisconnect(_ scene: UIScene) { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). - } - - func sceneDidBecomeActive(_ scene: UIScene) { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. - } - - func sceneWillResignActive(_ scene: UIScene) { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). - } - - func sceneWillEnterForeground(_ scene: UIScene) { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. - } - - func sceneDidEnterBackground(_ scene: UIScene) { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. - - // 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/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/AddEditViewController.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/AddEditViewController.swift deleted file mode 100644 index a2c170a..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/AddEditViewController.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// AddEditViewController.swift -// LightInstagram -// -// Created by ROLF J. on 2022/05/23. -// - -import UIKit -import SnapKit - -class AddEditViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - - - } -} diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/FeedViewController.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/FeedViewController.swift deleted file mode 100644 index 65aef95..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/FeedViewController.swift +++ /dev/null @@ -1,115 +0,0 @@ -// -// ViewController.swift -// LightInstagram -// -// Created by ROLF J. on 2022/05/23. -// - -import UIKit -import SnapKit - -class FeedViewController: UIViewController { - - // Main 화면 피드를 보여줄 TableView - let feedTableView = UITableView() - - // 하단에 들어갈 버튼 선언 - var mainFeedButton = UIButton() - var feedAddButton = UIButton() - var userProfileButton = UIButton() - - override func viewDidLoad() { - super.viewDidLoad() - - // Main 화면 배경색 설정 - view.backgroundColor = .white - - // Main 화면(피드 화면)의 제목(TextLabel) - let userViewTitle = UILabel() - userViewTitle.text = " Lightstagram" - userViewTitle.backgroundColor = .orange - self.view.addSubview(userViewTitle) - userViewTitle.font = UIFont.boldSystemFont(ofSize: 30.0) - userViewTitle.snp.makeConstraints { make in - make.width.left.equalTo(self.view) - make.height.equalTo(70) - make.top.equalTo(self.view).offset(40) - } - - // 모든 화면에 들어갈 하단부 Navigation Bar, 버튼이 들어갈 공간의 Background color 지정 - let naviButtonBar = UIView() - self.view.addSubview(naviButtonBar) - naviButtonBar.backgroundColor = .lightGray - naviButtonBar.snp.makeConstraints { make in - make.width.bottom.equalTo(self.view) - make.height.equalTo(100) - } - - // feed들을 보여줄 tableView 공간 설정 - self.view.addSubview(feedTableView) - feedTableView.backgroundColor = .gray - feedTableView.snp.makeConstraints { make in - make.width.equalTo(self.view) - make.top.equalTo(userViewTitle.snp.bottom) - make.bottom.equalTo(naviButtonBar.snp.top) - } - - // mainFeedButton - mainFeedButton.backgroundColor = .blue - self.view.addSubview(mainFeedButton) - mainFeedButton.snp.makeConstraints { make in - make.left.equalTo(self.view).offset(60) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - - // feedAddButton - feedAddButton.backgroundColor = .red - self.view.addSubview(feedAddButton) - feedAddButton.snp.makeConstraints { make in - make.centerX.equalTo(self.view) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - - // tab to move feed Add/Edit View - - - // userProfileButton - userProfileButton.backgroundColor = .green - self.view.addSubview(userProfileButton) - userProfileButton.snp.makeConstraints { make in - make.right.equalTo(self.view).offset(-60) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - - - // Main 화면의 FeedCell 위치 설정 -// let LSFeedCell - -// let userImage = UIImage() -// self.view.addSubview(userImage) -// userImage.snp.makeConstraints { (make) in -// make.top.equalTo(userViewTitle).offset(30) -// } - - } -} - -//extension FeedViewController: UITableViewDelegate { -// -//} -// -//extension FeedViewController: UITableViewDataSource { -// func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { -// } -// -// func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { -// } -// -// -//} diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/UserViewController.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/UserViewController.swift deleted file mode 100644 index b691dd3..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/ViewCon/UserViewController.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// UserViewController.swift -// LightInstagram -// -// Created by ROLF J. on 2022/05/23. -// - -import UIKit -import SnapKit - -class UserViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - - - } -} diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagramTests/LightInstagramTests.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagramTests/LightInstagramTests.swift deleted file mode 100644 index e10caf7..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagramTests/LightInstagramTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// LightInstagramTests.swift -// LightInstagramTests -// -// Created by ROLF J. on 2022/05/23. -// - -import XCTest -@testable import LightInstagram - -class LightInstagramTests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - // Any test you write for XCTest can be annotated as throws and async. - // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. - // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. - } - - func testPerformanceExample() throws { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagramUITests/LightInstagramUITests.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagramUITests/LightInstagramUITests.swift deleted file mode 100644 index df9ee3c..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagramUITests/LightInstagramUITests.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// LightInstagramUITests.swift -// LightInstagramUITests -// -// Created by ROLF J. on 2022/05/23. -// - -import XCTest - -class LightInstagramUITests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // UI tests must launch the application that they test. - let app = XCUIApplication() - app.launch() - - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testLaunchPerformance() throws { - if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { - // This measures how long it takes to launch your application. - measure(metrics: [XCTApplicationLaunchMetric()]) { - XCUIApplication().launch() - } - } - } -} diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagramUITests/LightInstagramUITestsLaunchTests.swift b/KH/PR2_LightInstagram/LightInstagram/LightInstagramUITests/LightInstagramUITestsLaunchTests.swift deleted file mode 100644 index b24a08c..0000000 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagramUITests/LightInstagramUITestsLaunchTests.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// LightInstagramUITestsLaunchTests.swift -// LightInstagramUITests -// -// Created by ROLF J. on 2022/05/23. -// - -import XCTest - -class LightInstagramUITestsLaunchTests: XCTestCase { - - override class var runsForEachTargetApplicationUIConfiguration: Bool { - true - } - - override func setUpWithError() throws { - continueAfterFailure = false - } - - func testLaunch() throws { - let app = XCUIApplication() - app.launch() - - // Insert steps here to perform after app launch but before taking a screenshot, - // such as logging into a test account or navigating somewhere in the app - - let attachment = XCTAttachment(screenshot: app.screenshot()) - attachment.name = "Launch Screen" - attachment.lifetime = .keepAlways - add(attachment) - } -} diff --git a/KH/PR2_Lightstagram/.DS_Store b/KH/PR2_Lightstagram/.DS_Store index f9a9fe8..5f1ec0e 100644 Binary files a/KH/PR2_Lightstagram/.DS_Store and b/KH/PR2_Lightstagram/.DS_Store differ diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.pbxproj b/KH/PR2_Lightstagram/LightStagram.xcodeproj/project.pbxproj similarity index 51% rename from KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.pbxproj rename to KH/PR2_Lightstagram/LightStagram.xcodeproj/project.pbxproj index 3c42eff..ac8099b 100644 --- a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.pbxproj +++ b/KH/PR2_Lightstagram/LightStagram.xcodeproj/project.pbxproj @@ -7,152 +7,161 @@ objects = { /* Begin PBXBuildFile section */ - FD3F10DA2858B334001E2D8A /* lightstagramModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = FD3F10D82858B334001E2D8A /* lightstagramModel.xcdatamodeld */; }; - FD3F10F22858D119001E2D8A /* userProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD3F10F12858D119001E2D8A /* userProfileViewController.swift */; }; - FDA707F32858556C00C64790 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA707F22858556C00C64790 /* AppDelegate.swift */; }; - FDA707F52858556C00C64790 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA707F42858556C00C64790 /* SceneDelegate.swift */; }; - FDA707F72858556C00C64790 /* mainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA707F62858556C00C64790 /* mainViewController.swift */; }; - FDA707FF2858556D00C64790 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FDA707FE2858556D00C64790 /* Assets.xcassets */; }; - FDA708022858556D00C64790 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDA708002858556D00C64790 /* LaunchScreen.storyboard */; }; - FDA7080B2858606300C64790 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = FDA7080A2858606300C64790 /* SnapKit */; }; - FDA7080E285883B400C64790 /* addEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA7080D285883B400C64790 /* addEditViewController.swift */; }; - FDF572882859805F00400483 /* IMG_3117.JPG in Resources */ = {isa = PBXBuildFile; fileRef = FDF572872859805F00400483 /* IMG_3117.JPG */; }; - FDF5728E28598C8200400483 /* FeedModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF5728D28598C8200400483 /* FeedModel.swift */; }; - FDF5729128599F4800400483 /* Feed+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF5728F28599F4800400483 /* Feed+CoreDataClass.swift */; }; - FDF5729228599F4800400483 /* Feed+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF5729028599F4800400483 /* Feed+CoreDataProperties.swift */; }; - FDF572942859D39800400483 /* newFeedTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF572932859D39800400483 /* newFeedTableViewCell.swift */; }; + FD5B9F8C2864F2220056205E /* Feed+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD5B9F8A2864F2220056205E /* Feed+CoreDataClass.swift */; }; + FD5B9F8D2864F2220056205E /* Feed+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD5B9F8B2864F2220056205E /* Feed+CoreDataProperties.swift */; }; + FD5B9F8F28659F340056205E /* UserProfileViewCollectionCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD5B9F8E28659F340056205E /* UserProfileViewCollectionCustomCell.swift */; }; + FDBA213F2862014E004DD205 /* MainViewTableViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDBA213E2862014E004DD205 /* MainViewTableViewModel.swift */; }; + FDBA2141286201E0004DD205 /* UserProfileViewCollectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDBA2140286201E0004DD205 /* UserProfileViewCollectionViewModel.swift */; }; + FDBA214328620324004DD205 /* MainViewTableCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDBA214228620324004DD205 /* MainViewTableCustomCell.swift */; }; + FDC1D3302863659D00D46D7C /* CoreDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC1D32F2863659D00D46D7C /* CoreDataManager.swift */; }; + FDF139E82860B9F900C542E0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF139E72860B9F900C542E0 /* AppDelegate.swift */; }; + FDF139EA2860B9F900C542E0 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF139E92860B9F900C542E0 /* SceneDelegate.swift */; }; + FDF139EC2860B9F900C542E0 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF139EB2860B9F900C542E0 /* MainViewController.swift */; }; + FDF139F22860B9F900C542E0 /* LightStagram.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = FDF139F02860B9F900C542E0 /* LightStagram.xcdatamodeld */; }; + FDF139F42860B9FA00C542E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FDF139F32860B9FA00C542E0 /* Assets.xcassets */; }; + FDF139F72860B9FA00C542E0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDF139F52860B9FA00C542E0 /* LaunchScreen.storyboard */; }; + FDF13A022860BAAB00C542E0 /* AddEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF13A012860BAAB00C542E0 /* AddEditViewController.swift */; }; + FDF13A042860BAB200C542E0 /* UserProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF13A032860BAB200C542E0 /* UserProfileViewController.swift */; }; + FDF13A072860BB7D00C542E0 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = FDF13A062860BB7D00C542E0 /* SnapKit */; }; + FDF13A0A2860BEA800C542E0 /* WindowTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF13A092860BEA800C542E0 /* WindowTabBarViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - FD3F10D92858B334001E2D8A /* lightstagramModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = lightstagramModel.xcdatamodel; sourceTree = ""; }; - FD3F10F12858D119001E2D8A /* userProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = userProfileViewController.swift; sourceTree = ""; }; - FDA707EF2858556C00C64790 /* PR2_Lightstagram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PR2_Lightstagram.app; sourceTree = BUILT_PRODUCTS_DIR; }; - FDA707F22858556C00C64790 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - FDA707F42858556C00C64790 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - FDA707F62858556C00C64790 /* mainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = mainViewController.swift; sourceTree = ""; }; - FDA707FE2858556D00C64790 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - FDA708012858556D00C64790 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - FDA708032858556D00C64790 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - FDA7080D285883B400C64790 /* addEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = addEditViewController.swift; sourceTree = ""; }; - FDF572872859805F00400483 /* IMG_3117.JPG */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = IMG_3117.JPG; sourceTree = ""; }; - FDF5728D28598C8200400483 /* FeedModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedModel.swift; sourceTree = ""; }; - FDF5728F28599F4800400483 /* Feed+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Feed+CoreDataClass.swift"; sourceTree = SOURCE_ROOT; }; - FDF5729028599F4800400483 /* Feed+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Feed+CoreDataProperties.swift"; sourceTree = SOURCE_ROOT; }; - FDF572932859D39800400483 /* newFeedTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = newFeedTableViewCell.swift; sourceTree = ""; }; + FD5B9F8A2864F2220056205E /* Feed+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Feed+CoreDataClass.swift"; sourceTree = ""; }; + FD5B9F8B2864F2220056205E /* Feed+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Feed+CoreDataProperties.swift"; sourceTree = ""; }; + FD5B9F8E28659F340056205E /* UserProfileViewCollectionCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileViewCollectionCustomCell.swift; sourceTree = ""; }; + FDBA213E2862014E004DD205 /* MainViewTableViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewTableViewModel.swift; sourceTree = ""; }; + FDBA2140286201E0004DD205 /* UserProfileViewCollectionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileViewCollectionViewModel.swift; sourceTree = ""; }; + FDBA214228620324004DD205 /* MainViewTableCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewTableCustomCell.swift; sourceTree = ""; }; + FDC1D32F2863659D00D46D7C /* CoreDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataManager.swift; sourceTree = ""; }; + FDF139E42860B9F900C542E0 /* LightStagram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LightStagram.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDF139E72860B9F900C542E0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FDF139E92860B9F900C542E0 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + FDF139EB2860B9F900C542E0 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; + FDF139F12860B9F900C542E0 /* LightStagram.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = LightStagram.xcdatamodel; sourceTree = ""; }; + FDF139F32860B9FA00C542E0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FDF139F62860B9FA00C542E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FDF139F82860B9FA00C542E0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FDF13A012860BAAB00C542E0 /* AddEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddEditViewController.swift; sourceTree = ""; }; + FDF13A032860BAB200C542E0 /* UserProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileViewController.swift; sourceTree = ""; }; + FDF13A092860BEA800C542E0 /* WindowTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowTabBarViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - FDA707EC2858556C00C64790 /* Frameworks */ = { + FDF139E12860B9F900C542E0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FDA7080B2858606300C64790 /* SnapKit in Frameworks */, + FDF13A072860BB7D00C542E0 /* SnapKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - FD3F10D72858B313001E2D8A /* Model */ = { + FDF139DB2860B9F900C542E0 = { isa = PBXGroup; children = ( - FD3F10D82858B334001E2D8A /* lightstagramModel.xcdatamodeld */, - FDF5728F28599F4800400483 /* Feed+CoreDataClass.swift */, - FDF5729028599F4800400483 /* Feed+CoreDataProperties.swift */, - FDF5728D28598C8200400483 /* FeedModel.swift */, - FDF572932859D39800400483 /* newFeedTableViewCell.swift */, + FDF139E62860B9F900C542E0 /* LightStagram */, + FDF139E52860B9F900C542E0 /* Products */, ); - path = Model; sourceTree = ""; }; - FDA707E62858556C00C64790 = { + FDF139E52860B9F900C542E0 /* Products */ = { isa = PBXGroup; children = ( - FDA707F12858556C00C64790 /* PR2_Lightstagram */, - FDA707F02858556C00C64790 /* Products */, + FDF139E42860B9F900C542E0 /* LightStagram.app */, ); + name = Products; sourceTree = ""; }; - FDA707F02858556C00C64790 /* Products */ = { + FDF139E62860B9F900C542E0 /* LightStagram */ = { isa = PBXGroup; children = ( - FDA707EF2858556C00C64790 /* PR2_Lightstagram.app */, + FDF139E72860B9F900C542E0 /* AppDelegate.swift */, + FDF139E92860B9F900C542E0 /* SceneDelegate.swift */, + FDF139F32860B9FA00C542E0 /* Assets.xcassets */, + FDF139F52860B9FA00C542E0 /* LaunchScreen.storyboard */, + FDF139F82860B9FA00C542E0 /* Info.plist */, + FDF13A002860BA7A00C542E0 /* Model */, + FDF139FF2860BA7500C542E0 /* View */, + FDF139FE2860BA6B00C542E0 /* ViewController */, ); - name = Products; + path = LightStagram; sourceTree = ""; }; - FDA707F12858556C00C64790 /* PR2_Lightstagram */ = { + FDF139FE2860BA6B00C542E0 /* ViewController */ = { isa = PBXGroup; children = ( - FDF572862859801C00400483 /* Image */, - FDA707F22858556C00C64790 /* AppDelegate.swift */, - FDA707F42858556C00C64790 /* SceneDelegate.swift */, - FDA707FE2858556D00C64790 /* Assets.xcassets */, - FDA708002858556D00C64790 /* LaunchScreen.storyboard */, - FDA708032858556D00C64790 /* Info.plist */, - FD3F10D72858B313001E2D8A /* Model */, - FDA7080C2858835000C64790 /* ViewController */, + FDF139EB2860B9F900C542E0 /* MainViewController.swift */, + FDF13A012860BAAB00C542E0 /* AddEditViewController.swift */, + FDF13A032860BAB200C542E0 /* UserProfileViewController.swift */, + FDF13A092860BEA800C542E0 /* WindowTabBarViewController.swift */, ); - path = PR2_Lightstagram; + path = ViewController; sourceTree = ""; }; - FDA7080C2858835000C64790 /* ViewController */ = { + FDF139FF2860BA7500C542E0 /* View */ = { isa = PBXGroup; children = ( - FDA707F62858556C00C64790 /* mainViewController.swift */, - FDA7080D285883B400C64790 /* addEditViewController.swift */, - FD3F10F12858D119001E2D8A /* userProfileViewController.swift */, + FDBA214228620324004DD205 /* MainViewTableCustomCell.swift */, + FD5B9F8E28659F340056205E /* UserProfileViewCollectionCustomCell.swift */, ); - path = ViewController; + path = View; sourceTree = ""; }; - FDF572862859801C00400483 /* Image */ = { + FDF13A002860BA7A00C542E0 /* Model */ = { isa = PBXGroup; children = ( - FDF572872859805F00400483 /* IMG_3117.JPG */, + FDF139F02860B9F900C542E0 /* LightStagram.xcdatamodeld */, + FD5B9F8A2864F2220056205E /* Feed+CoreDataClass.swift */, + FD5B9F8B2864F2220056205E /* Feed+CoreDataProperties.swift */, + FDBA213E2862014E004DD205 /* MainViewTableViewModel.swift */, + FDBA2140286201E0004DD205 /* UserProfileViewCollectionViewModel.swift */, + FDC1D32F2863659D00D46D7C /* CoreDataManager.swift */, ); - path = Image; + path = Model; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - FDA707EE2858556C00C64790 /* PR2_Lightstagram */ = { + FDF139E32860B9F900C542E0 /* LightStagram */ = { isa = PBXNativeTarget; - buildConfigurationList = FDA708062858556D00C64790 /* Build configuration list for PBXNativeTarget "PR2_Lightstagram" */; + buildConfigurationList = FDF139FB2860B9FA00C542E0 /* Build configuration list for PBXNativeTarget "LightStagram" */; buildPhases = ( - FDA707EB2858556C00C64790 /* Sources */, - FDA707EC2858556C00C64790 /* Frameworks */, - FDA707ED2858556C00C64790 /* Resources */, + FDF139E02860B9F900C542E0 /* Sources */, + FDF139E12860B9F900C542E0 /* Frameworks */, + FDF139E22860B9F900C542E0 /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = PR2_Lightstagram; + name = LightStagram; packageProductDependencies = ( - FDA7080A2858606300C64790 /* SnapKit */, + FDF13A062860BB7D00C542E0 /* SnapKit */, ); - productName = PR2_Lightstagram; - productReference = FDA707EF2858556C00C64790 /* PR2_Lightstagram.app */; + productName = LightStagram; + productReference = FDF139E42860B9F900C542E0 /* LightStagram.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - FDA707E72858556C00C64790 /* Project object */ = { + FDF139DC2860B9F900C542E0 /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1330; LastUpgradeCheck = 1330; TargetAttributes = { - FDA707EE2858556C00C64790 = { + FDF139E32860B9F900C542E0 = { CreatedOnToolsVersion = 13.3; }; }; }; - buildConfigurationList = FDA707EA2858556C00C64790 /* Build configuration list for PBXProject "PR2_Lightstagram" */; + buildConfigurationList = FDF139DF2860B9F900C542E0 /* Build configuration list for PBXProject "LightStagram" */; compatibilityVersion = "Xcode 13.0"; developmentRegion = en; hasScannedForEncodings = 0; @@ -160,57 +169,60 @@ en, Base, ); - mainGroup = FDA707E62858556C00C64790; + mainGroup = FDF139DB2860B9F900C542E0; packageReferences = ( - FDA708092858606300C64790 /* XCRemoteSwiftPackageReference "SnapKit" */, + FDF13A052860BB7D00C542E0 /* XCRemoteSwiftPackageReference "SnapKit" */, ); - productRefGroup = FDA707F02858556C00C64790 /* Products */; + productRefGroup = FDF139E52860B9F900C542E0 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - FDA707EE2858556C00C64790 /* PR2_Lightstagram */, + FDF139E32860B9F900C542E0 /* LightStagram */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - FDA707ED2858556C00C64790 /* Resources */ = { + FDF139E22860B9F900C542E0 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDA708022858556D00C64790 /* LaunchScreen.storyboard in Resources */, - FDA707FF2858556D00C64790 /* Assets.xcassets in Resources */, - FDF572882859805F00400483 /* IMG_3117.JPG in Resources */, + FDF139F72860B9FA00C542E0 /* LaunchScreen.storyboard in Resources */, + FDF139F42860B9FA00C542E0 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - FDA707EB2858556C00C64790 /* Sources */ = { + FDF139E02860B9F900C542E0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDF572942859D39800400483 /* newFeedTableViewCell.swift in Sources */, - FD3F10F22858D119001E2D8A /* userProfileViewController.swift in Sources */, - FDA707F72858556C00C64790 /* mainViewController.swift in Sources */, - FDF5729228599F4800400483 /* Feed+CoreDataProperties.swift in Sources */, - FDA707F32858556C00C64790 /* AppDelegate.swift in Sources */, - FDF5729128599F4800400483 /* Feed+CoreDataClass.swift in Sources */, - FD3F10DA2858B334001E2D8A /* lightstagramModel.xcdatamodeld in Sources */, - FDA7080E285883B400C64790 /* addEditViewController.swift in Sources */, - FDA707F52858556C00C64790 /* SceneDelegate.swift in Sources */, - FDF5728E28598C8200400483 /* FeedModel.swift in Sources */, + FDF139F22860B9F900C542E0 /* LightStagram.xcdatamodeld in Sources */, + FDF13A042860BAB200C542E0 /* UserProfileViewController.swift in Sources */, + FDBA2141286201E0004DD205 /* UserProfileViewCollectionViewModel.swift in Sources */, + FD5B9F8C2864F2220056205E /* Feed+CoreDataClass.swift in Sources */, + FDF13A022860BAAB00C542E0 /* AddEditViewController.swift in Sources */, + FDBA213F2862014E004DD205 /* MainViewTableViewModel.swift in Sources */, + FD5B9F8F28659F340056205E /* UserProfileViewCollectionCustomCell.swift in Sources */, + FDF139EC2860B9F900C542E0 /* MainViewController.swift in Sources */, + FDF13A0A2860BEA800C542E0 /* WindowTabBarViewController.swift in Sources */, + FDF139E82860B9F900C542E0 /* AppDelegate.swift in Sources */, + FDF139EA2860B9F900C542E0 /* SceneDelegate.swift in Sources */, + FD5B9F8D2864F2220056205E /* Feed+CoreDataProperties.swift in Sources */, + FDBA214328620324004DD205 /* MainViewTableCustomCell.swift in Sources */, + FDC1D3302863659D00D46D7C /* CoreDataManager.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - FDA708002858556D00C64790 /* LaunchScreen.storyboard */ = { + FDF139F52860B9FA00C542E0 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - FDA708012858556D00C64790 /* Base */, + FDF139F62860B9FA00C542E0 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -218,7 +230,7 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - FDA708042858556D00C64790 /* Debug */ = { + FDF139F92860B9FA00C542E0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -278,7 +290,7 @@ }; name = Debug; }; - FDA708052858556D00C64790 /* Release */ = { + FDF139FA2860B9FA00C542E0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -314,6 +326,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -332,7 +345,7 @@ }; name = Release; }; - FDA708072858556D00C64790 /* Debug */ = { + FDF139FC2860B9FA00C542E0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -341,7 +354,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 8RN9H3Z673; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = PR2_Lightstagram/Info.plist; + INFOPLIST_FILE = LightStagram/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -351,7 +364,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "HIGHSOUL.PR2-Lightstagram"; + PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightStagram; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -359,7 +372,7 @@ }; name = Debug; }; - FDA708082858556D00C64790 /* Release */ = { + FDF139FD2860B9FA00C542E0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -368,7 +381,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 8RN9H3Z673; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = PR2_Lightstagram/Info.plist; + INFOPLIST_FILE = LightStagram/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -378,7 +391,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "HIGHSOUL.PR2-Lightstagram"; + PRODUCT_BUNDLE_IDENTIFIER = HIGHSOUL.LightStagram; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -389,20 +402,20 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - FDA707EA2858556C00C64790 /* Build configuration list for PBXProject "PR2_Lightstagram" */ = { + FDF139DF2860B9F900C542E0 /* Build configuration list for PBXProject "LightStagram" */ = { isa = XCConfigurationList; buildConfigurations = ( - FDA708042858556D00C64790 /* Debug */, - FDA708052858556D00C64790 /* Release */, + FDF139F92860B9FA00C542E0 /* Debug */, + FDF139FA2860B9FA00C542E0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - FDA708062858556D00C64790 /* Build configuration list for PBXNativeTarget "PR2_Lightstagram" */ = { + FDF139FB2860B9FA00C542E0 /* Build configuration list for PBXNativeTarget "LightStagram" */ = { isa = XCConfigurationList; buildConfigurations = ( - FDA708072858556D00C64790 /* Debug */, - FDA708082858556D00C64790 /* Release */, + FDF139FC2860B9FA00C542E0 /* Debug */, + FDF139FD2860B9FA00C542E0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -410,7 +423,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - FDA708092858606300C64790 /* XCRemoteSwiftPackageReference "SnapKit" */ = { + FDF13A052860BB7D00C542E0 /* XCRemoteSwiftPackageReference "SnapKit" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SnapKit/SnapKit.git"; requirement = { @@ -421,25 +434,25 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - FDA7080A2858606300C64790 /* SnapKit */ = { + FDF13A062860BB7D00C542E0 /* SnapKit */ = { isa = XCSwiftPackageProductDependency; - package = FDA708092858606300C64790 /* XCRemoteSwiftPackageReference "SnapKit" */; + package = FDF13A052860BB7D00C542E0 /* XCRemoteSwiftPackageReference "SnapKit" */; productName = SnapKit; }; /* End XCSwiftPackageProductDependency section */ /* Begin XCVersionGroup section */ - FD3F10D82858B334001E2D8A /* lightstagramModel.xcdatamodeld */ = { + FDF139F02860B9F900C542E0 /* LightStagram.xcdatamodeld */ = { isa = XCVersionGroup; children = ( - FD3F10D92858B334001E2D8A /* lightstagramModel.xcdatamodel */, + FDF139F12860B9F900C542E0 /* LightStagram.xcdatamodel */, ); - currentVersion = FD3F10D92858B334001E2D8A /* lightstagramModel.xcdatamodel */; - path = lightstagramModel.xcdatamodeld; + currentVersion = FDF139F12860B9F900C542E0 /* LightStagram.xcdatamodel */; + path = LightStagram.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; }; /* End XCVersionGroup section */ }; - rootObject = FDA707E72858556C00C64790 /* Project object */; + rootObject = FDF139DC2860B9F900C542E0 /* Project object */; } diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/KH/PR2_Lightstagram/LightStagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to KH/PR2_Lightstagram/LightStagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/KH/PR2_Lightstagram/LightStagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to KH/PR2_Lightstagram/LightStagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/KH/PR2_Lightstagram/LightStagram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved similarity index 100% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename to KH/PR2_Lightstagram/LightStagram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/KH/PR2_Lightstagram/LightStagram.xcodeproj/xcshareddata/xcschemes/LightStagram.xcscheme b/KH/PR2_Lightstagram/LightStagram.xcodeproj/xcshareddata/xcschemes/LightStagram.xcscheme new file mode 100644 index 0000000..c33267c --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram.xcodeproj/xcshareddata/xcschemes/LightStagram.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/.DS_Store b/KH/PR2_Lightstagram/LightStagram/.DS_Store similarity index 66% rename from KH/PR2_Lightstagram/PR2_Lightstagram/.DS_Store rename to KH/PR2_Lightstagram/LightStagram/.DS_Store index b449b0f..396bf9a 100644 Binary files a/KH/PR2_Lightstagram/PR2_Lightstagram/.DS_Store and b/KH/PR2_Lightstagram/LightStagram/.DS_Store differ diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/AppDelegate.swift b/KH/PR2_Lightstagram/LightStagram/AppDelegate.swift similarity index 70% rename from KH/PR2_Lightstagram/PR2_Lightstagram/AppDelegate.swift rename to KH/PR2_Lightstagram/LightStagram/AppDelegate.swift index 9f11cc1..8518df2 100644 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/AppDelegate.swift +++ b/KH/PR2_Lightstagram/LightStagram/AppDelegate.swift @@ -1,8 +1,8 @@ // // AppDelegate.swift -// PR2_Lightstagram +// LightStagram // -// Created by ROLF J. on 2022/06/14. +// Created by ROLF J. on 2022/06/20. // import UIKit @@ -11,8 +11,6 @@ import CoreData @main class AppDelegate: UIResponder, UIApplicationDelegate { - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true @@ -35,22 +33,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { - - - let container = NSPersistentContainer(name: "lightstagramModel") + let container = NSPersistentContainer(name: "LightStagram") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { - // Replace this implementation with code to handle the error appropriately. - // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. - - /* - Typical reasons for an error here include: - * The parent directory does not exist, cannot be created, or disallows writing. - * The persistent store is not accessible, due to permissions or data protection when the device is locked. - * The device is out of space. - * The store could not be migrated to the current model version. - Check the error message to determine what the actual problem was. - */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/.DS_Store b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/.DS_Store similarity index 75% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram/.DS_Store rename to KH/PR2_Lightstagram/LightStagram/Assets.xcassets/.DS_Store index 5515411..a9d7a88 100644 Binary files a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/.DS_Store and b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/.DS_Store differ diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Assets.xcassets/AccentColor.colorset/Contents.json b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram/Assets.xcassets/AccentColor.colorset/Contents.json rename to KH/PR2_Lightstagram/LightStagram/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Assets.xcassets/AppIcon.appiconset/Contents.json b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram/Assets.xcassets/AppIcon.appiconset/Contents.json rename to KH/PR2_Lightstagram/LightStagram/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Assets.xcassets/Contents.json b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/Contents.json similarity index 100% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram/Assets.xcassets/Contents.json rename to KH/PR2_Lightstagram/LightStagram/Assets.xcassets/Contents.json diff --git a/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/UserImage.imageset/Contents.json b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/UserImage.imageset/Contents.json new file mode 100644 index 0000000..ff8f750 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/UserImage.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Swift_Logo_RoundSquare.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/UserImage.imageset/Swift_Logo_RoundSquare.png b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/UserImage.imageset/Swift_Logo_RoundSquare.png new file mode 100644 index 0000000..5ff4095 Binary files /dev/null and b/KH/PR2_Lightstagram/LightStagram/Assets.xcassets/UserImage.imageset/Swift_Logo_RoundSquare.png differ diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Base.lproj/LaunchScreen.storyboard b/KH/PR2_Lightstagram/LightStagram/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from KH/PR2_Lightstagram/PR2_Lightstagram/Base.lproj/LaunchScreen.storyboard rename to KH/PR2_Lightstagram/LightStagram/Base.lproj/LaunchScreen.storyboard diff --git a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Info.plist b/KH/PR2_Lightstagram/LightStagram/Info.plist similarity index 84% rename from KH/PR2_LightInstagram/LightInstagram/LightInstagram/Info.plist rename to KH/PR2_Lightstagram/LightStagram/Info.plist index 0eb786d..aca992e 100644 --- a/KH/PR2_LightInstagram/LightInstagram/LightInstagram/Info.plist +++ b/KH/PR2_Lightstagram/LightStagram/Info.plist @@ -2,6 +2,10 @@ + NSCameraUsageDescription + + NSPhotoLibraryUsageDescription + UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/.DS_Store b/KH/PR2_Lightstagram/LightStagram/Model/.DS_Store similarity index 92% rename from KH/PR2_Lightstagram/PR2_Lightstagram/Model/.DS_Store rename to KH/PR2_Lightstagram/LightStagram/Model/.DS_Store index 0b8855e..c929999 100644 Binary files a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/.DS_Store and b/KH/PR2_Lightstagram/LightStagram/Model/.DS_Store differ diff --git a/KH/PR2_Lightstagram/LightStagram/Model/CoreDataManager.swift b/KH/PR2_Lightstagram/LightStagram/Model/CoreDataManager.swift new file mode 100644 index 0000000..db0d914 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/Model/CoreDataManager.swift @@ -0,0 +1,145 @@ +// +// CoreDataManager.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/22. +// + +import UIKit +import CoreData + +class CoreDataManager { + static var shared: CoreDataManager = CoreDataManager() + + let appDelegate: AppDelegate? = UIApplication.shared.delegate as? AppDelegate + lazy var context = appDelegate?.persistentContainer.viewContext + let modelName: String = "Feed" + + func getFeeds(ascending: Bool = false) -> [Feed] { + var models: [Feed] = [Feed]() + + if let context = context { + let fetchRequest: NSFetchRequest = NSFetchRequest(entityName: modelName) + do { + if let fetchRequest: [Feed] = try context.fetch(fetchRequest) as? [Feed] { + models = fetchRequest + } + } catch let error as NSError { + print("Could not fetch: \(error), \(error.userInfo)") + } + } + return models + } + + // Feed를 저장하는 함수 + func saveFeed(feedImage: Data, feedText: String, likeCount: String, uploadDate: String) { + if let context = context, let entity: NSEntityDescription = NSEntityDescription.entity(forEntityName: modelName, in: context) { + if let feed: Feed = NSManagedObject(entity: entity, insertInto: context) as? Feed { + feed.feedImage = feedImage + feed.feedText = feedText + feed.likeCount = likeCount + feed.uploadDate = uploadDate + } + } + appDelegate?.saveContext() + } + + // Feed를 삭제하는 함수 + func deleteFeed(feedText: String) { + let fetchRequest: NSFetchRequest = filteredRequest(feedText: feedText) + do { + if let results: [Feed] = try context?.fetch(fetchRequest) as? [Feed] { + if results.count != 0 { + context?.delete(results[0]) + } + } + } catch let error as NSError { + print("Could not fetch: \(error), \(error.userInfo)") + } + appDelegate?.saveContext() + } + + // feedText 문자열을 통해 CoreData의 배열 멤버를 특정함 + fileprivate func filteredRequest(feedText: String) -> NSFetchRequest { + let fetchRequest: NSFetchRequest = NSFetchRequest(entityName: modelName) + fetchRequest.predicate = NSPredicate(format: "feedText = %@", String(feedText)) + return fetchRequest + } + + + +// // CoreData에 정보를 추가하는 작업 +// func insertFeedToCoreData(_ feed: TableViewFeed) { +// if let context = context, let entity: NSEntityDescription = NSEntityDescription.entity(forEntityName: "LightStagram", in: context) { +// let managedObject = NSManagedObject(entity: entity, insertInto: context) +// let feedImageToSaveCoreData = feed.feedImage?.jpegData(compressionQuality: 1) +// managedObject.setValue(feedImageToSaveCoreData, forKey: "feedImage") +// managedObject.setValue(feed.likeCount, forKey: "likeCount") +// managedObject.setValue(feed.feedText, forKey: "feedText") +// managedObject.setValue(feed.uploadDate, forKey: "uploadDate") +// } +// appDelegate?.saveContext() +// } +// +//// // CoreData Framework에 정보 저장(CRUD 중 Create) +//// func saveToContext() { +//// do { +//// try context.save() +//// } catch { +//// print(error.localizedDescription) +//// } +//// } +// +// // CoreData에서 정보를 빼내기 위한 기초작업 +// func fetchFeeds() -> [Feed] { +// do { +// let request = Feed.fetchRequest() +// if let context = context { +// let results = try context.fetch(request) +// return results +// } +// } catch { +// print(error.localizedDescription) +// } +// return [] +// } +// +// // CoreData에서 정보를 읽는 작업(CRUD 중 Read) -> tableViewFeed 배열 형태로 전달함. +// func getFeedsForTableViewCell() -> [TableViewFeed] { +// var feeds: [TableViewFeed] = [] +// let fetchResult = fetchFeeds() +// for result in fetchResult { +// let feedImage = UIImage(data: result.feedImage!) +// let feed = TableViewFeed(feedImage: feedImage, feedText: result.feedText, likeCount: result.likeCount, uploadDate: result.uploadDate) +// feeds.append(feed) +// } +// return feeds +// } +// +// // CoreData의 정보를 수정하는 작업(CRUD 중 Update) +//// func updateFeed(_ feed: TableViewFeed) { +//// let fetchResult = fetchFeeds() +//// +//// } +// +// // CoreData의 정보를 삭제하는 작업 +// func deleteFeed(_ feed: TableViewFeed) { +// let fetchResult = fetchFeeds() +// let feed = fetchResult.filter({$0.feedText == feed.feedText})[0] +// if let context = context { +// context.delete(feed) +// appDelegate?.saveContext() +// } +// } +// +// // CoreData의 정보를 모두 삭제하는 작업 +// func deleteAllFeeds() { +// let fetchResult = fetchFeeds() +// for result in fetchResult { +// if let context = context { +// context.delete(result) +// } +// } +// appDelegate?.saveContext() +// } +} diff --git a/KH/PR2_Lightstagram/Feed+CoreDataClass.swift b/KH/PR2_Lightstagram/LightStagram/Model/Feed+CoreDataClass.swift similarity index 68% rename from KH/PR2_Lightstagram/Feed+CoreDataClass.swift rename to KH/PR2_Lightstagram/LightStagram/Model/Feed+CoreDataClass.swift index deb68a5..0aac579 100644 --- a/KH/PR2_Lightstagram/Feed+CoreDataClass.swift +++ b/KH/PR2_Lightstagram/LightStagram/Model/Feed+CoreDataClass.swift @@ -1,8 +1,8 @@ // // Feed+CoreDataClass.swift -// PR2_Lightstagram +// LightStagram // -// Created by ROLF J. on 2022/06/15. +// Created by ROLF J. on 2022/06/24. // // diff --git a/KH/PR2_Lightstagram/Feed+CoreDataProperties.swift b/KH/PR2_Lightstagram/LightStagram/Model/Feed+CoreDataProperties.swift similarity index 55% rename from KH/PR2_Lightstagram/Feed+CoreDataProperties.swift rename to KH/PR2_Lightstagram/LightStagram/Model/Feed+CoreDataProperties.swift index 94de604..7487639 100644 --- a/KH/PR2_Lightstagram/Feed+CoreDataProperties.swift +++ b/KH/PR2_Lightstagram/LightStagram/Model/Feed+CoreDataProperties.swift @@ -1,27 +1,24 @@ // // Feed+CoreDataProperties.swift -// PR2_Lightstagram +// LightStagram // -// Created by ROLF J. on 2022/06/15. +// Created by ROLF J. on 2022/06/24. // // import Foundation import CoreData + extension Feed { @nonobjc public class func fetchRequest() -> NSFetchRequest { return NSFetchRequest(entityName: "Feed") } - @NSManaged public var feedContent: String? @NSManaged public var feedImage: Data? - @NSManaged public var likeCount: Int16 - @NSManaged public var nowDate: Date? - -} - -extension Feed : Identifiable { + @NSManaged public var feedText: String? + @NSManaged public var likeCount: String? + @NSManaged public var uploadDate: String? } diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/KH/PR2_Lightstagram/LightStagram/Model/LightStagram.xcdatamodeld/.xccurrentversion similarity index 70% rename from KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to KH/PR2_Lightstagram/LightStagram/Model/LightStagram.xcdatamodeld/.xccurrentversion index 18d9810..a5d2ff1 100644 --- a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/KH/PR2_Lightstagram/LightStagram/Model/LightStagram.xcdatamodeld/.xccurrentversion @@ -2,7 +2,7 @@ - IDEDidComputeMac32BitWarning - + _XCCurrentVersionName + LightStagram.xcdatamodel diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/lightstagramModel.xcdatamodeld/lightstagramModel.xcdatamodel/contents b/KH/PR2_Lightstagram/LightStagram/Model/LightStagram.xcdatamodeld/LightStagram.xcdatamodel/contents similarity index 72% rename from KH/PR2_Lightstagram/PR2_Lightstagram/Model/lightstagramModel.xcdatamodeld/lightstagramModel.xcdatamodel/contents rename to KH/PR2_Lightstagram/LightStagram/Model/LightStagram.xcdatamodeld/LightStagram.xcdatamodel/contents index 4a57321..6808f0f 100644 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/lightstagramModel.xcdatamodeld/lightstagramModel.xcdatamodel/contents +++ b/KH/PR2_Lightstagram/LightStagram/Model/LightStagram.xcdatamodeld/LightStagram.xcdatamodel/contents @@ -1,10 +1,10 @@ - - - + + + diff --git a/KH/PR2_Lightstagram/LightStagram/Model/MainViewTableViewModel.swift b/KH/PR2_Lightstagram/LightStagram/Model/MainViewTableViewModel.swift new file mode 100644 index 0000000..10f8023 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/Model/MainViewTableViewModel.swift @@ -0,0 +1,17 @@ +// +// MainViewTableViewModel.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/21. +// + +import UIKit + +struct TableViewFeed { + let feedImage: UIImage? + let feedText: String? + let likeCount: String? + let uploadDate: String? +} + +var tableViewFeedList = [TableViewFeed]() diff --git a/KH/PR2_Lightstagram/LightStagram/Model/UserProfileViewCollectionViewModel.swift b/KH/PR2_Lightstagram/LightStagram/Model/UserProfileViewCollectionViewModel.swift new file mode 100644 index 0000000..22e45cc --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/Model/UserProfileViewCollectionViewModel.swift @@ -0,0 +1,14 @@ +// +// UserProfileViewCollectionViewModel.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/21. +// + +import UIKit + +struct collectionViewFeed { + let feedImage: UIImage? +} + +var collectionViewFeedList = [collectionViewFeed]() diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/SceneDelegate.swift b/KH/PR2_Lightstagram/LightStagram/SceneDelegate.swift similarity index 86% rename from KH/PR2_Lightstagram/PR2_Lightstagram/SceneDelegate.swift rename to KH/PR2_Lightstagram/LightStagram/SceneDelegate.swift index 879d7b6..477bf1b 100644 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/SceneDelegate.swift +++ b/KH/PR2_Lightstagram/LightStagram/SceneDelegate.swift @@ -1,8 +1,8 @@ // // SceneDelegate.swift -// PR2_Lightstagram +// LightStagram // -// Created by ROLF J. on 2022/06/14. +// Created by ROLF J. on 2022/06/20. // import UIKit @@ -10,13 +10,18 @@ import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Code-Base를 위해 MainViewController를 rootViewController로 지정 guard let windowScene = (scene as? UIWindowScene) else { return } window = UIWindow(windowScene: windowScene) - let mainViewController = mainViewController() - + let mainViewController = MainViewController() window?.rootViewController = mainViewController window?.makeKeyAndVisible() + + // TabBar를 rootViewController로 지정 + let tabBarController = WindowTabBarController() + window?.rootViewController = tabBarController } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/KH/PR2_Lightstagram/LightStagram/View/MainViewTableCustomCell.swift b/KH/PR2_Lightstagram/LightStagram/View/MainViewTableCustomCell.swift new file mode 100644 index 0000000..0f057d6 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/View/MainViewTableCustomCell.swift @@ -0,0 +1,133 @@ +// +// MainViewTableCustomCell.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/21. +// + +import UIKit +import SnapKit + +class MainViewTableCustomCell: UITableViewCell { + + static let tableViewCellIdentifier = "MainViewTableCustomCell" + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + layoutSubviews() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // User image + let userProfileImage: UIImageView = { + let userProfileImage = UIImageView() + userProfileImage.image = UIImage(named: "UserImage") + userProfileImage.contentMode = .scaleAspectFit + userProfileImage.layer.cornerRadius = 22 + userProfileImage.layer.borderWidth = 1 + userProfileImage.layer.borderColor = UIColor.darkGray.cgColor + userProfileImage.clipsToBounds = true + return userProfileImage + }() + + // 프로필 이미지 우측의 userName + let userNameBesideuserImage: UILabel = { + let userNameBesideuserImage = UILabel() + userNameBesideuserImage.text = userName + userNameBesideuserImage.textColor = .black + userNameBesideuserImage.font = UIFont.boldSystemFont(ofSize: 17) + return userNameBesideuserImage + }() + + // 피드의 이미지(newFeedImageView) + var feedImageView: UIImageView = { + let feedImageView = UIImageView() + feedImageView.contentMode = .scaleToFill + feedImageView.clipsToBounds = true + return feedImageView + }() + + // 피드의 좋아요 수(likeCount) + let feedLikeCount: UILabel = { + let feedLikeCount = UILabel() + feedLikeCount.font = UIFont.systemFont(ofSize: 15) + return feedLikeCount + }() + + // 피드 설명글 왼쪽의 userName + let userNameBesideFeedText: UILabel = { + let userNameBesideFeedText = UILabel() + userNameBesideFeedText.text = userName + userNameBesideFeedText.font = UIFont.boldSystemFont(ofSize: 17) + return userNameBesideFeedText + }() + + // 피드의 설명글(newFeedTextView) + let feedText: UILabel = { + let feedText = UILabel() + feedText.font = UIFont.systemFont(ofSize: 15) + return feedText + }() + + // 피드의 업로드 날짜(uploadDate) - 테스트 중 + let feedUploadDate: UILabel = { + let feedUploadDate = UILabel() + feedUploadDate.textColor = .lightGray + feedUploadDate.font = UIFont.systemFont(ofSize: 12) + return feedUploadDate + }() + + // Cell의 화면 구성 + override func layoutSubviews() { + super.layoutSubviews() + + addSubviews([userProfileImage, userNameBesideuserImage, feedImageView, feedLikeCount, userNameBesideFeedText, feedText, feedUploadDate]) + + userProfileImage.snp.makeConstraints { make in + make.top.equalTo(contentView).offset(10) + make.left.equalTo(contentView).offset(10) + make.size.equalTo(CGSize(width: 44, height: 44)) + } + + userNameBesideuserImage.snp.makeConstraints { make in + make.left.equalTo(userProfileImage.snp.right).offset(10) + make.centerY.equalTo(userProfileImage.snp.centerY) + } + + feedImageView.snp.makeConstraints { make in + make.top.equalTo(userProfileImage.snp.bottom).offset(10) + make.width.equalToSuperview() + make.height.equalTo(contentView.snp.width) + } + + feedLikeCount.snp.makeConstraints { make in + make.top.equalTo(feedImageView.snp.bottom).offset(10) + make.left.equalTo(contentView).offset(10) + } + + userNameBesideFeedText.snp.makeConstraints { make in + make.top.equalTo(feedLikeCount.snp.bottom).offset(10) + make.left.equalTo(contentView).offset(10) + } + + feedText.snp.makeConstraints { make in + make.left.equalTo(userNameBesideFeedText.snp.right).offset(10) + make.centerY.equalTo(userNameBesideFeedText.snp.centerY) + } + + feedUploadDate.snp.makeConstraints { make in + make.top.equalTo(feedText.snp.bottom).offset(10) + make.left.equalTo(contentView).offset(10) + } + } + + // View들을 한 번에 addSubview 시켜주는 함수 + func addSubviews(_ views: [UIView]) { + for view in views { + contentView.addSubview(view) + } + } +} diff --git a/KH/PR2_Lightstagram/LightStagram/View/UserProfileViewCollectionCustomCell.swift b/KH/PR2_Lightstagram/LightStagram/View/UserProfileViewCollectionCustomCell.swift new file mode 100644 index 0000000..ea6f837 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/View/UserProfileViewCollectionCustomCell.swift @@ -0,0 +1,40 @@ +// +// UserProfileViewCollectionCustomCell.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/24. +// + +import UIKit +import SnapKit + +class UserProfileViewCollectionCustomCell: UICollectionViewCell { + + static let collectionViewCellIdentifier = "UserProfileViewCollectionCustomCell" + + let feedImage: UIImageView = { + let feedImage = UIImageView() + feedImage.translatesAutoresizingMaskIntoConstraints = false + feedImage.contentMode = .scaleToFill +// feedImage.clipsToBounds = true + + return feedImage + }() + + override init(frame: CGRect) { + super.init(frame: .zero) + collectionViewCellLayout() + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func collectionViewCellLayout() { + contentView.addSubview(feedImage) + feedImage.snp.makeConstraints { make in + make.top.equalToSuperview() + make.width.height.equalToSuperview() + } + } +} diff --git a/KH/PR2_Lightstagram/LightStagram/ViewController/AddEditViewController.swift b/KH/PR2_Lightstagram/LightStagram/ViewController/AddEditViewController.swift new file mode 100644 index 0000000..f07e044 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/ViewController/AddEditViewController.swift @@ -0,0 +1,270 @@ +// +// AddEditViewController.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/20. +// + +import UIKit +import SnapKit + +class AddEditViewController: UIViewController { + + let placeHolderText = "사진과 함께 적을 글을 입력해주세요!" + + let imagePicker = UIImagePickerController() + var newFeedImageView = UIImageView() + var newFeedImageIfNilLabel = UILabel() + lazy var newFeedTextView: UITextView = { + let newFeedTextView = UITextView() + newFeedTextView.text = placeHolderText + newFeedTextView.textColor = .placeholderText + newFeedTextView.font = UIFont.systemFont(ofSize: 15) + newFeedTextView.delegate = self + return newFeedTextView + }() + + override func viewDidLoad() { + super.viewDidLoad() + // AddEditView에서는 탭바를 숨기도록 설정 +// self.tabBarController?.tabBar.isHidden = true + + imagePicker.delegate = self + + view.backgroundColor = .white + showAddEditViewLayout() + + } + + // AddEditView의 화면 구성 + func showAddEditViewLayout() { + // AddEditView의 타이틀 + let addEditViewTitle = UILabel() + addEditViewTitle.text = "피드 남기기" + addEditViewTitle.font = UIFont.boldSystemFont(ofSize: 30) + addEditViewTitle.sizeToFit() + view.addSubview(addEditViewTitle) + addEditViewTitle.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide).offset(-25) + make.left.equalTo(view.safeAreaLayoutGuide).offset(25) + } + + // Feed 추가를 취소하는(이전 View로 돌아가는) 버튼 + let dismissMakeFeedButton = UIButton() + dismissMakeFeedButton.configuration = UIButton.Configuration.plain() + dismissMakeFeedButton.setTitle("취소", for: .normal) + dismissMakeFeedButton.sizeToFit() + view.addSubview(dismissMakeFeedButton) + dismissMakeFeedButton.snp.makeConstraints { make in + make.top.equalTo(addEditViewTitle.snp.centerY) + make.right.equalTo(view.safeAreaLayoutGuide).offset(-5) + } + dismissMakeFeedButton.addTarget(self, action: #selector(pressDismissMakeFeedButton), for: .allEvents) + + // 이미지를 가져오는 "사진 선택하기" 버튼 + let getImageButton = UIButton() + getImageButton.setTitle("사진 선택하기", for: .normal) + getImageButton.configuration = UIButton.Configuration.plain() + getImageButton.sizeToFit() + view.addSubview(getImageButton) + getImageButton.snp.makeConstraints { make in + make.top.equalTo(addEditViewTitle.snp.bottom).offset(30) + make.centerX.equalTo(view) + } + getImageButton.addTarget(self, action: #selector(getImageFunction), for: .allEvents) + + // 가져온 이미지를 보여줄 UIImageView + view.addSubview(newFeedImageView) + newFeedImageView.layer.borderWidth = 1 + newFeedImageView.layer.borderColor = UIColor.black.cgColor + newFeedImageView.snp.makeConstraints { make in + make.top.equalTo(getImageButton.snp.bottom) + make.width.equalTo(view) + make.height.equalTo(newFeedImageView.snp.width) + } + + // UIImageView에 사진이 없으면 Label이 위에 보임 -> extension에 설정 + newFeedImageIfNilLabel.text = "사진을 선택해주세요!" + newFeedImageIfNilLabel.textColor = .gray + newFeedImageIfNilLabel.font = UIFont.boldSystemFont(ofSize: 40) + newFeedImageIfNilLabel.textAlignment = .center + view.addSubview(newFeedImageIfNilLabel) + newFeedImageIfNilLabel.snp.makeConstraints { make in + make.centerX.equalTo(newFeedImageView) + make.centerY.equalTo(newFeedImageView) + } + + // 새로운 Feed의 텍스트 입력 필드 + view.addSubview(newFeedTextView) + newFeedTextView.layer.borderWidth = 1 + newFeedTextView.layer.borderColor = UIColor.black.cgColor + newFeedTextView.snp.makeConstraints { make in + make.top.equalTo(newFeedImageView.snp.bottom).offset(10) + make.width.equalTo(view) + make.height.equalTo(100) + } + + // 새로운 Feed를 저장하는 버튼 + let saveNewFeedButton = UIButton() + var saveNewFeedButtonConfiguration = UIButton.Configuration.filled() + saveNewFeedButtonConfiguration.baseBackgroundColor = .green + saveNewFeedButtonConfiguration.baseForegroundColor = .black + saveNewFeedButton.configuration = saveNewFeedButtonConfiguration + saveNewFeedButton.sizeToFit() + view.addSubview(saveNewFeedButton) + saveNewFeedButton.setTitle("저장하기", for: .normal) + saveNewFeedButton.snp.makeConstraints { make in + make.top.equalTo(newFeedTextView.snp.bottom).offset(70) + make.centerX.equalTo(view) + } + saveNewFeedButton.addTarget(self, action: #selector(pressSaveButtonTest), for: .allEvents) + + } + + // 사진앨범을 여는 함수 + func openLibrary() { + imagePicker.sourceType = .photoLibrary + present(imagePicker, animated: true, completion: nil) + } + + // 카메라를 여는 함수 + func openCamera() { + imagePicker.sourceType = .camera + present(imagePicker, animated: true, completion: nil) + } + + // 저장을 취소하고 이전 화면으로 돌아가는 취소 버튼의 함수 + @objc func pressDismissMakeFeedButton() { + self.navigationController?.popToRootViewController(animated: true) + } + + // getImageButton을 눌러 사진을 가져오는 함수 + @objc func getImageFunction() { + let getImageSelectAlert = UIAlertController(title: "사진 가져오기", message: nil, preferredStyle: .actionSheet) + let getImageWithLibrary = UIAlertAction(title: "앨범", style: .default) { _ in self.openLibrary() } + let getImageWithCamera = UIAlertAction(title: "카메라", style: .default) { _ in self.openCamera() } + let getImageCancel = UIAlertAction(title: "취소", style: .cancel, handler: nil) + + getImageSelectAlert.addAction(getImageWithLibrary) + getImageSelectAlert.addAction(getImageWithCamera) + getImageSelectAlert.addAction(getImageCancel) + + present(getImageSelectAlert, animated: true, completion: nil) + } + + // 새로운 Feed를 CoreData에 저장하는 버튼 + @objc func pressSaveButtonTest() { + if noFeedImage() == true && noFeedText() == true { + saveToCoreData() + clearAddEditView() + } + } + + // 업로드할 사진이 선택되지 않았으면 실행 + func noFeedImage() -> Bool { + if newFeedImageView.image == nil { + let noImageAlert = UIAlertController(title: "사진이 없습니다!", message: "사진을 선택해주세요!", preferredStyle: .alert) + let checkButton = UIAlertAction(title: "OK", style: .default) + noImageAlert.addAction(checkButton) + present(noImageAlert, animated: true, completion: nil) + return false + } else { + return true + } + } + + // 업로드할 글이 작성되지 않았으면 실행 + func noFeedText() -> Bool { + if newFeedTextView.text == placeHolderText || newFeedTextView.text == "" { + let noTextAlert = UIAlertController(title: "글이 없습니다!", message: "사진과 함께 업로드할 글을 입력해주세요!", preferredStyle: .alert) + let checkButton = UIAlertAction(title: "OK", style: .default) + noTextAlert.addAction(checkButton) + present(noTextAlert, animated: true, completion: nil) + return false + } else { + return true + } + } + + // 랜덤 정수를 통해 likeCount 문자열을 만드는 함수 + func makeLikeCountString() -> String { + let randLikeCount = Int.random(in: 0..<1000) + let likeCountString = "\(randLikeCount)명이 좋아합니다." + print(likeCountString) + return likeCountString + } + + // 업로드 시의 날짜 정보에 대한 문자열을 만드는 함수 + func makeUploadDateString() -> String { + let nowDate = Date() + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "MM월 dd일 hh:mm" + let dateString = dateFormatter.string(from: nowDate) + print(dateString) + return dateString + } + + // 저장 시 정보들을 CoreData에 저장하는 함수 + func saveToCoreData() { + let newFeed = TableViewFeed(feedImage: newFeedImageView.image, feedText: newFeedTextView.text, likeCount: makeLikeCountString(), uploadDate: makeUploadDateString()) + let newFeedImageData = newFeed.feedImage?.jpegData(compressionQuality: 1) + CoreDataManager.shared.saveFeed(feedImage: newFeedImageData!, feedText: newFeed.feedText ?? "", likeCount: newFeed.likeCount ?? "", uploadDate: newFeed.uploadDate ?? "") + let mainViewController = MainViewController() + mainViewController.refreshTableView() + } + + // AddEditView를 초기화하는 함수 + func clearAddEditView() { + newFeedImageView.image = nil + newFeedTextView.text = nil + textViewDidEndEditing(newFeedTextView) + newFeedImageIfNilLabel.text = "사진을 선택해주세요!" + +// let clearAlert = UIAlertController(title: "저장되었습니다!", message: nil, preferredStyle: .alert) +// let checkButton = UIAlertAction(title: "OK", style: .default) +// clearAlert.addAction(checkButton) +// present(clearAlert, animated: true, completion: nil) + + let SuccessAlert = UIAlertController(title: "등록성공", message: "등록이 성공되었습니다.\n등록 뷰를 닫으시겠습니까?", preferredStyle: .alert) + let OKButton = UIAlertAction(title: "닫기", style: .default) + let dismissButton = UIAlertAction(title: "아니오", style: .default) + SuccessAlert.addAction(dismissButton) + SuccessAlert.addAction(OKButton) + present(SuccessAlert, animated: true, completion: nil) + + view.endEditing(true) + } + + // 화면을 터치하면 키보드가 내려가는 함수 + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + self.view.endEditing(true) + } + +} + +extension AddEditViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { + + // 이미지를 가져올 때 UIImage 형식이 맞는지 확인하고 newFeedImageView에 출력함 + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { + if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { + newFeedImageIfNilLabel.text = nil + newFeedImageView.image = image + } + dismiss(animated: true, completion: nil) + } +} + +extension AddEditViewController: UITextViewDelegate { + func textViewDidBeginEditing(_ textView: UITextView) { + guard newFeedTextView.textColor == .placeholderText else { return } + newFeedTextView.textColor = .black + newFeedTextView.text = nil + } + + func textViewDidEndEditing(_ textView: UITextView) { + if newFeedTextView.text.isEmpty { + newFeedTextView.text = placeHolderText + newFeedTextView.textColor = .placeholderText + } + } +} diff --git a/KH/PR2_Lightstagram/LightStagram/ViewController/MainViewController.swift b/KH/PR2_Lightstagram/LightStagram/ViewController/MainViewController.swift new file mode 100644 index 0000000..ecbbb44 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/ViewController/MainViewController.swift @@ -0,0 +1,147 @@ +// +// MainViewController.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/20. +// + +import UIKit +import SnapKit +import CoreData +import AVFoundation +import Photos + +public let userName = "JKH" + +class MainViewController: UIViewController { + + let mainViewTitle = UILabel() + private let feedTableView: UITableView = { + let feedTableView = UITableView() + feedTableView.register(MainViewTableCustomCell.self, forCellReuseIdentifier: MainViewTableCustomCell.tableViewCellIdentifier) + return feedTableView + }() + + override func viewDidLoad() { + super.viewDidLoad() + cameraPermission() + photoLibraryPermission() + tableViewFunctions() + refreshTableView() + showMainViewLayout() + } + + // MainView의 화면 구성 + func showMainViewLayout() { + view.backgroundColor = .white + + // MainView의 타이틀 + mainViewTitle.text = "LightStagram" + mainViewTitle.font = UIFont.boldSystemFont(ofSize: 30) + view.addSubview(mainViewTitle) + mainViewTitle.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide).offset(-25) + make.left.equalTo(view.safeAreaLayoutGuide).offset(25) + } + + showFeedTable() + } + + // MainView의 테이블뷰 + func showFeedTable() { + view.addSubview(feedTableView) + feedTableView.snp.makeConstraints { make in + make.top.equalTo(mainViewTitle.snp.bottom).offset(10) + make.bottom.equalTo(view) + make.width.equalTo(view) + } + } + + func tableViewFunctions() { + feedTableView.delegate = self + feedTableView.dataSource = self +// feedTableView.estimatedRowHeight = 580 + feedTableView.rowHeight = 580 + feedTableView.flashScrollIndicators() + feedTableView.selectionFollowsFocus = false + refreshTableView() + } + + func refreshTableView() { + feedTableView.reloadData() + } + + // Camera 사용 허가 + func cameraPermission() { + AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) in + if granted { + print("Camera: 권한 허용") + } else { + print("Camera: 권한 거부") + } + }) + } + + // 사진 앨범 사용 허가 + func photoLibraryPermission() { + PHPhotoLibrary.requestAuthorization( { status in + switch status { + case .authorized: + print("Album: 권한 허용") + case .denied: + print("Album: 권한 거부") + case .notDetermined, .restricted: + print("Album: 선택하지 않음") + default: + break + } + }) + } +} + +extension MainViewController: UITableViewDelegate, UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return CoreDataManager.shared.getFeeds().count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let feedCell = tableView.dequeueReusableCell(withIdentifier: MainViewTableCustomCell.tableViewCellIdentifier, for: indexPath) as? MainViewTableCustomCell else { return UITableViewCell() } + let newFeedForCell = CoreDataManager.shared.getFeeds() + feedCell.feedImageView.image = UIImage(data: newFeedForCell[indexPath.row].feedImage!) + feedCell.feedText.text = newFeedForCell[indexPath.row].feedText + feedCell.feedLikeCount.text = newFeedForCell[indexPath.row].likeCount + feedCell.feedUploadDate.text = newFeedForCell[indexPath.row].uploadDate + + self.feedTableView.separatorStyle = UITableViewCell.SeparatorStyle.singleLine + + return feedCell + } + + // 셀을 오른쪽에서 쓸었을 때 수정/삭제의 기능이 구현하려고 함 -> 미구현 + func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { + let deleteAction = UIContextualAction(style: .destructive, title: "Delete", handler: { action, view, completionHandler in + print("delete") + let getFeedForDelete: [Feed] = CoreDataManager.shared.getFeeds() + tableViewFeedList.remove(at: indexPath.row) + collectionViewFeedList.remove(at: indexPath.row) + self.feedTableView.deleteRows(at: [indexPath], with: .automatic) + CoreDataManager.shared.deleteFeed(feedText: getFeedForDelete[indexPath.row].feedText!) + self.feedTableView.reloadData() + completionHandler(true) + }) + + let editAction = UIContextualAction(style: .normal, title: "Edit", handler: { action, view, completionHandler in + print("edit") + completionHandler(true) + }) + editAction.backgroundColor = .blue + + return UISwipeActionsConfiguration(actions: [deleteAction, editAction]) + } + + private func getIndexPath(view: UIView) -> IndexPath? { + let viewPoint = view.convert(CGPoint.zero, to: feedTableView) + return feedTableView.indexPathForRow(at: viewPoint) + } +} + diff --git a/KH/PR2_Lightstagram/LightStagram/ViewController/UserProfileViewController.swift b/KH/PR2_Lightstagram/LightStagram/ViewController/UserProfileViewController.swift new file mode 100644 index 0000000..c5c1e72 --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/ViewController/UserProfileViewController.swift @@ -0,0 +1,263 @@ +// +// UserProfileViewController.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/20. +// + +import UIKit +import SnapKit + +class UserProfileViewController: UIViewController { + + let feedCollectionView: UICollectionView = { + let collectionViewLayout = UICollectionViewFlowLayout() + collectionViewLayout.scrollDirection = .vertical + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewLayout) + collectionView.translatesAutoresizingMaskIntoConstraints = false + collectionView.register(UserProfileViewCollectionCustomCell.self, forCellWithReuseIdentifier: UserProfileViewCollectionCustomCell.collectionViewCellIdentifier) + collectionView.backgroundColor = .white + return collectionView + }() + let peopleButtonLabel = UILabel() + + override func viewDidLoad() { + super.viewDidLoad() + + view.backgroundColor = .white + + collectionViewFunctions() + showUserProfileViewLayout() + } + + // userProfileView의 화면 구성 + func showUserProfileViewLayout() { + // UserProfileView의 타이틀 + let userProfileViewTitle = UILabel() + userProfileViewTitle.text = userName + userProfileViewTitle.font = UIFont.boldSystemFont(ofSize: 30) + view.addSubview(userProfileViewTitle) + userProfileViewTitle.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide).offset(-25) + make.left.equalTo(view.safeAreaLayoutGuide).offset(25) + } + + // UserProfile image + let userProfileImage = UIImageView() + userProfileImage.image = UIImage(named: "UserImage") + userProfileImage.contentMode = .scaleAspectFit + userProfileImage.layer.cornerRadius = 50 + userProfileImage.layer.borderWidth = 1 + userProfileImage.layer.borderColor = UIColor.darkGray.cgColor + userProfileImage.clipsToBounds = true + view.addSubview(userProfileImage) + userProfileImage.snp.makeConstraints { make in + make.top.equalTo(userProfileViewTitle.snp.bottom).offset(20) + make.left.equalTo(userProfileViewTitle.snp.left) + make.width.height.equalTo(100) + } + + // 게시물 수 + let feedCountLabel = UILabel() + feedCountLabel.text = String(CoreDataManager.shared.getFeeds().count) + view.addSubview(feedCountLabel) + feedCountLabel.snp.makeConstraints { make in + make.left.equalTo(userProfileImage.snp.right).offset(45) + make.centerY.equalTo(userProfileImage.snp.centerY).offset(-10) + } + + // "게시물" 라벨 + let feedLabel = UILabel() + feedLabel.text = "게시물" + view.addSubview(feedLabel) + feedLabel.snp.makeConstraints { make in + make.top.equalTo(feedCountLabel.snp.bottom) + make.centerX.equalTo(feedCountLabel.snp.centerX) + } + + // 팔로워 수 + let followerCountLabel = UILabel() + followerCountLabel.text = "1M" + view.addSubview(followerCountLabel) + followerCountLabel.snp.makeConstraints { make in + make.left.equalTo(feedCountLabel.snp.right).offset(70) + make.centerY.equalTo(feedCountLabel.snp.centerY) + } + + // "팔로워" 라벨 + let follwerLabel = UILabel() + follwerLabel.text = "팔로워" + view.addSubview(follwerLabel) + follwerLabel.snp.makeConstraints { make in + make.top.equalTo(followerCountLabel.snp.bottom) + make.centerX.equalTo(followerCountLabel.snp.centerX) + } + + // 팔로잉 수 + let followingCountLabel = UILabel() + followingCountLabel.text = "1M" + view.addSubview(followingCountLabel) + followingCountLabel.snp.makeConstraints { make in + make.left.equalTo(followerCountLabel.snp.right).offset(70) + make.centerY.equalTo(followerCountLabel.snp.centerY) + } + + // "팔로잉" 라벨 + let followingLabel = UILabel() + followingLabel.text = "팔로잉" + view.addSubview(followingLabel) + followingLabel.snp.makeConstraints { make in + make.top.equalTo(followerCountLabel.snp.bottom) + make.centerX.equalTo(followingCountLabel.snp.centerX) + } + + // UserName + let userName = UILabel() + userName.text = "장경호" + userName.font = UIFont.boldSystemFont(ofSize: 17) + view.addSubview(userName) + userName.snp.makeConstraints { make in + make.top.equalTo(userProfileImage.snp.bottom).offset(20) + make.left.equalTo(userProfileImage.snp.left) + } + + // 한줄 소개 + let userIntroduciton = UILabel() + userIntroduciton.text = "인스타그램 클론 겁나 어렵네요;" + userIntroduciton.font = UIFont.systemFont(ofSize: 15) + view.addSubview(userIntroduciton) + userIntroduciton.snp.makeConstraints { make in + make.top.equalTo(userName.snp.bottom).offset(5) + make.left.equalTo(userName.snp.left) + } + + // 프로필 편집 버튼 + let profileEditButton = UIButton() + profileEditButton.backgroundColor = .white + profileEditButton.setTitle("프로필 편집", for: .normal) + profileEditButton.setTitleColor(.black, for: .normal) + profileEditButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 17) + profileEditButton.layer.borderWidth = 1 + profileEditButton.layer.borderColor = UIColor.lightGray.cgColor + profileEditButton.layer.cornerRadius = 5 + view.addSubview(profileEditButton) + profileEditButton.snp.makeConstraints { make in + make.top.equalTo(userIntroduciton.snp.bottom).offset(10) + make.centerX.equalTo(view) + make.width.equalTo(view).offset(-40) + make.height.equalTo(40) + } + profileEditButton.addTarget(self, action: #selector(pressNotFinishButton), for: .allEvents) + + // Feed&People 버튼 위의 Divider + let dividerLabel = UILabel() + dividerLabel.layer.borderWidth = 1 + dividerLabel.layer.borderColor = UIColor.lightGray.cgColor + view.addSubview(dividerLabel) + dividerLabel.snp.makeConstraints { make in + make.top.equalTo(profileEditButton.snp.bottom).offset(10) + make.width.equalTo(view) + make.height.equalTo(1) + } + + // Feed 버튼 + let feedButton = UIButton() + feedButton.setImage(UIImage(systemName: "squareshape.split.3x3"), for: .normal) + feedButton.contentVerticalAlignment = .fill + feedButton.contentHorizontalAlignment = .fill + view.addSubview(feedButton) + feedButton.snp.makeConstraints { make in + make.top.equalTo(dividerLabel.snp.bottom).offset(10) + make.left.equalTo(view.safeAreaInsets).offset(100) + make.size.equalTo(30) + } + feedButton.addTarget(self, action: #selector(pressNotFinishButton), for: .allEvents) + + // Feed 버튼 라벨 + let feedButtonLabel = UILabel() + feedButtonLabel.text = "Feed" + feedButtonLabel.font = UIFont.systemFont(ofSize: 11) + feedButtonLabel.textColor = .systemBlue + view.addSubview(feedButtonLabel) + feedButtonLabel.snp.makeConstraints { make in + make.top.equalTo(feedButton.snp.bottom) + make.centerX.equalTo(feedButton.snp.centerX) + } + + // People 버튼 + let peopleButton = UIButton() + peopleButton.setImage(UIImage(systemName: "person.crop.square"), for: .normal) + peopleButton.contentVerticalAlignment = .fill + peopleButton.contentHorizontalAlignment = .fill + view.addSubview(peopleButton) + peopleButton.snp.makeConstraints { make in + make.top.equalTo(dividerLabel.snp.bottom).offset(10) + make.right.equalTo(view.safeAreaInsets).offset(-100) + make.size.equalTo(30) + } + peopleButton.addTarget(self, action: #selector(pressNotFinishButton), for: .allEvents) + + // People 버튼 라벨 + peopleButtonLabel.text = "People" + peopleButtonLabel.textColor = .systemBlue + peopleButtonLabel.font = UIFont.systemFont(ofSize: 11) + view.addSubview(peopleButtonLabel) + peopleButtonLabel.snp.makeConstraints { make in + make.top.equalTo(peopleButton.snp.bottom) + make.centerX.equalTo(peopleButton.snp.centerX) + } + + showCollectionView() + } + + // show collecionView + func showCollectionView() { + view.addSubview(feedCollectionView) + feedCollectionView.snp.makeConstraints { make in + make.top.equalTo(peopleButtonLabel.snp.bottom).offset(10) + make.width.equalTo(view) + make.bottom.equalTo(view.safeAreaLayoutGuide) + + } + + let noSpacing = UICollectionViewFlowLayout() + noSpacing.minimumLineSpacing = 0 + noSpacing.minimumInteritemSpacing = 0 + feedCollectionView.setCollectionViewLayout(noSpacing, animated: true) + } + + func collectionViewFunctions() { + feedCollectionView.delegate = self + feedCollectionView.dataSource = self + feedCollectionView.reloadData() + } + + // '준비 중인 기능'에 대한 함수 + @objc func pressNotFinishButton() { + let profileEditButtomAlert = UIAlertController(title: "준비 중인 기능입니다.", message: nil, preferredStyle: .alert) + let checkButton = UIAlertAction(title: "OK", style: .default) + profileEditButtomAlert.addAction(checkButton) + + present(profileEditButtomAlert, animated: true, completion: nil) + } + +} + +extension UserProfileViewController: UICollectionViewDelegateFlowLayout, UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize(width: view.frame.width/3, height: view.frame.width/3) + } + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return CoreDataManager.shared.getFeeds().count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let collectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: UserProfileViewCollectionCustomCell.collectionViewCellIdentifier, for: indexPath) as? UserProfileViewCollectionCustomCell else { return UICollectionViewCell() } + let newFeedForCollectionViewCell = CoreDataManager.shared.getFeeds() + + collectionViewCell.feedImage.image = UIImage(data: newFeedForCollectionViewCell[indexPath.row].feedImage!) + + return collectionViewCell + } +} diff --git a/KH/PR2_Lightstagram/LightStagram/ViewController/WindowTabBarViewController.swift b/KH/PR2_Lightstagram/LightStagram/ViewController/WindowTabBarViewController.swift new file mode 100644 index 0000000..362628e --- /dev/null +++ b/KH/PR2_Lightstagram/LightStagram/ViewController/WindowTabBarViewController.swift @@ -0,0 +1,34 @@ +// +// WindowTabBarViewController.swift +// LightStagram +// +// Created by ROLF J. on 2022/06/20. +// + +import UIKit + +class WindowTabBarController: UITabBarController { + + override func viewDidLoad() { + super.viewDidLoad() + + setUpTabBarLayout() + } + + // 탭바로 ViewController들을 이동할 수 있도록 링크 생성 + private func setUpTabBarLayout() { + let firstViewController = UINavigationController(rootViewController: MainViewController()) + let secondViewController = UINavigationController(rootViewController: AddEditViewController()) + let thirdViewController = UINavigationController(rootViewController: UserProfileViewController()) + + firstViewController.tabBarItem.image = UIImage(systemName: "house") + secondViewController.tabBarItem.image = UIImage(systemName: "plus.rectangle") + thirdViewController.tabBarItem.image = UIImage(systemName: "person.fill") + + tabBar.backgroundColor = .systemGray3 + tabBar.tintColor = .blue + tabBar.unselectedItemTintColor = .systemGray + + viewControllers = [firstViewController, secondViewController, thirdViewController] + } +} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 009c162..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,14 +0,0 @@ -{ - "pins" : [ - { - "identity" : "snapkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/SnapKit/SnapKit.git", - "state" : { - "revision" : "f222cbdf325885926566172f6f5f06af95473158", - "version" : "5.6.0" - } - } - ], - "version" : 2 -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/.DS_Store b/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/.DS_Store deleted file mode 100644 index 3d88b1e..0000000 Binary files a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/.DS_Store and /dev/null differ diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/AccentColor.colorset/Contents.json b/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/AppIcon.appiconset/Contents.json b/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9221b9b..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/Contents.json b/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Image/IMG_3117.JPG b/KH/PR2_Lightstagram/PR2_Lightstagram/Image/IMG_3117.JPG deleted file mode 100644 index f56c36a..0000000 Binary files a/KH/PR2_Lightstagram/PR2_Lightstagram/Image/IMG_3117.JPG and /dev/null differ diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Info.plist b/KH/PR2_Lightstagram/PR2_Lightstagram/Info.plist deleted file mode 100644 index 0eb786d..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/Info.plist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - - - - - - diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/FeedModel.swift b/KH/PR2_Lightstagram/PR2_Lightstagram/Model/FeedModel.swift deleted file mode 100644 index 41fb033..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/FeedModel.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// FeedModel.swift -// PR2_Lightstagram -// -// Created by ROLF J. on 2022/06/15. -// - -import Foundation -import UIKit - -struct FeedModel { - var feedContent: String? - var likeCount: Int? - var nowDate: Date? - var feedImage: UIImage? -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/newFeedTableViewCell.swift b/KH/PR2_Lightstagram/PR2_Lightstagram/Model/newFeedTableViewCell.swift deleted file mode 100644 index 5efee6a..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/Model/newFeedTableViewCell.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// newFeedTableViewCell.swift -// PR2_Lightstagram -// -// Created by ROLF J. on 2022/06/15. -// - -import UIKit - -class newFeedTableViewCell: UITableViewCell { - - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - - override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - super.init(style: style, reuseIdentifier: reuseIdentifier) - } - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/PR2_Lightstagram.xcdatamodeld/.xccurrentversion b/KH/PR2_Lightstagram/PR2_Lightstagram/PR2_Lightstagram.xcdatamodeld/.xccurrentversion deleted file mode 100644 index 0c67376..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/PR2_Lightstagram.xcdatamodeld/.xccurrentversion +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/PR2_Lightstagram.xcdatamodeld/PR2_Lightstagram.xcdatamodel/contents b/KH/PR2_Lightstagram/PR2_Lightstagram/PR2_Lightstagram.xcdatamodeld/PR2_Lightstagram.xcdatamodel/contents deleted file mode 100644 index 50d2514..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/PR2_Lightstagram.xcdatamodeld/PR2_Lightstagram.xcdatamodel/contents +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/.DS_Store b/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/.DS_Store and /dev/null differ diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/addEditViewController.swift b/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/addEditViewController.swift deleted file mode 100644 index b950a21..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/addEditViewController.swift +++ /dev/null @@ -1,158 +0,0 @@ -// -// addEditViewController.swift -// PR2_Lightstagram -// -// Created by ROLF J. on 2022/06/14. -// - -import UIKit -import SnapKit -import CoreData - -class addEditViewController: UIViewController { - - let picker = UIImagePickerController() - - func openLibrary() { - picker.sourceType = .photoLibrary - present(picker, animated: false, completion: nil) - } - - func openCamera() { - picker.sourceType = .camera - present(picker, animated: false, completion: nil) - } - - override func viewDidLoad() { - super.viewDidLoad() - picker.delegate = self - - // 화면 흰색으로 변경 - view.backgroundColor = .white - - // Add/Edit 화면의 제목 - let addEditViewTitle = UILabel() - addEditViewTitle.text = "피드 남기기" - addEditViewTitle.font = UIFont.boldSystemFont(ofSize: 30.0) - self.view.addSubview(addEditViewTitle) - addEditViewTitle.snp.makeConstraints { make in - make.width.left.equalTo(view.safeAreaLayoutGuide).offset(30) - make.height.equalTo(70) - make.top.equalTo(view.safeAreaLayoutGuide).offset(15) - } - -// // Back Button -// var backConfig = UIButton.Configuration.plain() -// backConfig.image = UIImage(systemName: "delete.backward") -// backToMainButton.configuration = backConfig -// self.view.addSubview(backToMainButton) -// backToMainButton.snp.makeConstraints { make in -// make.top.equalTo(view.safeAreaLayoutGuide).offset(20) -// make.right.equalTo(view.safeAreaLayoutGuide).offset(-20) -// make.width.equalTo(50) -// make.height.equalTo(30) -// } - - // 사진을 가져오기 Button - let getImageButton = UIButton() - let GIConfig = UIButton.Configuration.plain() - getImageButton.setTitle("사진 선택하기", for: .normal) - getImageButton.sizeToFit() - getImageButton.configuration = GIConfig - self.view.addSubview(getImageButton) - getImageButton.snp.makeConstraints { make in - make.top.equalTo(addEditViewTitle.snp.bottom) - make.centerX.equalTo(self.view) - } - - // 가져온 사진을 보여줄 ImageView - var getImageView = UIImageView() - self.view.addSubview(getImageView) - getImageView.backgroundColor = .lightGray - getImageView.snp.makeConstraints { make in - make.top.equalTo(getImageButton.snp.bottom).offset(10) - make.width.equalTo(self.view) - make.height.equalTo(getImageView.snp.width) - } - - if getImageButton.isSelected == true { - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { - - } - } - - // 사진과 함께 적을 텍스트를 가져올 TextField - let getTextField = UITextField() - getTextField.placeholder = "사진과 함께 저장할 글을 입력해주세요" - getTextField.layer.borderWidth = 1.0 - getTextField.layer.borderColor = UIColor.black.cgColor - self.view.addSubview(getTextField) - getTextField.snp.makeConstraints { make in - make.top.equalTo(getImageView.snp.bottom).offset(30) - make.width.equalTo(view.safeAreaLayoutGuide).offset(-30) - make.centerX.equalTo(self.view) - make.height.equalTo(100) - } - - // Save Button - let saveButton = UIButton() - var saveConfig = UIButton.Configuration.plain() - saveConfig.title = "Save" - saveConfig.background.backgroundColor = .green - saveButton.configuration = saveConfig - saveButton.tintColor = .black - self.view.addSubview(saveButton) - saveButton.snp.makeConstraints { make in - make.bottom.equalTo(view.safeAreaLayoutGuide) - make.centerX.equalTo(self.view) - make.width.equalTo(100) - make.height.equalTo(50) - } - - // If user click save button - func clickSaveButton() { - guard let feedContent = getTextField.text else { - let alert = UIAlertController(title: "오류", message: "텍스트가 없습니다!", preferredStyle: .alert) - let checkButton = UIAlertAction(title: "확인", style: .cancel, handler: nil) - alert.addAction(checkButton) - self.present(alert, animated: true) - return - } - guard let feedImage = getImageView.image else { - let alert = UIAlertController(title: "오류", message: "이미지가 없습니다!", preferredStyle: .alert) - let checkButton = UIAlertAction(title: "확인", style: .cancel, handler: nil) - alert.addAction(checkButton) - self.present(alert, animated: true) - return - } - let rand = Int.random(in: 0..<1000) - let likeCount = rand - let nowDate = Date() - let newTempFeed = FeedModel(feedContent: feedContent, likeCount: likeCount, nowDate: nowDate, feedImage: feedImage) - - let appDelegate = UIApplication.shared.delegate as! AppDelegate - let context = appDelegate.persistentContainer.viewContext - let entity = NSEntityDescription.entity(forEntityName: "Feed", in: context) - - // Save to Core Data Stack - if let entity = entity { - let feeds = NSManagedObject(entity: entity, insertInto: context) - feeds.setValue(newTempFeed.feedContent, forKey: "feedContent") - feeds.setValue(newTempFeed.likeCount, forKey: "likeCount") - feeds.setValue(newTempFeed.nowDate, forKey: "nowDate") - feeds.setValue(newTempFeed.feedImage, forKey: "feedImage") - - // Save Stack - do { - try context.save() - } catch { - print(error.localizedDescription) - } - } - } - } -} - -extension addEditViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { - -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/mainViewController.swift b/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/mainViewController.swift deleted file mode 100644 index 8a510ef..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/mainViewController.swift +++ /dev/null @@ -1,138 +0,0 @@ -// -// ViewController.swift -// PR2_Lightstagram -// -// Created by ROLF J. on 2022/06/14. -// - -import UIKit -import SnapKit -import CoreData - -class mainViewController: UIViewController { - - var container: NSPersistentContainer! - - var feedCount = [NSManagedObject]() - - private let feedTableView: UITableView = { - let tableView = UITableView() - return tableView - }() - - var mainFeedButton = UIButton() - var feedAddEditButton = UIButton() - var userProfileButton = UIButton() - - // Add/Edit ViewController로 넘어가는 함수. 우선 automatic으로. - @objc func clickAEB(_ sender: UIButton) { - print("Checking") - let addEditVC = addEditViewController() - addEditVC.modalPresentationStyle = .automatic - self.present(addEditVC, animated: true) - } - - // userProfile ViewController로 넘어가는 함수. Fullscreen으로 넘어가버림. - @objc func clickuPB(_ sender: UIButton) { - let userProfileVC = userProfileViewController() - userProfileVC.modalPresentationStyle = .fullScreen - self.present(userProfileVC, animated: true) - } - - override func viewDidLoad() { - super.viewDidLoad() - self.feedTableView.dataSource = self - self.feedTableView.delegate = self - - // Main 화면 배경색 설정 - view.backgroundColor = .white - - feedTableView.register(newFeedTableViewCell.self, forCellReuseIdentifier: "cell") - - - // Main 화면(피드 화면)의 제목(TextLabel) - let userViewTitle = UILabel() - userViewTitle.text = "Lightstagram" - userViewTitle.font = UIFont.boldSystemFont(ofSize: 30.0) - self.view.addSubview(userViewTitle) - userViewTitle.snp.makeConstraints { make in - make.width.left.equalTo(view.safeAreaLayoutGuide).offset(30) - make.height.equalTo(70) - make.top.equalTo(view.safeAreaLayoutGuide) - } - - // 하단부, 버튼들이 들어갈 공간을 UIView로 설정하고 Background color 지정 - let naviButtonBar = UIView() - self.view.addSubview(naviButtonBar) - naviButtonBar.backgroundColor = .lightGray - naviButtonBar.snp.makeConstraints { make in - make.width.bottom.equalTo(self.view) - make.height.equalTo(100) - } - - // feed들을 보여줄 tableView 공간 설정 - self.view.addSubview(feedTableView) - feedTableView.backgroundColor = .gray - feedTableView.snp.makeConstraints { make in - make.width.equalTo(self.view) - make.top.equalTo(userViewTitle.snp.bottom) - make.bottom.equalTo(naviButtonBar.snp.top) - } - - // mainFeedButton - var mainConfig = UIButton.Configuration.plain() - mainConfig.image = UIImage(systemName: "house.fill") - mainFeedButton.configuration = mainConfig - self.view.addSubview(mainFeedButton) - mainFeedButton.snp.makeConstraints { make in - make.left.equalTo(view.safeAreaLayoutGuide).offset(60) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - - // feedAddEditButton - var addEditConfig = UIButton.Configuration.plain() - addEditConfig.image = UIImage(systemName: "plus.rectangle") - feedAddEditButton.configuration = addEditConfig - feedAddEditButton.tintColor = .green - self.view.addSubview(feedAddEditButton) - feedAddEditButton.snp.makeConstraints { make in - make.centerX.equalTo(view.safeAreaLayoutGuide) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - feedAddEditButton.addTarget(self, action: #selector(clickAEB(_:)), for: .touchUpInside) - - // userProfileButton - var userConfig = UIButton.Configuration.plain() - userConfig.image = UIImage(systemName: "person.fill") - userProfileButton.configuration = userConfig - userProfileButton.tintColor = .gray - self.view.addSubview(userProfileButton) - userProfileButton.snp.makeConstraints { make in - make.right.equalTo(view.safeAreaLayoutGuide).offset(-60) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - userProfileButton.addTarget(self, action: #selector(clickuPB(_:)), for: .touchUpInside) - } - -} - -extension mainViewController: UITableViewDelegate { - -} - -extension mainViewController: UITableViewDataSource { - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return self.feedCount.count - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as? newFeedTableViewCell else { return UITableViewCell() } - - return cell - } -} diff --git a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/userProfileViewController.swift b/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/userProfileViewController.swift deleted file mode 100644 index 96823ed..0000000 --- a/KH/PR2_Lightstagram/PR2_Lightstagram/ViewController/userProfileViewController.swift +++ /dev/null @@ -1,237 +0,0 @@ -// -// userProfileViewController.swift -// PR2_Lightstagram -// -// Created by ROLF J. on 2022/06/14. -// - -import UIKit -import SnapKit -import CoreData - -class userProfileViewController: UIViewController { - - var mainFeedButton = UIButton() - var feedAddEditButton = UIButton() - var userProfileButton = UIButton() - - // Add/Edit ViewController로 넘어가는 함수. 우선 automatic으로. - @objc func clickAEB(_ sender: UIButton) { - let addEditVC = addEditViewController() - addEditVC.modalPresentationStyle = .automatic - self.present(addEditVC, animated: true) - } - - @objc func clickmainB(_ sender: UIButton) { - let mainVC = mainViewController() - mainVC.modalPresentationStyle = .fullScreen - self.present(mainVC, animated: true) - } - - override func viewDidLoad() { - super.viewDidLoad() - - // 화면 흰색으로 변경 - view.backgroundColor = .white - - // Username - let userName = UILabel() - userName.text = "JKH" - userName.font = UIFont.boldSystemFont(ofSize: 30.0) - self.view.addSubview(userName) - userName.snp.makeConstraints { make in - make.width.left.equalTo(view.safeAreaLayoutGuide).offset(30) - make.height.equalTo(70) - make.top.equalTo(view.safeAreaLayoutGuide) - } - - - - // User Information - - // User Image - let userProfileImage = UIImageView() - userProfileImage.image = #imageLiteral(resourceName: "IMG_3117.JPG") - userProfileImage.clipsToBounds = true - userProfileImage.layer.cornerRadius = 40 - self.view.addSubview(userProfileImage) - userProfileImage.snp.makeConstraints { make in - make.top.equalTo(userName.snp.bottom).offset(10) - make.left.equalTo(view.safeAreaLayoutGuide).offset(30) - make.width.height.equalTo(80) - } - - // Number of feeds - let feedCount = UILabel() - feedCount.text = "1K" - self.view.addSubview(feedCount) - feedCount.snp.makeConstraints { make in - make.left.equalTo(userProfileImage.snp.right).offset(40) - make.centerY.equalTo(userProfileImage.snp.centerY).offset(-10) - } - let feedText = UILabel() - feedText.text = "게시물" - self.view.addSubview(feedText) - feedText.snp.makeConstraints { make in - make.top.equalTo(feedCount.snp.bottom) - make.centerX.equalTo(feedCount.snp.centerX) - } - - // Number of Follwers - let followerCount = UILabel() - followerCount.text = "1M" - self.view.addSubview(followerCount) - followerCount.snp.makeConstraints { make in - make.left.equalTo(feedCount.snp.right).offset(65) - make.centerY.equalTo(userProfileImage.snp.centerY).offset(-10) - } - let followerText = UILabel() - followerText.text = "팔로워" - self.view.addSubview(followerText) - followerText.snp.makeConstraints { make in - make.top.equalTo(followerCount.snp.bottom) - make.centerX.equalTo(followerCount.snp.centerX) - } - - // Number of Follwing - let followingCount = UILabel() - followingCount.text = "1M" - self.view.addSubview(followingCount) - followingCount.snp.makeConstraints { make in - make.left.equalTo(followerCount.snp.right).offset(65) - make.centerY.equalTo(userProfileImage.snp.centerY).offset(-10) - } - let followingText = UILabel() - followingText.text = "팔로워" - self.view.addSubview(followingText) - followingText.snp.makeConstraints { make in - make.top.equalTo(followingCount.snp.bottom) - make.centerX.equalTo(followingCount.snp.centerX) - } - - // User Nickname - let userNickname = UILabel() - userNickname.text = "장경호" - userNickname.font = UIFont.boldSystemFont(ofSize: 17.0) - self.view.addSubview(userNickname) - userNickname.snp.makeConstraints { make in - make.top.equalTo(userProfileImage.snp.bottom).offset(20) - make.left.equalTo(view.safeAreaLayoutGuide).offset(30) - } - // Subtitle/Content - let userIntroduction = UILabel() - userIntroduction.font = UIFont.systemFont(ofSize: 15.0) - userIntroduction.text = "인스타그램 경량화 버전입니다 만들기 드릅게 힘드네요" - self.view.addSubview(userIntroduction) - userIntroduction.snp.makeConstraints { make in - make.top.equalTo(userNickname.snp.bottom) - make.left.equalTo(view.safeAreaLayoutGuide).offset(30) - } - - // Set profile button - let setProfileButton = UIButton() - setProfileButton.backgroundColor = .white - setProfileButton.setTitle("프로필 편집", for: .normal) - setProfileButton.layer.cornerRadius = 5 - setProfileButton.layer.borderWidth = 1.0 - setProfileButton.layer.borderColor = UIColor.lightGray.cgColor - setProfileButton.setTitleColor(.black, for: .normal) - self.view.addSubview(setProfileButton) - setProfileButton.snp.makeConstraints { make in - make.top.equalTo(userIntroduction.snp.bottom).offset(10) - make.centerX.equalTo(self.view) - make.width.equalTo(370) - make.height.equalTo(40) - } - - // Feed/People 버튼이 들어갈 UIView - let feedPeopleView = UIView() - feedPeopleView.layer.borderWidth = 1.0 - feedPeopleView.layer.borderColor = UIColor.lightGray.cgColor - self.view.addSubview(feedPeopleView) - feedPeopleView.snp.makeConstraints { make in - make.top.equalTo(setProfileButton.snp.bottom).offset(10) - make.width.equalTo(self.view) - make.height.equalTo(40) - } - - // Feed Button - let userFeedButton = UIButton() - var UFConfig = UIButton.Configuration.plain() - UFConfig.image = UIImage(systemName: "squareshape.split.3x3") - userFeedButton.configuration = UFConfig - userFeedButton.setTitle("Feed", for: .normal) - self.view.addSubview(userFeedButton) - userFeedButton.snp.makeConstraints { make in - make.centerY.equalTo(feedPeopleView.snp.centerY) - make.centerX.equalTo(feedPeopleView.snp.centerX).offset(-100) - } - - // People Button - let peopleButton = UIButton() - var PPConfig = UIButton.Configuration.plain() - PPConfig.subtitle = "People" - PPConfig.image = UIImage(systemName: "person.crop.square") - peopleButton.configuration = PPConfig - self.view.addSubview(peopleButton) - peopleButton.snp.makeConstraints { make in - make.centerY.equalTo(feedPeopleView.snp.centerY) - make.centerX.equalTo(feedPeopleView.snp.centerX).offset(100) - } - - // Over here_User Information - - - - - - // 하단부, 버튼들이 들어갈 공간을 UIView로 설정하고 Background color 지정 - let naviButtonBar = UIView() - self.view.addSubview(naviButtonBar) - naviButtonBar.backgroundColor = .lightGray - naviButtonBar.snp.makeConstraints { make in - make.width.bottom.equalTo(self.view) - make.height.equalTo(100) - } - - // mainFeedButton - var mainConfig = UIButton.Configuration.plain() - mainConfig.image = UIImage(systemName: "house.fill") - mainFeedButton.configuration = mainConfig - mainFeedButton.tintColor = .gray - self.view.addSubview(mainFeedButton) - mainFeedButton.snp.makeConstraints { make in - make.left.equalTo(view.safeAreaLayoutGuide).offset(60) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - mainFeedButton.addTarget(self, action: #selector(clickmainB(_:)), for: .touchUpInside) - - // feedAddEditButton - var addEditConfig = UIButton.Configuration.plain() - addEditConfig.image = UIImage(systemName: "plus.rectangle") - feedAddEditButton.configuration = addEditConfig - feedAddEditButton.tintColor = .green - self.view.addSubview(feedAddEditButton) - feedAddEditButton.snp.makeConstraints { make in - make.centerX.equalTo(view.safeAreaLayoutGuide) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - feedAddEditButton.addTarget(self, action: #selector(clickAEB(_:)), for: .touchUpInside) - - // userProfileButton - var userConfig = UIButton.Configuration.plain() - userConfig.image = UIImage(systemName: "person.fill") - userProfileButton.configuration = userConfig - self.view.addSubview(userProfileButton) - userProfileButton.snp.makeConstraints { make in - make.right.equalTo(view.safeAreaLayoutGuide).offset(-60) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-15) - make.width.equalTo(50) - make.height.equalTo(30) - } - } -}