#4 [master->master] iOSGiphyCodeChallenge

Closed
IrinaSmokvarska wants to merge 4 commits from IrinaSmokvarska/master into LiveLike/master
32 changed files with 1273 additions and 802 deletions
  1. 0 611
      LiveLikeGiphyChallenge.xcodeproj/project.pbxproj
  2. BIN
      LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/xcuserdata/mike.xcuserdatad/UserInterfaceState.xcuserstate
  3. 0 35
      LiveLikeGiphyChallenge/AppDelegate.swift
  4. 0 25
      LiveLikeGiphyChallenge/Base.lproj/LaunchScreen.storyboard
  5. 0 23
      LiveLikeGiphyChallenge/Info.plist
  6. 681 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.pbxproj
  7. 0 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  8. 0 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  9. BIN
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/xcuserdata/irinasmokvarska.xcuserdatad/UserInterfaceState.xcuserstate
  10. 0 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/xcuserdata/irinasmokvarska.xcuserdatad/xcschemes/xcschememanagement.plist
  11. 15 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/Constants.swift
  12. 64 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/FetchGiphyAPI.swift
  13. 18 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/GiphyError.swift
  14. 52 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/GiphyResponse.swift
  15. 18 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/GiphyTrendingRequest.swift
  16. 98 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/Storage.swift
  17. 0 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Assets.xcassets/AccentColor.colorset/Contents.json
  18. 0 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Assets.xcassets/AppIcon.appiconset/Contents.json
  19. 0 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Assets.xcassets/Contents.json
  20. 44 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/ContentView.swift
  21. 16 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/GiphyItemRow.swift
  22. 17 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/LiveLikeGiphyChallengeApp.swift
  23. 83 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/MainViewModel.swift
  24. 6 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Preview Content/Preview Assets.xcassets/Contents.json
  25. 39 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Views/GifImage.swift
  26. 80 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallengeTests/LiveLikeGiphyChallengeTests.swift
  27. 40 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallengeTests/MockURLProtocol.swift
  28. 1 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallengeUITests/LiveLikeGiphyChallengeUITests.swift
  29. 1 0
      LiveLikeGiphyChallenge/LiveLikeGiphyChallengeUITests/LiveLikeGiphyChallengeUITestsLaunchTests.swift
  30. 0 57
      LiveLikeGiphyChallenge/SceneDelegate.swift
  31. 0 19
      LiveLikeGiphyChallenge/ViewController.swift
  32. 0 32
      LiveLikeGiphyChallengeTests/LiveLikeGiphyChallengeTests.swift

+ 0 - 611
LiveLikeGiphyChallenge.xcodeproj/project.pbxproj

