瀏覽代碼

Adding Views and ViewModel

Irina Smokvarska 3 年之前
父節點
當前提交
ea12cbab8d

+ 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 */;
-}

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

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "self:">
-   </FileRef>
-</Workspace>

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

@@ -1,8 +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>IDEDidComputeMac32BitWarning</key>
-	<true/>
-</dict>
-</plist>

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

@@ -1,14 +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>SchemeUserState</key>
-	<dict>
-		<key>LiveLikeGiphyChallenge.xcscheme_^#shared#^_</key>
-		<dict>
-			<key>orderHint</key>
-			<integer>0</integer>
-		</dict>
-	</dict>
-</dict>
-</plist>

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

@@ -1,11 +0,0 @@
-{
-  "colors" : [
-    {
-      "idiom" : "universal"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

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

@@ -1,98 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "20x20"
-    },
-    {
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "20x20"
-    },
-    {
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "29x29"
-    },
-    {
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "29x29"
-    },
-    {
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "40x40"
-    },
-    {
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "40x40"
-    },
-    {
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "60x60"
-    },
-    {
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "60x60"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "1x",
-      "size" : "20x20"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "2x",
-      "size" : "20x20"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "1x",
-      "size" : "29x29"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "2x",
-      "size" : "29x29"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "1x",
-      "size" : "40x40"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "2x",
-      "size" : "40x40"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "1x",
-      "size" : "76x76"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "2x",
-      "size" : "76x76"
-    },
-    {
-      "idiom" : "ipad",
-      "scale" : "2x",
-      "size" : "83.5x83.5"
-    },
-    {
-      "idiom" : "ios-marketing",
-      "scale" : "1x",
-      "size" : "1024x1024"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

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

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

+ 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)
+  }
+}

+ 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: self!.searchText , 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
+      }
+    }
+  }
+}
+  
+  
+
+
+

+ 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) {
+    
+  }
+}