diff --git a/Podfile.lock b/Podfile.lock index 12505e8..8a95b43 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -7,7 +7,7 @@ DEPENDENCIES: - SAMKeychain SPEC REPOS: - trunk: + https://github.com/cocoapods/specs.git: - DVR - SAMKeychain @@ -17,4 +17,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 02c21c317ba9be4fdecdfff242f3fa20e9b269bd -COCOAPODS: 1.8.3 +COCOAPODS: 1.6.1 diff --git a/fakestagram.xcodeproj/project.pbxproj b/fakestagram.xcodeproj/project.pbxproj index fd88dc7..1086c99 100644 --- a/fakestagram.xcodeproj/project.pbxproj +++ b/fakestagram.xcodeproj/project.pbxproj @@ -3,12 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ - 05D8E963168944918FFCC7FF /* Pods_fakestagram.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFAA8B9133CEE464C903FDF5 /* Pods_fakestagram.framework */; }; - D3D164DC7444072103DE027D /* Pods_fakestagramTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E669E31C92D68155914FC99D /* Pods_fakestagramTests.framework */; }; + 28D0BE3723D27A8000405139 /* LikeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D0BE3623D27A8000405139 /* LikeService.swift */; }; + 54D189F025A5E32DA14C4F7F /* Pods_fakestagramTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBFA16EE990A8A2B42FDA0AD /* Pods_fakestagramTests.framework */; }; + 7F5E51AAF41DF1FBD98715A0 /* Pods_fakestagram.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE135418E8AC41512A7F9AA8 /* Pods_fakestagram.framework */; }; E023A5542380859200B13B7D /* NotificationKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = E023A5532380859200B13B7D /* NotificationKeys.swift */; }; E038FCED233FC78600E28571 /* PostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E038FCEC233FC78600E28571 /* PostViewController.swift */; }; E045844923762E10006574FA /* CreatePostService.swift in Sources */ = {isa = PBXBuildFile; fileRef = E045844823762E10006574FA /* CreatePostService.swift */; }; @@ -63,10 +64,12 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 5E0AE2BFBF9C8D81E583E1BE /* Pods-fakestagramTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagramTests.release.xcconfig"; path = "Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests.release.xcconfig"; sourceTree = ""; }; - 66342726A6BCEEEF6289B1AA /* Pods-fakestagramTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagramTests.debug.xcconfig"; path = "Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests.debug.xcconfig"; sourceTree = ""; }; - CCC6C6EA9D17CA169951A745 /* Pods-fakestagram.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagram.release.xcconfig"; path = "Target Support Files/Pods-fakestagram/Pods-fakestagram.release.xcconfig"; sourceTree = ""; }; - DB68F7FEC717545506064663 /* Pods-fakestagram.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagram.debug.xcconfig"; path = "Target Support Files/Pods-fakestagram/Pods-fakestagram.debug.xcconfig"; sourceTree = ""; }; + 28D0BE3623D27A8000405139 /* LikeService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LikeService.swift; sourceTree = ""; }; + 33BF0266B438A4C34F8822D2 /* Pods-fakestagramTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagramTests.release.xcconfig"; path = "Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests.release.xcconfig"; sourceTree = ""; }; + 4CF47B2354F9A611EE09C1FA /* Pods-fakestagramTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagramTests.debug.xcconfig"; path = "Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests.debug.xcconfig"; sourceTree = ""; }; + A3B4C81459FD4BB3E89DB5B0 /* Pods-fakestagram.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagram.release.xcconfig"; path = "Target Support Files/Pods-fakestagram/Pods-fakestagram.release.xcconfig"; sourceTree = ""; }; + CBFA16EE990A8A2B42FDA0AD /* Pods_fakestagramTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fakestagramTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D54838DD49CAE58A39086B99 /* Pods-fakestagram.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fakestagram.debug.xcconfig"; path = "Target Support Files/Pods-fakestagram/Pods-fakestagram.debug.xcconfig"; sourceTree = ""; }; E023A5532380859200B13B7D /* NotificationKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationKeys.swift; sourceTree = ""; }; E038FCEC233FC78600E28571 /* PostViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostViewController.swift; sourceTree = ""; }; E045844823762E10006574FA /* CreatePostService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatePostService.swift; sourceTree = ""; }; @@ -114,8 +117,7 @@ E0E8B970234916D100DA9D1A /* RestClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestClient.swift; sourceTree = ""; }; E0E8B973234918FF00DA9D1A /* Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = ""; }; E0E8B9752349197100DA9D1A /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = ""; }; - E669E31C92D68155914FC99D /* Pods_fakestagramTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fakestagramTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FFAA8B9133CEE464C903FDF5 /* Pods_fakestagram.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fakestagram.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EE135418E8AC41512A7F9AA8 /* Pods_fakestagram.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fakestagram.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -123,7 +125,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 05D8E963168944918FFCC7FF /* Pods_fakestagram.framework in Frameworks */, + 7F5E51AAF41DF1FBD98715A0 /* Pods_fakestagram.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -131,7 +133,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D3D164DC7444072103DE027D /* Pods_fakestagramTests.framework in Frameworks */, + 54D189F025A5E32DA14C4F7F /* Pods_fakestagramTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -141,19 +143,29 @@ 01A08896D7765C060714CF7E /* Pods */ = { isa = PBXGroup; children = ( - DB68F7FEC717545506064663 /* Pods-fakestagram.debug.xcconfig */, - CCC6C6EA9D17CA169951A745 /* Pods-fakestagram.release.xcconfig */, - 66342726A6BCEEEF6289B1AA /* Pods-fakestagramTests.debug.xcconfig */, - 5E0AE2BFBF9C8D81E583E1BE /* Pods-fakestagramTests.release.xcconfig */, + D54838DD49CAE58A39086B99 /* Pods-fakestagram.debug.xcconfig */, + A3B4C81459FD4BB3E89DB5B0 /* Pods-fakestagram.release.xcconfig */, + 4CF47B2354F9A611EE09C1FA /* Pods-fakestagramTests.debug.xcconfig */, + 33BF0266B438A4C34F8822D2 /* Pods-fakestagramTests.release.xcconfig */, ); path = Pods; sourceTree = ""; }; + 1F7846066A73DF08DD6A4D2A /* Frameworks */ = { + isa = PBXGroup; + children = ( + EE135418E8AC41512A7F9AA8 /* Pods_fakestagram.framework */, + CBFA16EE990A8A2B42FDA0AD /* Pods_fakestagramTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; E045844723762DF8006574FA /* Services */ = { isa = PBXGroup; children = ( E045844823762E10006574FA /* CreatePostService.swift */, E0458456237725B9006574FA /* IndexService.swift */, + 28D0BE3623D27A8000405139 /* LikeService.swift */, ); path = Services; sourceTree = ""; @@ -165,7 +177,7 @@ E084FAEF233A8735009AC50D /* fakestagramTests */, E084FAD7233A8734009AC50D /* Products */, 01A08896D7765C060714CF7E /* Pods */, - E59E91806B162F48B9F21B96 /* Frameworks */, + 1F7846066A73DF08DD6A4D2A /* Frameworks */, ); sourceTree = ""; }; @@ -292,15 +304,6 @@ path = Models; sourceTree = ""; }; - E59E91806B162F48B9F21B96 /* Frameworks */ = { - isa = PBXGroup; - children = ( - FFAA8B9133CEE464C903FDF5 /* Pods_fakestagram.framework */, - E669E31C92D68155914FC99D /* Pods_fakestagramTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -308,11 +311,11 @@ isa = PBXNativeTarget; buildConfigurationList = E084FAF5233A8735009AC50D /* Build configuration list for PBXNativeTarget "fakestagram" */; buildPhases = ( - 4AE804DBB1C330BBDB1A4587 /* [CP] Check Pods Manifest.lock */, + 10D25CDFD7800AC672D965C7 /* [CP] Check Pods Manifest.lock */, E084FAD2233A8734009AC50D /* Sources */, E084FAD3233A8734009AC50D /* Frameworks */, E084FAD4233A8734009AC50D /* Resources */, - BA44E9C49B033049A720850E /* [CP] Embed Pods Frameworks */, + ABA5A5E0372499ADC6BF594D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -327,11 +330,11 @@ isa = PBXNativeTarget; buildConfigurationList = E084FAF8233A8735009AC50D /* Build configuration list for PBXNativeTarget "fakestagramTests" */; buildPhases = ( - 9C7D5FC48E01207A73A3C357 /* [CP] Check Pods Manifest.lock */, + 4C9C2241663EB0574E05E413 /* [CP] Check Pods Manifest.lock */, E084FAE8233A8735009AC50D /* Sources */, E084FAE9233A8735009AC50D /* Frameworks */, E084FAEA233A8735009AC50D /* Resources */, - 7AA77609E4963F9B91BB29FB /* [CP] Embed Pods Frameworks */, + A315CCF98FBD62FC91CC2BC3 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -407,7 +410,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 4AE804DBB1C330BBDB1A4587 /* [CP] Check Pods Manifest.lock */ = { + 10D25CDFD7800AC672D965C7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -429,24 +432,29 @@ 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; }; - 7AA77609E4963F9B91BB29FB /* [CP] Embed Pods Frameworks */ = { + 4C9C2241663EB0574E05E413 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-fakestagramTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests-frameworks.sh\"\n"; + 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; }; - 9C7D5FC48E01207A73A3C357 /* [CP] Check Pods Manifest.lock */ = { + A315CCF98FBD62FC91CC2BC3 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -454,31 +462,36 @@ inputFileListPaths = ( ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", + "${PODS_ROOT}/Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/DVR/DVR.framework", ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-fakestagramTests-checkManifestLockResult.txt", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DVR.framework", ); 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"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-fakestagramTests/Pods-fakestagramTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - BA44E9C49B033049A720850E /* [CP] Embed Pods Frameworks */ = { + ABA5A5E0372499ADC6BF594D /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-fakestagram/Pods-fakestagram-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-fakestagram/Pods-fakestagram-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/SAMKeychain/SAMKeychain.framework", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-fakestagram/Pods-fakestagram-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SAMKeychain.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -494,6 +507,7 @@ files = ( E0C93EA42352452900FD330C /* AuthorView.swift in Sources */, E0E2545F235A9F3A00C55767 /* UIDevice+models.swift in Sources */, + 28D0BE3723D27A8000405139 /* LikeService.swift in Sources */, E0E8B96A23481D5A00DA9D1A /* StatusCode.swift in Sources */, E045845123766203006574FA /* CacheImage.swift in Sources */, E045844B237652DD006574FA /* StorageType.swift in Sources */, @@ -684,19 +698,21 @@ }; E084FAF6233A8735009AC50D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DB68F7FEC717545506064663 /* Pods-fakestagram.debug.xcconfig */; + baseConfigurationReference = D54838DD49CAE58A39086B99 /* Pods-fakestagram.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = D3XL2U7DQC; + DEVELOPMENT_TEAM = F43J4XYW8F; INFOPLIST_FILE = fakestagram/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.3zcurdia.fakestagram; + PRODUCT_BUNDLE_IDENTIFIER = mx.com.diplomado.ios.fakestagram; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "fakestagram/fakestagram-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -706,19 +722,21 @@ }; E084FAF7233A8735009AC50D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CCC6C6EA9D17CA169951A745 /* Pods-fakestagram.release.xcconfig */; + baseConfigurationReference = A3B4C81459FD4BB3E89DB5B0 /* Pods-fakestagram.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = D3XL2U7DQC; + DEVELOPMENT_TEAM = F43J4XYW8F; INFOPLIST_FILE = fakestagram/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.3zcurdia.fakestagram; + PRODUCT_BUNDLE_IDENTIFIER = mx.com.diplomado.ios.fakestagram; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "fakestagram/fakestagram-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -727,7 +745,7 @@ }; E084FAF9233A8735009AC50D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 66342726A6BCEEEF6289B1AA /* Pods-fakestagramTests.debug.xcconfig */; + baseConfigurationReference = 4CF47B2354F9A611EE09C1FA /* Pods-fakestagramTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -750,7 +768,7 @@ }; E084FAFA233A8735009AC50D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5E0AE2BFBF9C8D81E583E1BE /* Pods-fakestagramTests.release.xcconfig */; + baseConfigurationReference = 33BF0266B438A4C34F8822D2 /* Pods-fakestagramTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; diff --git a/fakestagram/AppDelegate.swift b/fakestagram/AppDelegate.swift index 2660552..baa854a 100644 --- a/fakestagram/AppDelegate.swift +++ b/fakestagram/AppDelegate.swift @@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func loadOrCreateAccount() { if Credentials.apiToken.get() != nil { return } - let account = Account(id: nil, name: "Juan Camaney", deviceNumber: UIDevice.identifier, deviceModel: UIDevice.modelName) + let account = Account(id: nil, name: "Jules LeGrand", deviceNumber: UIDevice.identifier, deviceModel: UIDevice.modelName) let client = RestClient(client: Client.fakestagram, basePath: "/api/v1/accounts") client.create(account) { account in guard let account = account, let idx = account.id else { return } diff --git a/fakestagram/Info.plist b/fakestagram/Info.plist index d1b73e7..8749ebb 100644 --- a/fakestagram/Info.plist +++ b/fakestagram/Info.plist @@ -23,7 +23,7 @@ NSCameraUsageDescription To capture your favorite moments and share with the world NSLocationWhenInUseUsageDescription - Geololcalize your moments + Geolocalize your moments UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/fakestagram/Services/LikeService.swift b/fakestagram/Services/LikeService.swift new file mode 100644 index 0000000..f40f73d --- /dev/null +++ b/fakestagram/Services/LikeService.swift @@ -0,0 +1,30 @@ +// +// LikeService.swift +// fakestagram +// +// Created by Ago Moviles on 1/17/20. +// Copyright © 2020 3zcurdia. All rights reserved. +// + +import Foundation + +struct CreatingLike: Codable { + let id: Int? +} + +class LikeService { + + func call(id: Int?, success: @escaping (Int?) -> Void) { + + let newLike = CreatingLike(id:id) + let client = RestClient(client: Client.fakestagram, basePath: "/api/v1/posts/ \(newLike.id!)/like") + + debugPrint("In Like Service, id: \(newLike.id!)") + + client.create(newLike) { post in + NotificationCenter.default.post(name: NotificationKeys.didFinishPostCreation.value, object: nil) + success(post?.id) + } + } + +} diff --git a/fakestagram/Views/PostCollectionViewCell.swift b/fakestagram/Views/PostCollectionViewCell.swift index 1d5be7b..1d8a325 100644 --- a/fakestagram/Views/PostCollectionViewCell.swift +++ b/fakestagram/Views/PostCollectionViewCell.swift @@ -38,5 +38,16 @@ class PostCollectionViewCell: UICollectionViewCell { self.imageView.image = img } } + + @IBAction func tapLikeBtn(sender: UIButton) { + debugPrint("Picaste!!!") + let service = LikeService() + guard let post = self.post else { + return + } + service.call(id: post.id!) { postId in + debugPrint(postId ?? -2) + } + } } diff --git a/fakestagram/Views/PostCollectionViewCell.xib b/fakestagram/Views/PostCollectionViewCell.xib index afff929..732fc5c 100644 --- a/fakestagram/Views/PostCollectionViewCell.xib +++ b/fakestagram/Views/PostCollectionViewCell.xib @@ -1,8 +1,8 @@ - + - + @@ -36,6 +36,9 @@