@@ -1,611 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 55;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		2707607F276409C000064F59 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2707607E276409C000064F59 /* AppDelegate.swift */; };
-		27076081276409C000064F59 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27076080276409C000064F59 /* SceneDelegate.swift */; };
-		27076083276409C000064F59 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27076082276409C000064F59 /* ViewController.swift */; };
-		27076088276409C200064F59 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 27076087276409C200064F59 /* Assets.xcassets */; };
-		2707608B276409C200064F59 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27076089276409C200064F59 /* LaunchScreen.storyboard */; };
-		27076096276409C300064F59 /* LiveLikeGiphyChallengeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27076095276409C300064F59 /* LiveLikeGiphyChallengeTests.swift */; };
-		270760A0276409C300064F59 /* LiveLikeGiphyChallengeUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2707609F276409C300064F59 /* LiveLikeGiphyChallengeUITests.swift */; };
-		270760A2276409C300064F59 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270760A1276409C300064F59 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-		27076092276409C300064F59 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 27076073276409C000064F59 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 2707607A276409C000064F59;
-			remoteInfo = LiveLikeGiphyChallenge;
-		};
-		2707609C276409C300064F59 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 27076073276409C000064F59 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 2707607A276409C000064F59;
-			remoteInfo = LiveLikeGiphyChallenge;
-		};
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
-		2707607B276409C000064F59 /* LiveLikeGiphyChallenge.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LiveLikeGiphyChallenge.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		2707607E276409C000064F59 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
-		27076080276409C000064F59 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
-		27076082276409C000064F59 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
-		27076087276409C200064F59 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
-		2707608A276409C200064F59 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
-		2707608C276409C200064F59 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		27076091276409C300064F59 /* LiveLikeGiphyChallengeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LiveLikeGiphyChallengeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
-		27076095276409C300064F59 /* LiveLikeGiphyChallengeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLikeGiphyChallengeTests.swift; sourceTree = "<group>"; };
-		2707609B276409C300064F59 /* LiveLikeGiphyChallengeUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LiveLikeGiphyChallengeUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
-		2707609F276409C300064F59 /* LiveLikeGiphyChallengeUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLikeGiphyChallengeUITests.swift; sourceTree = "<group>"; };
-		270760A1276409C300064F59 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLikeGiphyChallengeUITestsLaunchTests.swift; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		27076078276409C000064F59 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		2707608E276409C300064F59 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		27076098276409C300064F59 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		27076072276409C000064F59 = {
-			isa = PBXGroup;
-			children = (
-				2707607D276409C000064F59 /* LiveLikeGiphyChallenge */,
-				27076094276409C300064F59 /* LiveLikeGiphyChallengeTests */,
-				2707609E276409C300064F59 /* LiveLikeGiphyChallengeUITests */,
-				2707607C276409C000064F59 /* Products */,
-			);
-			sourceTree = "<group>";
-		};
-		2707607C276409C000064F59 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				2707607B276409C000064F59 /* LiveLikeGiphyChallenge.app */,
-				27076091276409C300064F59 /* LiveLikeGiphyChallengeTests.xctest */,
-				2707609B276409C300064F59 /* LiveLikeGiphyChallengeUITests.xctest */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		2707607D276409C000064F59 /* LiveLikeGiphyChallenge */ = {
-			isa = PBXGroup;
-			children = (
-				2707607E276409C000064F59 /* AppDelegate.swift */,
-				27076080276409C000064F59 /* SceneDelegate.swift */,
-				27076082276409C000064F59 /* ViewController.swift */,
-				27076087276409C200064F59 /* Assets.xcassets */,
-				27076089276409C200064F59 /* LaunchScreen.storyboard */,
-				2707608C276409C200064F59 /* Info.plist */,
-			);
-			path = LiveLikeGiphyChallenge;
-			sourceTree = "<group>";
-		};
-		27076094276409C300064F59 /* LiveLikeGiphyChallengeTests */ = {
-			isa = PBXGroup;
-			children = (
-				27076095276409C300064F59 /* LiveLikeGiphyChallengeTests.swift */,
-			);
-			path = LiveLikeGiphyChallengeTests;
-			sourceTree = "<group>";
-		};
-		2707609E276409C300064F59 /* LiveLikeGiphyChallengeUITests */ = {
-			isa = PBXGroup;
-			children = (
-				2707609F276409C300064F59 /* LiveLikeGiphyChallengeUITests.swift */,
-				270760A1276409C300064F59 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift */,
-			);
-			path = LiveLikeGiphyChallengeUITests;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		2707607A276409C000064F59 /* LiveLikeGiphyChallenge */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 270760A5276409C300064F59 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallenge" */;
-			buildPhases = (
-				27076077276409C000064F59 /* Sources */,
-				27076078276409C000064F59 /* Frameworks */,
-				27076079276409C000064F59 /* Resources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = LiveLikeGiphyChallenge;
-			productName = LiveLikeGiphyChallenge;
-			productReference = 2707607B276409C000064F59 /* LiveLikeGiphyChallenge.app */;
-			productType = "com.apple.product-type.application";
-		};
-		27076090276409C300064F59 /* LiveLikeGiphyChallengeTests */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 270760A8276409C300064F59 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeTests" */;
-			buildPhases = (
-				2707608D276409C300064F59 /* Sources */,
-				2707608E276409C300064F59 /* Frameworks */,
-				2707608F276409C300064F59 /* Resources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-				27076093276409C300064F59 /* PBXTargetDependency */,
-			);
-			name = LiveLikeGiphyChallengeTests;
-			productName = LiveLikeGiphyChallengeTests;
-			productReference = 27076091276409C300064F59 /* LiveLikeGiphyChallengeTests.xctest */;
-			productType = "com.apple.product-type.bundle.unit-test";
-		};
-		2707609A276409C300064F59 /* LiveLikeGiphyChallengeUITests */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 270760AB276409C300064F59 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeUITests" */;
-			buildPhases = (
-				27076097276409C300064F59 /* Sources */,
-				27076098276409C300064F59 /* Frameworks */,
-				27076099276409C300064F59 /* Resources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-				2707609D276409C300064F59 /* PBXTargetDependency */,
-			);
-			name = LiveLikeGiphyChallengeUITests;
-			productName = LiveLikeGiphyChallengeUITests;
-			productReference = 2707609B276409C300064F59 /* LiveLikeGiphyChallengeUITests.xctest */;
-			productType = "com.apple.product-type.bundle.ui-testing";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		27076073276409C000064F59 /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				BuildIndependentTargetsInParallel = 1;
-				LastSwiftUpdateCheck = 1310;
-				LastUpgradeCheck = 1310;
-				TargetAttributes = {
-					2707607A276409C000064F59 = {
-						CreatedOnToolsVersion = 13.1;
-					};
-					27076090276409C300064F59 = {
-						CreatedOnToolsVersion = 13.1;
-						TestTargetID = 2707607A276409C000064F59;
-					};
-					2707609A276409C300064F59 = {
-						CreatedOnToolsVersion = 13.1;
-						TestTargetID = 2707607A276409C000064F59;
-					};
-				};
-			};
-			buildConfigurationList = 27076076276409C000064F59 /* Build configuration list for PBXProject "LiveLikeGiphyChallenge" */;
-			compatibilityVersion = "Xcode 13.0";
-			developmentRegion = en;
-			hasScannedForEncodings = 0;
-			knownRegions = (
-				en,
-				Base,
-			);
-			mainGroup = 27076072276409C000064F59;
-			productRefGroup = 2707607C276409C000064F59 /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				2707607A276409C000064F59 /* LiveLikeGiphyChallenge */,
-				27076090276409C300064F59 /* LiveLikeGiphyChallengeTests */,
-				2707609A276409C300064F59 /* LiveLikeGiphyChallengeUITests */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-		27076079276409C000064F59 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				2707608B276409C200064F59 /* LaunchScreen.storyboard in Resources */,
-				27076088276409C200064F59 /* Assets.xcassets in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		2707608F276409C300064F59 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		27076099276409C300064F59 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		27076077276409C000064F59 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				27076083276409C000064F59 /* ViewController.swift in Sources */,
-				2707607F276409C000064F59 /* AppDelegate.swift in Sources */,
-				27076081276409C000064F59 /* SceneDelegate.swift in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		2707608D276409C300064F59 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				27076096276409C300064F59 /* LiveLikeGiphyChallengeTests.swift in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		27076097276409C300064F59 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				270760A0276409C300064F59 /* LiveLikeGiphyChallengeUITests.swift in Sources */,
-				270760A2276409C300064F59 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
-		27076093276409C300064F59 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 2707607A276409C000064F59 /* LiveLikeGiphyChallenge */;
-			targetProxy = 27076092276409C300064F59 /* PBXContainerItemProxy */;
-		};
-		2707609D276409C300064F59 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 2707607A276409C000064F59 /* LiveLikeGiphyChallenge */;
-			targetProxy = 2707609C276409C300064F59 /* PBXContainerItemProxy */;
-		};
-/* End PBXTargetDependency section */
-
-/* Begin PBXVariantGroup section */
-		27076089276409C200064F59 /* LaunchScreen.storyboard */ = {
-			isa = PBXVariantGroup;
-			children = (
-				2707608A276409C200064F59 /* Base */,
-			);
-			name = LaunchScreen.storyboard;
-			sourceTree = "<group>";
-		};
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
-		270760A3276409C300064F59 /* 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_CXX_LIBRARY = "libc++";
-				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.0;
-				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;
-		};
-		270760A4276409C300064F59 /* 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_CXX_LIBRARY = "libc++";
-				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.0;
-				MTL_ENABLE_DEBUG_INFO = NO;
-				MTL_FAST_MATH = YES;
-				SDKROOT = iphoneos;
-				SWIFT_COMPILATION_MODE = wholemodule;
-				SWIFT_OPTIMIZATION_LEVEL = "-O";
-				VALIDATE_PRODUCT = YES;
-			};
-			name = Release;
-		};
-		270760A6276409C300064F59 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_FILE = LiveLikeGiphyChallenge/Info.plist;
-				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
-				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
-				INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown";
-				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 = com.livelike.LiveLikeGiphyChallenge;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = 1;
-			};
-			name = Debug;
-		};
-		270760A7276409C300064F59 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_FILE = LiveLikeGiphyChallenge/Info.plist;
-				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
-				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
-				INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown";
-				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 = com.livelike.LiveLikeGiphyChallenge;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = 1;
-			};
-			name = Release;
-		};
-		270760A9276409C300064F59 /* 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.0;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-					"@loader_path/Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallengeTests;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = NO;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1,2";
-				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LiveLikeGiphyChallenge.app/LiveLikeGiphyChallenge";
-			};
-			name = Debug;
-		};
-		270760AA276409C300064F59 /* 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.0;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-					"@loader_path/Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallengeTests;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = NO;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1,2";
-				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LiveLikeGiphyChallenge.app/LiveLikeGiphyChallenge";
-			};
-			name = Release;
-		};
-		270760AC276409C300064F59 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				GENERATE_INFOPLIST_FILE = YES;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-					"@loader_path/Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallengeUITests;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = NO;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1,2";
-				TEST_TARGET_NAME = LiveLikeGiphyChallenge;
-			};
-			name = Debug;
-		};
-		270760AD276409C300064F59 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				GENERATE_INFOPLIST_FILE = YES;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-					"@loader_path/Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallengeUITests;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = NO;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1,2";
-				TEST_TARGET_NAME = LiveLikeGiphyChallenge;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		27076076276409C000064F59 /* Build configuration list for PBXProject "LiveLikeGiphyChallenge" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				270760A3276409C300064F59 /* Debug */,
-				270760A4276409C300064F59 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		270760A5276409C300064F59 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallenge" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				270760A6276409C300064F59 /* Debug */,
-				270760A7276409C300064F59 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		270760A8276409C300064F59 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeTests" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				270760A9276409C300064F59 /* Debug */,
-				270760AA276409C300064F59 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		270760AB276409C300064F59 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeUITests" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				270760AC276409C300064F59 /* Debug */,
-				270760AD276409C300064F59 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 27076073276409C000064F59 /* Project object */;
-}

