From 8f7dcf9879471e7865249c0970e0e5cf6fd5ebcd Mon Sep 17 00:00:00 2001 From: Alex Paul Date: Sat, 27 Mar 2021 02:48:06 -0400 Subject: [PATCH] a --- Instagram Clone.xcodeproj/project.pbxproj | 180 +++++++++- .../xcschemes/xcschememanagement.plist | 2 +- Instagram Clone/AppDelegate.swift | 17 +- .../instagram_logo.imageset/Contents.json | 21 ++ .../instagram_logo.png | Bin 0 -> 4439 bytes Instagram Clone/Base.lproj/Main.storyboard | 313 +++++++++++++++++- Instagram Clone/CameraViewController.swift | 68 ++++ Instagram Clone/CommentTableViewCell.swift | 25 ++ Instagram Clone/FeedViewController.swift | 162 +++++++++ Instagram Clone/LoginViewController.swift | 67 ++++ Instagram Clone/PostTableViewCell.swift | 28 ++ Instagram Clone/ViewController.swift | 19 -- 12 files changed, 870 insertions(+), 32 deletions(-) create mode 100644 Instagram Clone/Assets.xcassets/instagram_logo.imageset/Contents.json create mode 100644 Instagram Clone/Assets.xcassets/instagram_logo.imageset/instagram_logo.png create mode 100644 Instagram Clone/CameraViewController.swift create mode 100644 Instagram Clone/CommentTableViewCell.swift create mode 100644 Instagram Clone/FeedViewController.swift create mode 100644 Instagram Clone/LoginViewController.swift create mode 100644 Instagram Clone/PostTableViewCell.swift delete mode 100644 Instagram Clone/ViewController.swift diff --git a/Instagram Clone.xcodeproj/project.pbxproj b/Instagram Clone.xcodeproj/project.pbxproj index 25d3389..4c893f6 100644 --- a/Instagram Clone.xcodeproj/project.pbxproj +++ b/Instagram Clone.xcodeproj/project.pbxproj @@ -3,18 +3,25 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ + 36467D0D933AFF3A05DEA8C3 /* Pods_Instagram_CloneTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D04FE6E9F0523962F805E4A2 /* Pods_Instagram_CloneTests.framework */; }; + 4683CABDF553E48742985107 /* Pods_Instagram_Clone_Instagram_CloneUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A0DC239246B44A4D96E92BD /* Pods_Instagram_Clone_Instagram_CloneUITests.framework */; }; 5714AB47260D6B5200C7C958 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5714AB46260D6B5200C7C958 /* AppDelegate.swift */; }; 5714AB49260D6B5200C7C958 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5714AB48260D6B5200C7C958 /* SceneDelegate.swift */; }; - 5714AB4B260D6B5200C7C958 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5714AB4A260D6B5200C7C958 /* ViewController.swift */; }; 5714AB4E260D6B5200C7C958 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5714AB4C260D6B5200C7C958 /* Main.storyboard */; }; 5714AB50260D6B5200C7C958 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5714AB4F260D6B5200C7C958 /* Assets.xcassets */; }; 5714AB53260D6B5200C7C958 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5714AB51260D6B5200C7C958 /* LaunchScreen.storyboard */; }; 5714AB5E260D6B5200C7C958 /* Instagram_CloneTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5714AB5D260D6B5200C7C958 /* Instagram_CloneTests.swift */; }; 5714AB69260D6B5200C7C958 /* Instagram_CloneUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5714AB68260D6B5200C7C958 /* Instagram_CloneUITests.swift */; }; + 5714AB7D260D6BAE00C7C958 /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5714AB7C260D6BAE00C7C958 /* FeedViewController.swift */; }; + 5714AB82260D6BBC00C7C958 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5714AB81260D6BBC00C7C958 /* LoginViewController.swift */; }; + 571AF28F260ED05D00FEF2E9 /* PostTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 571AF28E260ED05D00FEF2E9 /* PostTableViewCell.swift */; }; + 571AF294260EE66400FEF2E9 /* CommentTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 571AF293260EE66400FEF2E9 /* CommentTableViewCell.swift */; }; + 57CF3DFD260E371100369CE4 /* CameraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57CF3DFC260E371100369CE4 /* CameraViewController.swift */; }; + EA752040FCC185A1634829E0 /* Pods_Instagram_Clone.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0664201BBD6D05937C0DFB0 /* Pods_Instagram_Clone.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -35,10 +42,12 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0F30412DD6F5039F58E1D62B /* Pods-Instagram Clone.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Instagram Clone.debug.xcconfig"; path = "Target Support Files/Pods-Instagram Clone/Pods-Instagram Clone.debug.xcconfig"; sourceTree = ""; }; + 1EA306BC28E446B847D36125 /* Pods-Instagram Clone.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Instagram Clone.release.xcconfig"; path = "Target Support Files/Pods-Instagram Clone/Pods-Instagram Clone.release.xcconfig"; sourceTree = ""; }; + 3A0DC239246B44A4D96E92BD /* Pods_Instagram_Clone_Instagram_CloneUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Instagram_Clone_Instagram_CloneUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5714AB43260D6B5200C7C958 /* Instagram Clone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Instagram Clone.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 5714AB46260D6B5200C7C958 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 5714AB48260D6B5200C7C958 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 5714AB4A260D6B5200C7C958 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 5714AB4D260D6B5200C7C958 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 5714AB4F260D6B5200C7C958 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 5714AB52260D6B5200C7C958 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -49,6 +58,17 @@ 5714AB64260D6B5200C7C958 /* Instagram CloneUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Instagram CloneUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 5714AB68260D6B5200C7C958 /* Instagram_CloneUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Instagram_CloneUITests.swift; sourceTree = ""; }; 5714AB6A260D6B5200C7C958 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5714AB7C260D6BAE00C7C958 /* FeedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = ""; }; + 5714AB81260D6BBC00C7C958 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; + 571AF28E260ED05D00FEF2E9 /* PostTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostTableViewCell.swift; sourceTree = ""; }; + 571AF293260EE66400FEF2E9 /* CommentTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentTableViewCell.swift; sourceTree = ""; }; + 57CF3DFC260E371100369CE4 /* CameraViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraViewController.swift; sourceTree = ""; }; + A9DC6401D746173634761B50 /* Pods-Instagram CloneTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Instagram CloneTests.release.xcconfig"; path = "Target Support Files/Pods-Instagram CloneTests/Pods-Instagram CloneTests.release.xcconfig"; sourceTree = ""; }; + AC11C9A4F901071AD9B2C30B /* Pods-Instagram Clone-Instagram CloneUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Instagram Clone-Instagram CloneUITests.release.xcconfig"; path = "Target Support Files/Pods-Instagram Clone-Instagram CloneUITests/Pods-Instagram Clone-Instagram CloneUITests.release.xcconfig"; sourceTree = ""; }; + C0664201BBD6D05937C0DFB0 /* Pods_Instagram_Clone.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Instagram_Clone.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C2021E6D5A66670BD89AECA2 /* Pods-Instagram Clone-Instagram CloneUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Instagram Clone-Instagram CloneUITests.debug.xcconfig"; path = "Target Support Files/Pods-Instagram Clone-Instagram CloneUITests/Pods-Instagram Clone-Instagram CloneUITests.debug.xcconfig"; sourceTree = ""; }; + D04FE6E9F0523962F805E4A2 /* Pods_Instagram_CloneTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Instagram_CloneTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + DD50A016E9D658B3DADCC3B4 /* Pods-Instagram CloneTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Instagram CloneTests.debug.xcconfig"; path = "Target Support Files/Pods-Instagram CloneTests/Pods-Instagram CloneTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,6 +76,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + EA752040FCC185A1634829E0 /* Pods_Instagram_Clone.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -63,6 +84,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 36467D0D933AFF3A05DEA8C3 /* Pods_Instagram_CloneTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -70,6 +92,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4683CABDF553E48742985107 /* Pods_Instagram_Clone_Instagram_CloneUITests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -83,6 +106,8 @@ 5714AB5C260D6B5200C7C958 /* Instagram CloneTests */, 5714AB67260D6B5200C7C958 /* Instagram CloneUITests */, 5714AB44260D6B5200C7C958 /* Products */, + A13E157E705D9B4A181F068C /* Pods */, + AD7DC78BE9FCCC2A601C2B3A /* Frameworks */, ); sourceTree = ""; }; @@ -101,8 +126,12 @@ children = ( 5714AB46260D6B5200C7C958 /* AppDelegate.swift */, 5714AB48260D6B5200C7C958 /* SceneDelegate.swift */, - 5714AB4A260D6B5200C7C958 /* ViewController.swift */, 5714AB4C260D6B5200C7C958 /* Main.storyboard */, + 571AF293260EE66400FEF2E9 /* CommentTableViewCell.swift */, + 571AF28E260ED05D00FEF2E9 /* PostTableViewCell.swift */, + 5714AB7C260D6BAE00C7C958 /* FeedViewController.swift */, + 57CF3DFC260E371100369CE4 /* CameraViewController.swift */, + 5714AB81260D6BBC00C7C958 /* LoginViewController.swift */, 5714AB4F260D6B5200C7C958 /* Assets.xcassets */, 5714AB51260D6B5200C7C958 /* LaunchScreen.storyboard */, 5714AB54260D6B5200C7C958 /* Info.plist */, @@ -128,6 +157,29 @@ path = "Instagram CloneUITests"; sourceTree = ""; }; + A13E157E705D9B4A181F068C /* Pods */ = { + isa = PBXGroup; + children = ( + 0F30412DD6F5039F58E1D62B /* Pods-Instagram Clone.debug.xcconfig */, + 1EA306BC28E446B847D36125 /* Pods-Instagram Clone.release.xcconfig */, + C2021E6D5A66670BD89AECA2 /* Pods-Instagram Clone-Instagram CloneUITests.debug.xcconfig */, + AC11C9A4F901071AD9B2C30B /* Pods-Instagram Clone-Instagram CloneUITests.release.xcconfig */, + DD50A016E9D658B3DADCC3B4 /* Pods-Instagram CloneTests.debug.xcconfig */, + A9DC6401D746173634761B50 /* Pods-Instagram CloneTests.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + AD7DC78BE9FCCC2A601C2B3A /* Frameworks */ = { + isa = PBXGroup; + children = ( + C0664201BBD6D05937C0DFB0 /* Pods_Instagram_Clone.framework */, + 3A0DC239246B44A4D96E92BD /* Pods_Instagram_Clone_Instagram_CloneUITests.framework */, + D04FE6E9F0523962F805E4A2 /* Pods_Instagram_CloneTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -135,9 +187,11 @@ isa = PBXNativeTarget; buildConfigurationList = 5714AB6D260D6B5200C7C958 /* Build configuration list for PBXNativeTarget "Instagram Clone" */; buildPhases = ( + B4DB9FDAD56A5C7FE0221933 /* [CP] Check Pods Manifest.lock */, 5714AB3F260D6B5200C7C958 /* Sources */, 5714AB40260D6B5200C7C958 /* Frameworks */, 5714AB41260D6B5200C7C958 /* Resources */, + CB84D1C3AB120CF0B719960F /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -152,6 +206,7 @@ isa = PBXNativeTarget; buildConfigurationList = 5714AB70260D6B5200C7C958 /* Build configuration list for PBXNativeTarget "Instagram CloneTests" */; buildPhases = ( + 10D1C6FF27263CEE820675D3 /* [CP] Check Pods Manifest.lock */, 5714AB55260D6B5200C7C958 /* Sources */, 5714AB56260D6B5200C7C958 /* Frameworks */, 5714AB57260D6B5200C7C958 /* Resources */, @@ -170,9 +225,11 @@ isa = PBXNativeTarget; buildConfigurationList = 5714AB73260D6B5200C7C958 /* Build configuration list for PBXNativeTarget "Instagram CloneUITests" */; buildPhases = ( + 53089C89C36178F0BFDAF826 /* [CP] Check Pods Manifest.lock */, 5714AB60260D6B5200C7C958 /* Sources */, 5714AB61260D6B5200C7C958 /* Frameworks */, 5714AB62260D6B5200C7C958 /* Resources */, + C452D9A23EA0ED16CDAE4617 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -253,14 +310,121 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 10D1C6FF27263CEE820675D3 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Instagram CloneTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 53089C89C36178F0BFDAF826 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Instagram Clone-Instagram CloneUITests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + B4DB9FDAD56A5C7FE0221933 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Instagram Clone-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + C452D9A23EA0ED16CDAE4617 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Instagram Clone-Instagram CloneUITests/Pods-Instagram Clone-Instagram CloneUITests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Instagram Clone-Instagram CloneUITests/Pods-Instagram Clone-Instagram CloneUITests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Instagram Clone-Instagram CloneUITests/Pods-Instagram Clone-Instagram CloneUITests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + CB84D1C3AB120CF0B719960F /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Instagram Clone/Pods-Instagram Clone-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Instagram Clone/Pods-Instagram Clone-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Instagram Clone/Pods-Instagram Clone-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 5714AB3F260D6B5200C7C958 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5714AB4B260D6B5200C7C958 /* ViewController.swift in Sources */, + 5714AB82260D6BBC00C7C958 /* LoginViewController.swift in Sources */, + 57CF3DFD260E371100369CE4 /* CameraViewController.swift in Sources */, 5714AB47260D6B5200C7C958 /* AppDelegate.swift in Sources */, + 5714AB7D260D6BAE00C7C958 /* FeedViewController.swift in Sources */, + 571AF294260EE66400FEF2E9 /* CommentTableViewCell.swift in Sources */, 5714AB49260D6B5200C7C958 /* SceneDelegate.swift in Sources */, + 571AF28F260ED05D00FEF2E9 /* PostTableViewCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -433,6 +597,7 @@ }; 5714AB6E260D6B5200C7C958 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0F30412DD6F5039F58E1D62B /* Pods-Instagram Clone.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -452,6 +617,7 @@ }; 5714AB6F260D6B5200C7C958 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 1EA306BC28E446B847D36125 /* Pods-Instagram Clone.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -471,6 +637,7 @@ }; 5714AB71260D6B5200C7C958 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = DD50A016E9D658B3DADCC3B4 /* Pods-Instagram CloneTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -493,6 +660,7 @@ }; 5714AB72260D6B5200C7C958 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = A9DC6401D746173634761B50 /* Pods-Instagram CloneTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -515,6 +683,7 @@ }; 5714AB74260D6B5200C7C958 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C2021E6D5A66670BD89AECA2 /* Pods-Instagram Clone-Instagram CloneUITests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; @@ -535,6 +704,7 @@ }; 5714AB75260D6B5200C7C958 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = AC11C9A4F901071AD9B2C30B /* Pods-Instagram Clone-Instagram CloneUITests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; diff --git a/Instagram Clone.xcodeproj/xcuserdata/alexpaul.xcuserdatad/xcschemes/xcschememanagement.plist b/Instagram Clone.xcodeproj/xcuserdata/alexpaul.xcuserdatad/xcschemes/xcschememanagement.plist index 31ff3b1..d08add6 100644 --- a/Instagram Clone.xcodeproj/xcuserdata/alexpaul.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Instagram Clone.xcodeproj/xcuserdata/alexpaul.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ Instagram Clone.xcscheme_^#shared#^_ orderHint - 0 + 9 diff --git a/Instagram Clone/AppDelegate.swift b/Instagram Clone/AppDelegate.swift index 13e42ac..1a7fd79 100644 --- a/Instagram Clone/AppDelegate.swift +++ b/Instagram Clone/AppDelegate.swift @@ -6,14 +6,29 @@ // import UIKit - +import Parse @main class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + Parse.initialize(with: ParseClientConfiguration(block: { (configuration: ParseMutableClientConfiguration) in + configuration.applicationId = "CpPfypBNGum7YmGM2PpKYBcRH6KiZby4xEvu8Vbx" + configuration.clientKey = "imNdVKZjsY4hFTOkGETUb5nRuo3Bl3sDfDEtisYo" + configuration.server = "https://parseapi.back4app.com/" + })) + + + if PFUser.current() != nil{ + let main = UIStoryboard(name: "Main", bundle: nil) + let feedNavigationController = main.instantiateViewController(withIdentifier: "FeedNavigationController") + + window?.rootViewController = feedNavigationController + } + return true } diff --git a/Instagram Clone/Assets.xcassets/instagram_logo.imageset/Contents.json b/Instagram Clone/Assets.xcassets/instagram_logo.imageset/Contents.json new file mode 100644 index 0000000..1137c78 --- /dev/null +++ b/Instagram Clone/Assets.xcassets/instagram_logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "instagram_logo.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Instagram Clone/Assets.xcassets/instagram_logo.imageset/instagram_logo.png b/Instagram Clone/Assets.xcassets/instagram_logo.imageset/instagram_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..5fd65c28c15c514bd0937a137b3cdfe734cb6f49 GIT binary patch literal 4439 zcmeHK^;Z)B+ubCkl^Q7nq!AdQC^5PRjP9X;ph%k3=#UEl=c00?*vhnWGc+Xf(Hq0fxj$bEj1@K1q)SEH|4L~z-# z9rKe5CnmpB3hyD#HEL|3n;qJ5$UlIa;3o6vHPi=i;uzYx#)Lkbz!bZ}7qA_`6wC)9DK{%pDu9 zCNiuv680K5R0!yldun5~lV8ehLdN-b!Tq-|ufl7nllBz0jJgd1TfP@1lnL>?6hElm z=hA*2-MkiybdU!L#J%h7bGw$uZS~V4wJKkCyK$u6tF`hz?Iu;{tZH$^i^9idj&T3? z!wq5(tcNK(NBfhuRc9?F)Q3`a%^>BBrI^8cEdTa`QcqLO{55d*6ObMNAO}bnB3+et zk(cEEcOxz*yQX%GLuf5$mZ(>+5_lF{3vMj7Dw8-i_+I*XRqm6<5UlK&(#I}tYWceu zd$BhJ3Lm(&W@B3kOJh1Z&5{CRK3#rJrC0g%tdI@1<36jA63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n$dw&yD^Q<7x~v?C?q-QqBF$zg5cz##t%pLuy(lXtu@zWe|U5Deql%{utU@EviU>|%1UbqHr - + + - + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Instagram Clone/CameraViewController.swift b/Instagram Clone/CameraViewController.swift new file mode 100644 index 0000000..c054177 --- /dev/null +++ b/Instagram Clone/CameraViewController.swift @@ -0,0 +1,68 @@ +// +// CameraViewController.swift +// Instagram Clone +// +// Created by Alex Paul on 3/26/21. +// + +import UIKit +import Parse +import AlamofireImage +class CameraViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { + + @IBOutlet weak var imageView: UIImageView! + + @IBOutlet weak var commentTextField: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + @IBAction func onSubmit(_ sender: Any) { + let post = PFObject(className: "Parstagram") + + post["caption"] = commentTextField.text! + post["author"] = PFUser.current()! + + let imageData = imageView.image!.pngData() + let file = PFFileObject(data: imageData!) + + post["image"] = file + + post.saveInBackground{ (success,error) in + if success { + self.dismiss(animated: true, completion: nil) + print("Saved!") + }else{ + print("Error!") + } + + } + + + } + + @IBAction func cameraButton(_ sender: Any) { + let picker = UIImagePickerController() + picker.delegate = self + picker.allowsEditing = true + + if UIImagePickerController.isSourceTypeAvailable(.camera){ + picker.sourceType = .camera + }else{ + picker.sourceType = .photoLibrary + } + present(picker,animated: true,completion: nil) + } + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { + let image = info[.editedImage] as! UIImage + let size = CGSize(width: 300, height: 300) + let scaledImage = image.af_imageScaled(to: size) + imageView.image = scaledImage + dismiss(animated: true, completion: nil) + + } + +} diff --git a/Instagram Clone/CommentTableViewCell.swift b/Instagram Clone/CommentTableViewCell.swift new file mode 100644 index 0000000..320fbbc --- /dev/null +++ b/Instagram Clone/CommentTableViewCell.swift @@ -0,0 +1,25 @@ +// +// CommentTableViewCell.swift +// Instagram Clone +// +// Created by Alex Paul on 3/27/21. +// + +import UIKit + +class CommentTableViewCell: UITableViewCell { + + @IBOutlet weak var name: UILabel! + @IBOutlet weak var comment: UILabel! + 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 + } + +} diff --git a/Instagram Clone/FeedViewController.swift b/Instagram Clone/FeedViewController.swift new file mode 100644 index 0000000..7e63364 --- /dev/null +++ b/Instagram Clone/FeedViewController.swift @@ -0,0 +1,162 @@ +// +// FeedViewController.swift +// Instagram Clone +// +// Created by Alex Paul on 3/25/21. +// + +import UIKit +import Parse +import MessageInputBar +class FeedViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, MessageInputBarDelegate { + + let commentBar = MessageInputBar() + var posts = [PFObject]() + var selectedPost:PFObject! + var showComments = false + + @IBOutlet weak var tableView: UITableView! + override func viewDidLoad() { + super.viewDidLoad() + commentBar.inputTextView.placeholder = "Add a comment..." + commentBar.sendButton.title = "Post" + commentBar.delegate = self + + tableView.delegate = self + tableView.dataSource = self + tableView.keyboardDismissMode = .interactive + let center = NotificationCenter.default + center.addObserver(self, selector: #selector(keyboardWillBeHidden(note:)), name: UIResponder.keyboardWillHideNotification, object: nil) + // Do any additional setup after loading the view. + } + @objc func keyboardWillBeHidden(note: Notification) { + commentBar.inputTextView.text = nil + showComments = false; becomeFirstResponder() + + } + + override var inputAccessoryView: UIView? { + return commentBar + } + + override var canBecomeFirstResponder: Bool { + return showComments + } + + + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + let query = PFQuery(className: "Parstagram") + query.includeKeys(["author", "comments", "comments.author"]) + query.limit = 20 + query.findObjectsInBackground { (posts, error) in + if posts != nil { + self.posts = posts! + self.tableView.reloadData() + } + } + + } + func messageInputBar(_ inputBar: MessageInputBar, didPressSendButtonWith text: String) { + let comment = PFObject(className: "Comments") + comment["text"] = text + comment["post"] = selectedPost + comment["author"] = PFUser.current()! + + selectedPost.add(comment, forKey: "comments") + + selectedPost.saveInBackground { (success, error) in + if success{ + print("comment saved") + } else { + print("Error saving comment") + } + } + + tableView.reloadData() + commentBar.inputTextView.text = nil + showComments = false + becomeFirstResponder() + commentBar.inputTextView.resignFirstResponder() + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + let post = posts[section] + let comments = (post["comments"]as? [PFObject]) ?? [] + + return comments.count+1 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let post = posts[indexPath.row] + let comments = (post["comments"]as? [PFObject]) ?? [] + if indexPath.row == 0 { + let cell = tableView.dequeueReusableCell(withIdentifier: "postCell") as! PostTableViewCell + let user = post["author"] as! PFUser + cell.userName.text = user.username + cell.captionLabel.text = post["caption"] as? String + let imageFile = post["image"] as! PFFileObject + let urlString = imageFile.url! + let url = URL(string: urlString)! + cell.pictures.af_setImage(withURL: url) + return cell + } + else if indexPath.row <= comments.count { + let cell = tableView.dequeueReusableCell(withIdentifier: "CommentCell") as! CommentTableViewCell + let comment = comments[indexPath.row - 1] + cell.comment.text = comment["text"] as? String + let user = comment["author"] as! PFUser + cell.name.text = user.username + return cell + + } else { + let cell = tableView.dequeueReusableCell(withIdentifier: "AddCommentCell")! + + return cell + } + + } + + func numberOfSections(in tableView: UITableView) -> Int { + return posts.count + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let post = posts[indexPath.row] + let comment = (post["comments"] as? [PFObject]) ?? [] + + if indexPath.row == comment.count + 1{ + showComments = true + becomeFirstResponder() + commentBar.inputTextView.becomeFirstResponder() + selectedPost = post + } +// comment["text"] = "This is a random" +// comment["post"] = post +// comment["author"] = PFUser.current()! +// +// post.add(comment, forKey: "comments") +// post.saveInBackground { (succes, error) in +// if succes{ +// print("Comment saved") +// } +// else{ +// print("Error saved") +// +// } +// } + + } + + @IBAction func logOut(_ sender: Any) { + PFUser.logOut() + let main = UIStoryboard(name: "Main", bundle: nil) + let loginViewController = main.instantiateViewController(identifier: "LoginViewController") + let delegate = UIApplication.shared.delegate as! AppDelegate + delegate.window?.rootViewController = loginViewController + + } + + + +} diff --git a/Instagram Clone/LoginViewController.swift b/Instagram Clone/LoginViewController.swift new file mode 100644 index 0000000..be443bf --- /dev/null +++ b/Instagram Clone/LoginViewController.swift @@ -0,0 +1,67 @@ +// +// LoginViewController.swift +// Instagram Clone +// +// Created by Alex Paul on 3/25/21. +// + +import UIKit +import Parse + +class LoginViewController: UIViewController { + + @IBOutlet weak var userNameField: UITextField! + @IBOutlet weak var passwordField: UITextField! + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + @IBAction func signUp(_ sender: Any) { + let user = PFUser() + user.username = userNameField.text + user.password = passwordField.text + + user.signUpInBackground{(success,error) in + if success{ + self.performSegue(withIdentifier: "loginSegue", sender: nil) + }else{ + print("Error: \(error?.localizedDescription)") + } + + + } + } + + @IBAction func signIn(_ sender: Any) { + let username = userNameField.text! + let password = passwordField.text! + + PFUser.logInWithUsername(inBackground: username, password: password){ + (user,error) in + if user != nil{ + self.performSegue(withIdentifier: "loginSegue", sender: nil) + + }else{ + print("Error: \(error?.localizedDescription)") + + } + } + + + } + + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/Instagram Clone/PostTableViewCell.swift b/Instagram Clone/PostTableViewCell.swift new file mode 100644 index 0000000..83e579e --- /dev/null +++ b/Instagram Clone/PostTableViewCell.swift @@ -0,0 +1,28 @@ +// +// PostTableViewCell.swift +// Instagram Clone +// +// Created by Alex Paul on 3/26/21. +// + +import UIKit + +class PostTableViewCell: UITableViewCell { + + @IBOutlet weak var pictures: UIImageView! + + @IBOutlet weak var userName: UILabel! + @IBOutlet weak var captionLabel: UILabel! + + 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 + } + +} diff --git a/Instagram Clone/ViewController.swift b/Instagram Clone/ViewController.swift deleted file mode 100644 index 3a9b53a..0000000 --- a/Instagram Clone/ViewController.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ViewController.swift -// Instagram Clone -// -// Created by Alex Paul on 3/25/21. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - -} -