BIN
LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/xcuserdata/mike.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 35
LiveLikeGiphyChallenge/AppDelegate.swift

@@ -1,35 +0,0 @@
-//
-//  AppDelegate.swift
-//  LiveLikeGiphyChallenge
-//
-//
-
-import UIKit
-
-@main
-class AppDelegate: UIResponder, UIApplicationDelegate {
-
-
-
-    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
-        // Override point for customization after application launch.
-        return true
-    }
-
-    // MARK: UISceneSession Lifecycle
-
-    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
-        // Called when a new scene session is being created.
-        // Use this method to select a configuration to create the new scene with.
-        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
-    }
-
-    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
-        // 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.
-    }
-
-
-}
-

+ 0 - 25
LiveLikeGiphyChallenge/Base.lproj/LaunchScreen.storyboard

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
-    <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <scenes>
-        <!--View Controller-->
-        <scene sceneID="EHf-IW-A2E">
-            <objects>
-                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
-                        <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
-                    </view>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="53" y="375"/>
-        </scene>
-    </scenes>
-</document>

+ 0 - 23
LiveLikeGiphyChallenge/Info.plist

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>UIApplicationSceneManifest</key>
-	<dict>
-		<key>UIApplicationSupportsMultipleScenes</key>
-		<false/>
-		<key>UISceneConfigurations</key>
-		<dict>
-			<key>UIWindowSceneSessionRoleApplication</key>
-			<array>
-				<dict>
-					<key>UISceneConfigurationName</key>
-					<string>Default Configuration</string>
-					<key>UISceneDelegateClassName</key>
-					<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
-				</dict>
-			</array>
-		</dict>
-	</dict>
-</dict>
-</plist>

+ 681 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.pbxproj

@@ -0,0 +1,681 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 55;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		CE2BD90F27A7069E001C6E22 /* LiveLikeGiphyChallengeApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD90E27A7069E001C6E22 /* LiveLikeGiphyChallengeApp.swift */; };
+		CE2BD91127A7069E001C6E22 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD91027A7069E001C6E22 /* ContentView.swift */; };
+		CE2BD91327A706A8001C6E22 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE2BD91227A706A8001C6E22 /* Assets.xcassets */; };
+		CE2BD91627A706A8001C6E22 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE2BD91527A706A8001C6E22 /* Preview Assets.xcassets */; };
+		CE2BD92027A706A9001C6E22 /* LiveLikeGiphyChallengeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD91F27A706A9001C6E22 /* LiveLikeGiphyChallengeTests.swift */; };
+		CE2BD92A27A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD92927A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.swift */; };
+		CE2BD92C27A706A9001C6E22 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD92B27A706A9001C6E22 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift */; };
+		CE2BD93927A70791001C6E22 /* MainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD93827A70791001C6E22 /* MainViewModel.swift */; };
+		CE2BD94527A718AD001C6E22 /* FetchGiphyAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD94427A718AD001C6E22 /* FetchGiphyAPI.swift */; };
+		CE2BD94727A718D6001C6E22 /* GiphyTrendingRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD94627A718D6001C6E22 /* GiphyTrendingRequest.swift */; };
+		CE2BD94927A719A0001C6E22 /* GiphyResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD94827A719A0001C6E22 /* GiphyResponse.swift */; };
+		CE2BD94B27A71DD4001C6E22 /* GiphyError.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD94A27A71DD4001C6E22 /* GiphyError.swift */; };
+		CE2BD94F27A744D8001C6E22 /* GifImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD94E27A744D8001C6E22 /* GifImage.swift */; };
+		CE2BD95127A75254001C6E22 /* GiphyItemRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2BD95027A75254001C6E22 /* GiphyItemRow.swift */; };
+		CE2C188127A7E41400CD5D9D /* SwiftyGif in Frameworks */ = {isa = PBXBuildFile; productRef = CE2C188027A7E41400CD5D9D /* SwiftyGif */; };
+		CE2C188727A81CD400CD5D9D /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2C188627A81CD400CD5D9D /* Storage.swift */; };
+		CE2D85D727A9D4D100419922 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2D85D627A9D4D100419922 /* Constants.swift */; };
+		CE2D85D827A9D67300419922 /* MockURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2D85D427A9D47200419922 /* MockURLProtocol.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+		CE2BD91C27A706A9001C6E22 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = CE2BD90327A7069E001C6E22 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = CE2BD90A27A7069E001C6E22;
+			remoteInfo = LiveLikeGiphyChallenge;
+		};
+		CE2BD92627A706A9001C6E22 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = CE2BD90327A7069E001C6E22 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = CE2BD90A27A7069E001C6E22;
+			remoteInfo = LiveLikeGiphyChallenge;
+		};
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+		CE2BD90B27A7069E001C6E22 /* LiveLikeGiphyChallenge.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LiveLikeGiphyChallenge.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		CE2BD90E27A7069E001C6E22 /* LiveLikeGiphyChallengeApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLikeGiphyChallengeApp.swift; sourceTree = "<group>"; };
+		CE2BD91027A7069E001C6E22 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
+		CE2BD91227A706A8001C6E22 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+		CE2BD91527A706A8001C6E22 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
+		CE2BD91B27A706A9001C6E22 /* LiveLikeGiphyChallengeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LiveLikeGiphyChallengeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		CE2BD91F27A706A9001C6E22 /* LiveLikeGiphyChallengeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLikeGiphyChallengeTests.swift; sourceTree = "<group>"; };
+		CE2BD92527A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LiveLikeGiphyChallengeUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		CE2BD92927A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLikeGiphyChallengeUITests.swift; sourceTree = "<group>"; };
+		CE2BD92B27A706A9001C6E22 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveLikeGiphyChallengeUITestsLaunchTests.swift; sourceTree = "<group>"; };
+		CE2BD93827A70791001C6E22 /* MainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewModel.swift; sourceTree = "<group>"; };
+		CE2BD94427A718AD001C6E22 /* FetchGiphyAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchGiphyAPI.swift; sourceTree = "<group>"; };
+		CE2BD94627A718D6001C6E22 /* GiphyTrendingRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiphyTrendingRequest.swift; sourceTree = "<group>"; };
+		CE2BD94827A719A0001C6E22 /* GiphyResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiphyResponse.swift; sourceTree = "<group>"; };
+		CE2BD94A27A71DD4001C6E22 /* GiphyError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiphyError.swift; sourceTree = "<group>"; };
+		CE2BD94E27A744D8001C6E22 /* GifImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifImage.swift; sourceTree = "<group>"; };
+		CE2BD95027A75254001C6E22 /* GiphyItemRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiphyItemRow.swift; sourceTree = "<group>"; };
+		CE2C188627A81CD400CD5D9D /* Storage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = "<group>"; };
+		CE2D85D427A9D47200419922 /* MockURLProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockURLProtocol.swift; sourceTree = "<group>"; };
+		CE2D85D627A9D4D100419922 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		CE2BD90827A7069E001C6E22 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CE2C188127A7E41400CD5D9D /* SwiftyGif in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		CE2BD91827A706A9001C6E22 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		CE2BD92227A706A9001C6E22 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		CE2BD90227A7069E001C6E22 = {
+			isa = PBXGroup;
+			children = (
+				CE2BD90D27A7069E001C6E22 /* LiveLikeGiphyChallenge */,
+				CE2BD91E27A706A9001C6E22 /* LiveLikeGiphyChallengeTests */,
+				CE2BD92827A706A9001C6E22 /* LiveLikeGiphyChallengeUITests */,
+				CE2BD90C27A7069E001C6E22 /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		CE2BD90C27A7069E001C6E22 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				CE2BD90B27A7069E001C6E22 /* LiveLikeGiphyChallenge.app */,
+				CE2BD91B27A706A9001C6E22 /* LiveLikeGiphyChallengeTests.xctest */,
+				CE2BD92527A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.xctest */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		CE2BD90D27A7069E001C6E22 /* LiveLikeGiphyChallenge */ = {
+			isa = PBXGroup;
+			children = (
+				CE2BD94327A71899001C6E22 /* API */,
+				CE2BD93B27A707F7001C6E22 /* Views */,
+				CE2BD93A27A707EB001C6E22 /* MainScreen */,
+				CE2BD91227A706A8001C6E22 /* Assets.xcassets */,
+				CE2BD91427A706A8001C6E22 /* Preview Content */,
+			);
+			path = LiveLikeGiphyChallenge;
+			sourceTree = "<group>";
+		};
+		CE2BD91427A706A8001C6E22 /* Preview Content */ = {
+			isa = PBXGroup;
+			children = (
+				CE2BD91527A706A8001C6E22 /* Preview Assets.xcassets */,
+			);
+			path = "Preview Content";
+			sourceTree = "<group>";
+		};
+		CE2BD91E27A706A9001C6E22 /* LiveLikeGiphyChallengeTests */ = {
+			isa = PBXGroup;
+			children = (
+				CE2D85D427A9D47200419922 /* MockURLProtocol.swift */,
+				CE2BD91F27A706A9001C6E22 /* LiveLikeGiphyChallengeTests.swift */,
+			);
+			path = LiveLikeGiphyChallengeTests;
+			sourceTree = "<group>";
+		};
+		CE2BD92827A706A9001C6E22 /* LiveLikeGiphyChallengeUITests */ = {
+			isa = PBXGroup;
+			children = (
+				CE2BD92927A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.swift */,
+				CE2BD92B27A706A9001C6E22 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift */,
+			);
+			path = LiveLikeGiphyChallengeUITests;
+			sourceTree = "<group>";
+		};
+		CE2BD93A27A707EB001C6E22 /* MainScreen */ = {
+			isa = PBXGroup;
+			children = (
+				CE2BD90E27A7069E001C6E22 /* LiveLikeGiphyChallengeApp.swift */,
+				CE2BD91027A7069E001C6E22 /* ContentView.swift */,
+				CE2BD93827A70791001C6E22 /* MainViewModel.swift */,
+				CE2BD95027A75254001C6E22 /* GiphyItemRow.swift */,
+			);
+			path = MainScreen;
+			sourceTree = "<group>";
+		};
+		CE2BD93B27A707F7001C6E22 /* Views */ = {
+			isa = PBXGroup;
+			children = (
+				CE2BD94E27A744D8001C6E22 /* GifImage.swift */,
+			);
+			path = Views;
+			sourceTree = "<group>";
+		};
+		CE2BD94327A71899001C6E22 /* API */ = {
+			isa = PBXGroup;
+			children = (
+				CE2C188627A81CD400CD5D9D /* Storage.swift */,
+				CE2BD94427A718AD001C6E22 /* FetchGiphyAPI.swift */,
+				CE2BD94627A718D6001C6E22 /* GiphyTrendingRequest.swift */,
+				CE2BD94827A719A0001C6E22 /* GiphyResponse.swift */,
+				CE2BD94A27A71DD4001C6E22 /* GiphyError.swift */,
+				CE2D85D627A9D4D100419922 /* Constants.swift */,
+			);
+			path = API;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		CE2BD90A27A7069E001C6E22 /* LiveLikeGiphyChallenge */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = CE2BD92F27A706A9001C6E22 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallenge" */;
+			buildPhases = (
+				CE2BD90727A7069E001C6E22 /* Sources */,
+				CE2BD90827A7069E001C6E22 /* Frameworks */,
+				CE2BD90927A7069E001C6E22 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = LiveLikeGiphyChallenge;
+			packageProductDependencies = (
+				CE2C188027A7E41400CD5D9D /* SwiftyGif */,
+			);
+			productName = LiveLikeGiphyChallenge;
+			productReference = CE2BD90B27A7069E001C6E22 /* LiveLikeGiphyChallenge.app */;
+			productType = "com.apple.product-type.application";
+		};
+		CE2BD91A27A706A9001C6E22 /* LiveLikeGiphyChallengeTests */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = CE2BD93227A706A9001C6E22 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeTests" */;
+			buildPhases = (
+				CE2BD91727A706A9001C6E22 /* Sources */,
+				CE2BD91827A706A9001C6E22 /* Frameworks */,
+				CE2BD91927A706A9001C6E22 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				CE2BD91D27A706A9001C6E22 /* PBXTargetDependency */,
+			);
+			name = LiveLikeGiphyChallengeTests;
+			productName = LiveLikeGiphyChallengeTests;
+			productReference = CE2BD91B27A706A9001C6E22 /* LiveLikeGiphyChallengeTests.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
+		CE2BD92427A706A9001C6E22 /* LiveLikeGiphyChallengeUITests */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = CE2BD93527A706A9001C6E22 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeUITests" */;
+			buildPhases = (
+				CE2BD92127A706A9001C6E22 /* Sources */,
+				CE2BD92227A706A9001C6E22 /* Frameworks */,
+				CE2BD92327A706A9001C6E22 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				CE2BD92727A706A9001C6E22 /* PBXTargetDependency */,
+			);
+			name = LiveLikeGiphyChallengeUITests;
+			productName = LiveLikeGiphyChallengeUITests;
+			productReference = CE2BD92527A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.xctest */;
+			productType = "com.apple.product-type.bundle.ui-testing";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		CE2BD90327A7069E001C6E22 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				BuildIndependentTargetsInParallel = 1;
+				LastSwiftUpdateCheck = 1320;
+				LastUpgradeCheck = 1320;
+				TargetAttributes = {
+					CE2BD90A27A7069E001C6E22 = {
+						CreatedOnToolsVersion = 13.2.1;
+					};
+					CE2BD91A27A706A9001C6E22 = {
+						CreatedOnToolsVersion = 13.2.1;
+						TestTargetID = CE2BD90A27A7069E001C6E22;
+					};
+					CE2BD92427A706A9001C6E22 = {
+						CreatedOnToolsVersion = 13.2.1;
+						TestTargetID = CE2BD90A27A7069E001C6E22;
+					};
+				};
+			};
+			buildConfigurationList = CE2BD90627A7069E001C6E22 /* Build configuration list for PBXProject "LiveLikeGiphyChallenge" */;
+			compatibilityVersion = "Xcode 13.0";
+			developmentRegion = en;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+				Base,
+			);
+			mainGroup = CE2BD90227A7069E001C6E22;
+			packageReferences = (
+				CE2C187F27A7E41400CD5D9D /* XCRemoteSwiftPackageReference "SwiftyGif" */,
+			);
+			productRefGroup = CE2BD90C27A7069E001C6E22 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				CE2BD90A27A7069E001C6E22 /* LiveLikeGiphyChallenge */,
+				CE2BD91A27A706A9001C6E22 /* LiveLikeGiphyChallengeTests */,
+				CE2BD92427A706A9001C6E22 /* LiveLikeGiphyChallengeUITests */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		CE2BD90927A7069E001C6E22 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CE2BD91627A706A8001C6E22 /* Preview Assets.xcassets in Resources */,
+				CE2BD91327A706A8001C6E22 /* Assets.xcassets in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		CE2BD91927A706A9001C6E22 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		CE2BD92327A706A9001C6E22 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		CE2BD90727A7069E001C6E22 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CE2BD94B27A71DD4001C6E22 /* GiphyError.swift in Sources */,
+				CE2BD94727A718D6001C6E22 /* GiphyTrendingRequest.swift in Sources */,
+				CE2BD94527A718AD001C6E22 /* FetchGiphyAPI.swift in Sources */,
+				CE2BD91127A7069E001C6E22 /* ContentView.swift in Sources */,
+				CE2BD94F27A744D8001C6E22 /* GifImage.swift in Sources */,
+				CE2BD90F27A7069E001C6E22 /* LiveLikeGiphyChallengeApp.swift in Sources */,
+				CE2BD94927A719A0001C6E22 /* GiphyResponse.swift in Sources */,
+				CE2BD93927A70791001C6E22 /* MainViewModel.swift in Sources */,
+				CE2D85D727A9D4D100419922 /* Constants.swift in Sources */,
+				CE2BD95127A75254001C6E22 /* GiphyItemRow.swift in Sources */,
+				CE2C188727A81CD400CD5D9D /* Storage.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		CE2BD91727A706A9001C6E22 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CE2BD92027A706A9001C6E22 /* LiveLikeGiphyChallengeTests.swift in Sources */,
+				CE2D85D827A9D67300419922 /* MockURLProtocol.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		CE2BD92127A706A9001C6E22 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CE2BD92A27A706A9001C6E22 /* LiveLikeGiphyChallengeUITests.swift in Sources */,
+				CE2BD92C27A706A9001C6E22 /* LiveLikeGiphyChallengeUITestsLaunchTests.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+		CE2BD91D27A706A9001C6E22 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = CE2BD90A27A7069E001C6E22 /* LiveLikeGiphyChallenge */;
+			targetProxy = CE2BD91C27A706A9001C6E22 /* PBXContainerItemProxy */;
+		};
+		CE2BD92727A706A9001C6E22 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = CE2BD90A27A7069E001C6E22 /* LiveLikeGiphyChallenge */;
+			targetProxy = CE2BD92627A706A9001C6E22 /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+		CE2BD92D27A706A9001C6E22 /* 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_CXX_LIBRARY = "libc++";
+				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.2;
+				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;
+		};
+		CE2BD92E27A706A9001C6E22 /* 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_CXX_LIBRARY = "libc++";
+				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.2;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				SDKROOT = iphoneos;
+				SWIFT_COMPILATION_MODE = wholemodule;
+				SWIFT_OPTIMIZATION_LEVEL = "-O";
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+		CE2BD93027A706A9001C6E22 /* 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_ASSET_PATHS = "\"LiveLikeGiphyChallenge/Preview Content\"";
+				DEVELOPMENT_TEAM = FN5JHTPFC4;
+				ENABLE_PREVIEWS = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
+				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
+				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 = com.livelike.LiveLikeGiphyChallenge.LiveLikeGiphyChallenge;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		CE2BD93127A706A9001C6E22 /* 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_ASSET_PATHS = "\"LiveLikeGiphyChallenge/Preview Content\"";
+				DEVELOPMENT_TEAM = FN5JHTPFC4;
+				ENABLE_PREVIEWS = YES;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
+				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
+				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 = com.livelike.LiveLikeGiphyChallenge.LiveLikeGiphyChallenge;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Release;
+		};
+		CE2BD93327A706A9001C6E22 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				BUNDLE_LOADER = "$(TEST_HOST)";
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = FN5JHTPFC4;
+				GENERATE_INFOPLIST_FILE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 15.2;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallenge.LiveLikeGiphyChallengeTests;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LiveLikeGiphyChallenge.app/LiveLikeGiphyChallenge";
+			};
+			name = Debug;
+		};
+		CE2BD93427A706A9001C6E22 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				BUNDLE_LOADER = "$(TEST_HOST)";
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = FN5JHTPFC4;
+				GENERATE_INFOPLIST_FILE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 15.2;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallenge.LiveLikeGiphyChallengeTests;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LiveLikeGiphyChallenge.app/LiveLikeGiphyChallenge";
+			};
+			name = Release;
+		};
+		CE2BD93627A706A9001C6E22 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = FN5JHTPFC4;
+				GENERATE_INFOPLIST_FILE = YES;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallenge.LiveLikeGiphyChallengeUITests;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_TARGET_NAME = LiveLikeGiphyChallenge;
+			};
+			name = Debug;
+		};
+		CE2BD93727A706A9001C6E22 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = FN5JHTPFC4;
+				GENERATE_INFOPLIST_FILE = YES;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = com.livelike.LiveLikeGiphyChallenge.LiveLikeGiphyChallengeUITests;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_TARGET_NAME = LiveLikeGiphyChallenge;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		CE2BD90627A7069E001C6E22 /* Build configuration list for PBXProject "LiveLikeGiphyChallenge" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CE2BD92D27A706A9001C6E22 /* Debug */,
+				CE2BD92E27A706A9001C6E22 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		CE2BD92F27A706A9001C6E22 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallenge" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CE2BD93027A706A9001C6E22 /* Debug */,
+				CE2BD93127A706A9001C6E22 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		CE2BD93227A706A9001C6E22 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeTests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CE2BD93327A706A9001C6E22 /* Debug */,
+				CE2BD93427A706A9001C6E22 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		CE2BD93527A706A9001C6E22 /* Build configuration list for PBXNativeTarget "LiveLikeGiphyChallengeUITests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CE2BD93627A706A9001C6E22 /* Debug */,
+				CE2BD93727A706A9001C6E22 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+
+/* Begin XCRemoteSwiftPackageReference section */
+		CE2C187F27A7E41400CD5D9D /* XCRemoteSwiftPackageReference "SwiftyGif" */ = {
+			isa = XCRemoteSwiftPackageReference;
+			repositoryURL = "https://github.com/kirualex/SwiftyGif.git";
+			requirement = {
+				branch = master;
+				kind = branch;
+			};
+		};
+/* End XCRemoteSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+		CE2C188027A7E41400CD5D9D /* SwiftyGif */ = {
+			isa = XCSwiftPackageProductDependency;
+			package = CE2C187F27A7E41400CD5D9D /* XCRemoteSwiftPackageReference "SwiftyGif" */;
+			productName = SwiftyGif;
+		};
+/* End XCSwiftPackageProductDependency section */
+	};
+	rootObject = CE2BD90327A7069E001C6E22 /* Project object */;
+}

+ 0 - 0
LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/contents.xcworkspacedata → LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/contents.xcworkspacedata


+ 0 - 0
LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist → LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist


BIN
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/project.xcworkspace/xcuserdata/irinasmokvarska.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 0
LiveLikeGiphyChallenge.xcodeproj/xcuserdata/mike.xcuserdatad/xcschemes/xcschememanagement.plist → LiveLikeGiphyChallenge/LiveLikeGiphyChallenge.xcodeproj/xcuserdata/irinasmokvarska.xcuserdatad/xcschemes/xcschememanagement.plist


+ 15 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/Constants.swift

@@ -0,0 +1,15 @@
+//
+//  Constants.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 2/1/22.
+//
+
+import Foundation
+
+class Constants {
+  static let apiKey: String = "26hInJ9wsFMTYRe6KiSPzONPMhv1gHMx"
+  static let trendingUrlPath = "https://api.giphy.com/v1/gifs/trending"
+  static let searchUrlPath = "https://api.giphy.com/v1/gifs/search"
+}
+

+ 64 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/FetchGiphyAPI.swift

@@ -0,0 +1,64 @@
+//
+//  FetchGiphyAPIImp.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import Foundation
+import UIKit
+
+public final class FetchGiphyAPI {
+  
+  var urlSession = URLSession.shared
+  private var path = ""
+  
+  func fetchTrendingGifs(chunk: Int) async throws -> [GiphyData] {
+    path = "\(Constants.trendingUrlPath)?api_key=\(Constants.apiKey)&limit==\(chunk)&offset=0"
+    do {
+      let response = try await httpGet(responseType: GiphyResponse.self, timeout: 10, chunk: chunk)
+      return response.data
+    } catch {
+      throw GiphyError.errorNetwork
+    }
+  }
+  
+  func fetchGifsBy(string: String, chunk: Int) async throws -> [GiphyData] {
+    path = "\(Constants.searchUrlPath)?api_key=\(Constants.apiKey)&q=\(string)&limit=\(chunk)&offset=0&lang=en"
+    do {
+      let response = try await httpGet(responseType: GiphyResponse.self, timeout: 10, chunk: chunk)
+      return response.data
+    } catch {
+      throw GiphyError.errorNetwork
+    }
+  }
+  
+  func httpGet<Response: Decodable>(
+    responseType: Response.Type,
+    timeout: TimeInterval,
+    chunk: Int) async throws -> Response {
+      guard let url = URL(string: path) else { throw GiphyError.errorConvertingToUrl }
+      var request = URLRequest(url: url, timeoutInterval: timeout)
+      request.httpMethod = "GET"
+
+      return try await withCheckedThrowingContinuation { continuation in
+        let task = URLSession.shared.dataTask(with: request) { (data1, response, error) in
+          
+          if let error = error {
+            continuation.resume(with: .failure(error))
+            return
+          }
+          
+          if let data = data1 {
+            do {
+              let response = try JSONDecoder().decode(Response.self, from: data)
+              continuation.resume(with: .success(response))
+            } catch {
+              continuation.resume(with: .failure(error))
+            }
+          }
+        }
+        task.resume()
+      }
+    }
+}

+ 18 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/GiphyError.swift

@@ -0,0 +1,18 @@
+//
+//  GiphyError.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import Foundation
+
+enum GiphyError: Error {
+  case badID
+  case errorNetwork
+  case errorParsing
+  case errorTurningDataToImage
+  case errorFetchingTrending
+  case errorFetchingBySearchString
+  case errorConvertingToUrl
+}

+ 52 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/GiphyResponse.swift

@@ -0,0 +1,52 @@
+//
+//  GiphyResponse.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import Foundation
+import CloudKit
+
+// MARK: - GiphyResponse
+struct GiphyResponse: Decodable {
+  let data: [GiphyData]
+  let pagination: Pagination
+  let meta: Meta
+}
+
+// MARK: - GiphyData
+struct GiphyData: Codable, Hashable {
+  let type: String
+  let id: String
+  let title: String
+  var images: Original
+  
+  static func == (lhs: GiphyData, rhs: GiphyData) -> Bool {
+    lhs.type == rhs.type && lhs.id == rhs.id && lhs.title == rhs.title && lhs.images.original.url == rhs.images.original.url
+  }
+}
+
+// MARK: - Pagination
+struct Pagination: Decodable {
+  let total_count: Int
+  let count: Int
+  let offset: Int
+}
+
+// MARK: - Meta
+struct Meta: Decodable {
+  let status: Int
+  let msg: String
+  let response_id: String
+}
+
+// MARK: - Original
+struct Original: Codable, Hashable {
+  let original: OriginalData
+}
+
+// MARK: - OriginalData
+struct OriginalData: Codable, Hashable {
+  let url: String
+}

+ 18 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/GiphyTrendingRequest.swift

@@ -0,0 +1,18 @@
+//
+//  GiphyTrendingRequest.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import Foundation
+
+// MARK: - GiphyTrendingRequest
+struct GiphyTrendingRequest: Encodable {
+  let apiKey: String
+  let limit: Int
+  let offset: Int
+  let rating: String
+  let random_id: String
+  let bundle: String
+}

+ 98 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/API/Storage.swift

@@ -0,0 +1,98 @@
+//
+//  Storage.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/31/22.
+//
+
+import Foundation
+
+public class Storage {
+  
+  fileprivate init() { }
+  
+  enum Directory {
+    case documents
+    case caches
+  }
+  
+  static fileprivate func getURL(for directory: Directory) -> URL {
+    var searchPathDirectory: FileManager.SearchPathDirectory
+    
+    switch directory {
+    case .documents:
+      searchPathDirectory = .documentDirectory
+    case .caches:
+      searchPathDirectory = .cachesDirectory
+    }
+    
+    if let url = FileManager.default.urls(for: searchPathDirectory, in: .userDomainMask).first {
+      return url
+    } else {
+      fatalError("Could not create URL for specified directory!")
+    }
+  }
+
+  static func store<T: Encodable>(_ object: T, to directory: Directory, as fileName: String) {
+    let url = getURL(for: directory).appendingPathComponent(fileName, isDirectory: false)
+    
+    let encoder = JSONEncoder()
+    do {
+      let data = try encoder.encode(object)
+      if FileManager.default.fileExists(atPath: url.path) {
+        try FileManager.default.removeItem(at: url)
+      }
+      FileManager.default.createFile(atPath: url.path, contents: data, attributes: nil)
+    } catch {
+      fatalError(error.localizedDescription)
+    }
+  }
+  
+  static func retrieve<T: Decodable>(_ fileName: String, from directory: Directory, as type: T.Type) -> T {
+    let url = getURL(for: directory).appendingPathComponent(fileName, isDirectory: false)
+    
+    if !FileManager.default.fileExists(atPath: url.path) {
+      fatalError("File at path \(url.path) does not exist!")
+    }
+    
+    if let data = FileManager.default.contents(atPath: url.path) {
+      let decoder = JSONDecoder()
+      do {
+        let model = try decoder.decode(type, from: data)
+        return model
+      } catch {
+        fatalError(error.localizedDescription)
+      }
+    } else {
+      fatalError("No data at \(url.path)!")
+    }
+  }
+  
+  static func clear(_ directory: Directory) {
+    let url = getURL(for: directory)
+    do {
+      let contents = try FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: nil, options: [])
+      for fileUrl in contents {
+        try FileManager.default.removeItem(at: fileUrl)
+      }
+    } catch {
+      fatalError(error.localizedDescription)
+    }
+  }
+  
+  static func remove(_ fileName: String, from directory: Directory) {
+    let url = getURL(for: directory).appendingPathComponent(fileName, isDirectory: false)
+    if FileManager.default.fileExists(atPath: url.path) {
+      do {
+        try FileManager.default.removeItem(at: url)
+      } catch {
+        fatalError(error.localizedDescription)
+      }
+    }
+  }
+  
+  static func fileExists(_ fileName: String, in directory: Directory) -> Bool {
+    let url = getURL(for: directory).appendingPathComponent(fileName, isDirectory: false)
+    return FileManager.default.fileExists(atPath: url.path)
+  }
+}

+ 0 - 0
LiveLikeGiphyChallenge/Assets.xcassets/AccentColor.colorset/Contents.json → LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Assets.xcassets/AccentColor.colorset/Contents.json


+ 0 - 0
LiveLikeGiphyChallenge/Assets.xcassets/AppIcon.appiconset/Contents.json → LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Assets.xcassets/AppIcon.appiconset/Contents.json


+ 0 - 0
LiveLikeGiphyChallenge/Assets.xcassets/Contents.json → LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Assets.xcassets/Contents.json


+ 44 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/ContentView.swift

@@ -0,0 +1,44 @@
+//
+//  ContentView.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import SwiftUI
+
+struct ContentView: View {
+  
+  @ObservedObject var viewModel: MainViewModel
+  
+  var body: some View {
+    
+    NavigationView {
+      List {
+        ForEach(viewModel.searchResults, id: \.self) { data in
+          VStack {
+            GiphyItemRow(url: URL(string: data.images.original.url)!)
+              .frame(height: 100, alignment: .leading)
+              .frame(minWidth: 0, maxWidth: .infinity)
+              .onAppear {
+                viewModel.increaseLoadedGifCount()
+                if viewModel.loadedGifCount == viewModel.chunkCount {
+                  viewModel.increaseChunkCount()
+                  viewModel.fetchTrendingData(chunk: viewModel.chunkCount)
+                }
+              }
+          }
+        }
+      }
+    }
+    .alert(isPresented: $viewModel.hasErrorWhileFetching) {
+      Alert(
+        title: Text("Error"),
+        message: Text("Something went wrong while fetching gifs"),
+        dismissButton: .cancel(Text("Ok"))
+      )
+    }
+    .searchable(text: $viewModel.searchText)
+  }
+}
+

+ 16 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/GiphyItemRow.swift

@@ -0,0 +1,16 @@
+//
+//  GiphyItemRow.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/31/22.
+//
+
+import SwiftUI
+
+struct GiphyItemRow: View {
+  let url: URL
+  
+  var body: some View {
+    GifImage(url: url)
+  }
+}

+ 17 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/LiveLikeGiphyChallengeApp.swift

@@ -0,0 +1,17 @@
+//
+//  LiveLikeGiphyChallengeApp.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import SwiftUI
+
+@main
+struct LiveLikeGiphyChallengeApp: App {
+  var body: some Scene {
+    WindowGroup {
+      ContentView(viewModel: MainViewModel())
+    }
+  }
+}

+ 83 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/MainScreen/MainViewModel.swift

@@ -0,0 +1,83 @@
+//
+//  MainViewModel.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import Foundation
+import Combine
+import SwiftUI
+
+@MainActor
+final class MainViewModel: ObservableObject {
+  
+  @Published var loadedGifCount = 0
+  @Published var chunkCount: Int = 20
+  @Published var hasErrorWhileFetching = false
+  @Published var searchResults: [GiphyData] = [GiphyData]()
+  @Published var searchText = ""
+  
+  private var subscriptions = Set<AnyCancellable>()
+  private let api: FetchGiphyAPI = FetchGiphyAPI()
+  
+  init() {
+    $searchText.sink { [weak self] stringValue in
+      if stringValue.isEmpty {
+         self?.fetchTrendingData(chunk: self?.chunkCount ?? 0)
+      } else {
+        self?.fetchSearchDataBy(string: stringValue , chunk: self?.chunkCount ?? 0)
+      }
+    }
+    .store(in: &subscriptions)
+  }
+  
+  func fetchTrendingData(chunk: Int) {
+    Task {
+      do {
+        guard Storage.fileExists("data.json", in: .documents) else {
+          self.searchResults = try await api.fetchTrendingGifs(chunk: self.chunkCount)
+          Storage.store(self.searchResults, to: .documents, as: "data.json")
+          return
+        }
+        
+        self.searchResults = Storage.retrieve("data.json", from: .documents, as: [GiphyData].self)
+        let difference = self.chunkCount - self.searchResults.count
+        if self.searchResults.count <= self.chunkCount && difference == 20  {
+          self.searchResults = try await api.fetchTrendingGifs(chunk: self.chunkCount)
+          Storage.store(self.searchResults, to: .documents, as: "data.json")
+        }
+      } catch {
+        print("Error fetching trening data")
+        hasErrorWhileFetching = true
+      }
+    }
+  }
+
+  func increaseChunkCount() {
+    chunkCount+=20
+  }
+  
+  func increaseLoadedGifCount() {
+    loadedGifCount+=1
+  }
+}
+
+//MARK: Private
+private extension MainViewModel {
+  func fetchSearchDataBy(string: String, chunk: Int) {
+    Task {
+      do {
+        self.searchResults = try await api.fetchGifsBy(string: string, chunk: chunkCount)
+      } catch {
+        print("Error fetching search data")
+        hasErrorWhileFetching = true
+      }
+    }
+  }
+}
+  
+  
+
+
+

+ 6 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Preview Content/Preview Assets.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 39 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallenge/Views/GifImage.swift

@@ -0,0 +1,39 @@
+//
+//  GifImage.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import SwiftUI
+import SwiftyGif
+
+struct GifImage: UIViewRepresentable {
+  
+  private let url: URL
+
+  init(url: URL) {
+    self.url = url
+  }
+  
+  func makeUIView(context: Context) -> UIView {
+    let view = UIView()
+    let imgView = UIImageView(gifURL: url, manager: .defaultManager, loopCount: 3)
+    let loader = UIActivityIndicatorView(style: .medium)
+    imgView.setGifFromURL(url, customLoader: loader)
+    imgView.frame = view.bounds
+    imgView.translatesAutoresizingMaskIntoConstraints = false
+    imgView.startAnimating()
+    view.addSubview(imgView)
+    NSLayoutConstraint.activate([
+      imgView.heightAnchor.constraint(equalTo: view.heightAnchor),
+      imgView.widthAnchor.constraint(equalTo: view.widthAnchor)
+    ])
+    
+    return view
+  }
+
+  func updateUIView(_ uiView: UIView, context: Context) {
+    
+  }
+}

+ 80 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallengeTests/LiveLikeGiphyChallengeTests.swift

@@ -0,0 +1,80 @@
+//
+//  LiveLikeGiphyChallengeTests.swift
+//  LiveLikeGiphyChallengeTests
+//
+//  Created by Irina Smokvarska on 1/30/22.
+//
+
+import XCTest
+@testable import LiveLikeGiphyChallenge
+
+class LiveLikeGiphyChallengeTests: XCTestCase {
+  
+  var urlSession: URLSession!
+  
+  override func setUpWithError() throws {
+    // Set url session for mock networking
+    let configuration = URLSessionConfiguration.ephemeral
+    configuration.protocolClasses = [MockURLProtocol.self]
+    urlSession = URLSession(configuration: configuration)
+  }
+  
+  func testFetchGifsByString_retrieveSearchedGif_successfullyReturnsSearchedGifData() async throws {
+    let searchString = "Adventure%20Time%20Morning"
+    let chunk = 1
+    
+    //The problem with the API here is that it doesn't always return this GIF with the exact same search string
+    let expectedJSON = """
+  [
+      { "type": "gif",
+      "id": "KFOqUTRI8H26s",
+      "url": "https://giphy.com/gifs/KFOqUTRI8H26s",
+      "title": "Adventure Time Morning GIF"
+      }
+  ]
+  """
+ 
+    let mockData = Data(expectedJSON.utf8)
+    MockURLProtocol.requestHandler = { request in
+      (HTTPURLResponse(), mockData)
+    }
+    
+    let service = FetchGiphyAPI()
+    service.urlSession = urlSession
+    let gif = try await service.fetchGifsBy(string: searchString, chunk: chunk)
+    XCTAssertEqual(1, gif.count, "The search result should show 1 GIF")
+  }
+  
+  func testFetchGifsByString_errorWhileRetrievingSearchedGif_failedSearchedGifData() async throws {
+    let searchString = "Adventure%20Time%20Morning"
+    let chunk = -1
+    let expectedJSON = """
+  [
+      { "type": "gif",
+      "id": "KFOqUTRI8H26s",
+      "url": "https://giphy.com/gifs/KFOqUTRI8H26s",
+      "title": "Adventure Time Morning GIF"
+      }
+  ]
+  """
+ 
+    let mockData = Data(expectedJSON.utf8)
+    MockURLProtocol.requestHandler = { request in
+      (HTTPURLResponse(), mockData)
+    }
+    
+    let service = FetchGiphyAPI()
+    service.urlSession = urlSession
+    let gif = try await service.fetchGifsBy(string: searchString, chunk: chunk)
+    XCTAssertEqual([], gif, "The search result should be empty")
+  }
+  
+  func testFetchTrendingGifs_successfullyRetrievesTreningGifs() async throws {
+    let service = FetchGiphyAPI()
+    service.urlSession = urlSession
+   
+    let gifs = try await service.fetchTrendingGifs(chunk: 20)
+    XCTAssertFalse(gifs.isEmpty, "We should get gifs")
+  }
+}
+

+ 40 - 0
LiveLikeGiphyChallenge/LiveLikeGiphyChallengeTests/MockURLProtocol.swift

@@ -0,0 +1,40 @@
+//
+//  MockURLProtocol.swift
+//  LiveLikeGiphyChallenge
+//
+//  Created by Irina Smokvarska on 2/1/22.
+//
+
+import XCTest
+@testable import LiveLikeGiphyChallenge
+
+//MARK: MockURLProtocol
+class MockURLProtocol: URLProtocol {
+  static var requestHandler: ((URLRequest) throws -> (HTTPURLResponse, Data))?
+  
+  override class func canInit(with request: URLRequest) -> Bool {
+    return true
+  }
+  
+  override class func canonicalRequest(for request: URLRequest) -> URLRequest {
+    return request
+  }
+  
+  override func startLoading() {
+    guard let handler = MockURLProtocol.requestHandler else {
+      XCTFail("Received unexpected request with no handler set")
+      return
+    }
+    do {
+      let (response, data) = try handler(request)
+      client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed)
+      client?.urlProtocol(self, didLoad: data)
+      client?.urlProtocolDidFinishLoading(self)
+    } catch {
+      client?.urlProtocol(self, didFailWithError: error)
+    }
+  }
+  
+  override func stopLoading() {
+  }
+}

+ 1 - 0
LiveLikeGiphyChallengeUITests/LiveLikeGiphyChallengeUITests.swift → LiveLikeGiphyChallenge/LiveLikeGiphyChallengeUITests/LiveLikeGiphyChallengeUITests.swift

@@ -2,6 +2,7 @@
 //  LiveLikeGiphyChallengeUITests.swift
 //  LiveLikeGiphyChallengeUITests
 //
+//  Created by Irina Smokvarska on 1/30/22.
 //
 
 import XCTest

+ 1 - 0
LiveLikeGiphyChallengeUITests/LiveLikeGiphyChallengeUITestsLaunchTests.swift → LiveLikeGiphyChallenge/LiveLikeGiphyChallengeUITests/LiveLikeGiphyChallengeUITestsLaunchTests.swift

@@ -2,6 +2,7 @@
 //  LiveLikeGiphyChallengeUITestsLaunchTests.swift
 //  LiveLikeGiphyChallengeUITests
 //
+//  Created by Irina Smokvarska on 1/30/22.
 //
 
 import XCTest

+ 0 - 57
LiveLikeGiphyChallenge/SceneDelegate.swift

@@ -1,57 +0,0 @@
-//
-//  SceneDelegate.swift
-//  LiveLikeGiphyChallenge
-//
-//
-
-import UIKit
-
-class SceneDelegate: UIResponder, UIWindowSceneDelegate {
-
-    var window: UIWindow?
-
-
-    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
-        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
-        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
-        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
-        guard let _ = (scene as? UIWindowScene) else { return }
-        
-        guard let windowScene = (scene as? UIWindowScene) else { return }
-                window = UIWindow(frame: windowScene.coordinateSpace.bounds)
-                window?.windowScene = windowScene
-                window?.rootViewController = ViewController()
-                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.
-    }
-
-
-}
-

+ 0 - 19
LiveLikeGiphyChallenge/ViewController.swift

@@ -1,19 +0,0 @@
-//
-//  ViewController.swift
-//  LiveLikeGiphyChallenge
-//
-//
-
-import UIKit
-
-class ViewController: UIViewController {
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        // Do any additional setup after loading the view.
-
-    }
-
-
-}
-

+ 0 - 32
LiveLikeGiphyChallengeTests/LiveLikeGiphyChallengeTests.swift

@@ -1,32 +0,0 @@
-//
-//  LiveLikeGiphyChallengeTests.swift
-//  LiveLikeGiphyChallengeTests
-//
-//
-
-import XCTest
-@testable import LiveLikeGiphyChallenge
-
-class LiveLikeGiphyChallengeTests: 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.
-    }
-
-    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.
-        }
-    }
-
-}