diff --git a/ArchTouch_Challenge.xcodeproj/project.pbxproj b/ArchTouch_Challenge.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5f467de --- /dev/null +++ b/ArchTouch_Challenge.xcodeproj/project.pbxproj @@ -0,0 +1,486 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 542833472207631E00F86B23 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 542833462207631E00F86B23 /* AppDelegate.swift */; }; + 5428334C2207631E00F86B23 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5428334A2207631E00F86B23 /* Main.storyboard */; }; + 5428334E2207633900F86B23 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5428334D2207633900F86B23 /* Assets.xcassets */; }; + 542833512207633900F86B23 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5428334F2207633900F86B23 /* LaunchScreen.storyboard */; }; + 5428335E2207676500F86B23 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5428335D2207676500F86B23 /* MainViewController.swift */; }; + 54283363220789C000F86B23 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 54283362220789BF00F86B23 /* Default-568h@2x.png */; }; + 54283365220792EC00F86B23 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54283364220792EC00F86B23 /* Utilities.swift */; }; + 542833672207AC7A00F86B23 /* TabBarPrincipalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 542833662207AC7A00F86B23 /* TabBarPrincipalViewController.swift */; }; + AA86DE26C9BF346B8AE8C5F7 /* Pods_ArchTouch_Challenge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8841B435324C0C625792D302 /* Pods_ArchTouch_Challenge.framework */; }; + EF79DB8622087665007D67F6 /* Movie.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF79DB8522087665007D67F6 /* Movie.swift */; }; + EF79DB8822087D89007D67F6 /* ErrorTreatment.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF79DB8722087D89007D67F6 /* ErrorTreatment.swift */; }; + EF79DB8D2208808D007D67F6 /* MovieCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF79DB8C2208808D007D67F6 /* MovieCollectionCell.swift */; }; + EF79DB8F2208894A007D67F6 /* MovieDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF79DB8E2208894A007D67F6 /* MovieDetailViewController.swift */; }; + EF79DB9122088D59007D67F6 /* MovieDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF79DB9022088D59007D67F6 /* MovieDetail.swift */; }; + EF79DB932208B5C8007D67F6 /* Genres.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF79DB922208B5C8007D67F6 /* Genres.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 3E64F36CABF3AB30ACA55846 /* Pods-ArchTouch_Challenge.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ArchTouch_Challenge.release.xcconfig"; path = "Pods/Target Support Files/Pods-ArchTouch_Challenge/Pods-ArchTouch_Challenge.release.xcconfig"; sourceTree = ""; }; + 542833432207631E00F86B23 /* ArchTouch_Challenge.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ArchTouch_Challenge.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 542833462207631E00F86B23 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 5428334B2207631E00F86B23 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 5428334D2207633900F86B23 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 542833502207633900F86B23 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 542833522207633900F86B23 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5428335D2207676500F86B23 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; + 54283362220789BF00F86B23 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 54283364220792EC00F86B23 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; + 542833662207AC7A00F86B23 /* TabBarPrincipalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarPrincipalViewController.swift; sourceTree = ""; }; + 75859EB56FE89A31470C1662 /* Pods-ArchTouch_Challenge.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ArchTouch_Challenge.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ArchTouch_Challenge/Pods-ArchTouch_Challenge.debug.xcconfig"; sourceTree = ""; }; + 8841B435324C0C625792D302 /* Pods_ArchTouch_Challenge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ArchTouch_Challenge.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EF79DB8522087665007D67F6 /* Movie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Movie.swift; sourceTree = ""; }; + EF79DB8722087D89007D67F6 /* ErrorTreatment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorTreatment.swift; sourceTree = ""; }; + EF79DB8C2208808D007D67F6 /* MovieCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieCollectionCell.swift; sourceTree = ""; }; + EF79DB8E2208894A007D67F6 /* MovieDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieDetailViewController.swift; sourceTree = ""; }; + EF79DB9022088D59007D67F6 /* MovieDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieDetail.swift; sourceTree = ""; }; + EF79DB922208B5C8007D67F6 /* Genres.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Genres.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 542833402207631E00F86B23 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA86DE26C9BF346B8AE8C5F7 /* Pods_ArchTouch_Challenge.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1E18D42198CC0D094BEA9319 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8841B435324C0C625792D302 /* Pods_ArchTouch_Challenge.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 5428333A2207631E00F86B23 = { + isa = PBXGroup; + children = ( + 54283362220789BF00F86B23 /* Default-568h@2x.png */, + 542833452207631E00F86B23 /* ArchTouch_Challenge */, + 542833442207631E00F86B23 /* Products */, + B0AC960DFFF8E7182E4A46D3 /* Pods */, + 1E18D42198CC0D094BEA9319 /* Frameworks */, + ); + sourceTree = ""; + }; + 542833442207631E00F86B23 /* Products */ = { + isa = PBXGroup; + children = ( + 542833432207631E00F86B23 /* ArchTouch_Challenge.app */, + ); + name = Products; + sourceTree = ""; + }; + 542833452207631E00F86B23 /* ArchTouch_Challenge */ = { + isa = PBXGroup; + children = ( + 542833522207633900F86B23 /* Info.plist */, + 5428335C2207656E00F86B23 /* Files */, + 5428335B2207654700F86B23 /* Storyboard */, + EF79DB8422087656007D67F6 /* Model */, + EF79DB8922087FFF007D67F6 /* View */, + 542833582207651B00F86B23 /* Controllers */, + 5428334D2207633900F86B23 /* Assets.xcassets */, + ); + path = ArchTouch_Challenge; + sourceTree = ""; + }; + 542833582207651B00F86B23 /* Controllers */ = { + isa = PBXGroup; + children = ( + 542833662207AC7A00F86B23 /* TabBarPrincipalViewController.swift */, + 5428335D2207676500F86B23 /* MainViewController.swift */, + EF79DB8E2208894A007D67F6 /* MovieDetailViewController.swift */, + ); + path = Controllers; + sourceTree = ""; + }; + 5428335B2207654700F86B23 /* Storyboard */ = { + isa = PBXGroup; + children = ( + 5428334A2207631E00F86B23 /* Main.storyboard */, + 5428334F2207633900F86B23 /* LaunchScreen.storyboard */, + ); + path = Storyboard; + sourceTree = ""; + }; + 5428335C2207656E00F86B23 /* Files */ = { + isa = PBXGroup; + children = ( + 542833462207631E00F86B23 /* AppDelegate.swift */, + 54283364220792EC00F86B23 /* Utilities.swift */, + EF79DB8722087D89007D67F6 /* ErrorTreatment.swift */, + ); + path = Files; + sourceTree = ""; + }; + B0AC960DFFF8E7182E4A46D3 /* Pods */ = { + isa = PBXGroup; + children = ( + 75859EB56FE89A31470C1662 /* Pods-ArchTouch_Challenge.debug.xcconfig */, + 3E64F36CABF3AB30ACA55846 /* Pods-ArchTouch_Challenge.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + EF79DB8422087656007D67F6 /* Model */ = { + isa = PBXGroup; + children = ( + EF79DB8522087665007D67F6 /* Movie.swift */, + EF79DB9022088D59007D67F6 /* MovieDetail.swift */, + EF79DB922208B5C8007D67F6 /* Genres.swift */, + ); + path = Model; + sourceTree = ""; + }; + EF79DB8922087FFF007D67F6 /* View */ = { + isa = PBXGroup; + children = ( + EF79DB8C2208808D007D67F6 /* MovieCollectionCell.swift */, + ); + path = View; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 542833422207631E00F86B23 /* ArchTouch_Challenge */ = { + isa = PBXNativeTarget; + buildConfigurationList = 542833552207633900F86B23 /* Build configuration list for PBXNativeTarget "ArchTouch_Challenge" */; + buildPhases = ( + B4F6806C027F3E2F00707D54 /* [CP] Check Pods Manifest.lock */, + 5428333F2207631E00F86B23 /* Sources */, + 542833402207631E00F86B23 /* Frameworks */, + 542833412207631E00F86B23 /* Resources */, + C94B782A3147899BFF03219C /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ArchTouch_Challenge; + productName = ArchTouch_Challenge; + productReference = 542833432207631E00F86B23 /* ArchTouch_Challenge.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5428333B2207631E00F86B23 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Felipe Mac"; + TargetAttributes = { + 542833422207631E00F86B23 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = 5428333E2207631E00F86B23 /* Build configuration list for PBXProject "ArchTouch_Challenge" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 5428333A2207631E00F86B23; + productRefGroup = 542833442207631E00F86B23 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 542833422207631E00F86B23 /* ArchTouch_Challenge */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 542833412207631E00F86B23 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 542833512207633900F86B23 /* LaunchScreen.storyboard in Resources */, + 54283363220789C000F86B23 /* Default-568h@2x.png in Resources */, + 5428334E2207633900F86B23 /* Assets.xcassets in Resources */, + 5428334C2207631E00F86B23 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + B4F6806C027F3E2F00707D54 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-ArchTouch_Challenge-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + C94B782A3147899BFF03219C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-ArchTouch_Challenge/Pods-ArchTouch_Challenge-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ArchTouch_Challenge/Pods-ArchTouch_Challenge-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5428333F2207631E00F86B23 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 54283365220792EC00F86B23 /* Utilities.swift in Sources */, + EF79DB932208B5C8007D67F6 /* Genres.swift in Sources */, + 5428335E2207676500F86B23 /* MainViewController.swift in Sources */, + 542833472207631E00F86B23 /* AppDelegate.swift in Sources */, + EF79DB9122088D59007D67F6 /* MovieDetail.swift in Sources */, + EF79DB8D2208808D007D67F6 /* MovieCollectionCell.swift in Sources */, + EF79DB8F2208894A007D67F6 /* MovieDetailViewController.swift in Sources */, + 542833672207AC7A00F86B23 /* TabBarPrincipalViewController.swift in Sources */, + EF79DB8622087665007D67F6 /* Movie.swift in Sources */, + EF79DB8822087D89007D67F6 /* ErrorTreatment.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 5428334A2207631E00F86B23 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5428334B2207631E00F86B23 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 5428334F2207633900F86B23 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 542833502207633900F86B23 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 542833532207633900F86B23 /* 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++14"; + 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_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; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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 = 12.1; + 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; + }; + 542833542207633900F86B23 /* 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++14"; + 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_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; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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 = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 542833562207633900F86B23 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 75859EB56FE89A31470C1662 /* Pods-ArchTouch_Challenge.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = B8U3XUDM5X; + INFOPLIST_FILE = ArchTouch_Challenge/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.archtouchchallenge.ArchTouch-Challenge"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 542833572207633900F86B23 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3E64F36CABF3AB30ACA55846 /* Pods-ArchTouch_Challenge.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = B8U3XUDM5X; + INFOPLIST_FILE = ArchTouch_Challenge/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.archtouchchallenge.ArchTouch-Challenge"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5428333E2207631E00F86B23 /* Build configuration list for PBXProject "ArchTouch_Challenge" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 542833532207633900F86B23 /* Debug */, + 542833542207633900F86B23 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 542833552207633900F86B23 /* Build configuration list for PBXNativeTarget "ArchTouch_Challenge" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 542833562207633900F86B23 /* Debug */, + 542833572207633900F86B23 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 5428333B2207631E00F86B23 /* Project object */; +} diff --git a/ArchTouch_Challenge.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ArchTouch_Challenge.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b624890 --- /dev/null +++ b/ArchTouch_Challenge.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ArchTouch_Challenge.xcworkspace/contents.xcworkspacedata b/ArchTouch_Challenge.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..dcfcf78 --- /dev/null +++ b/ArchTouch_Challenge.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Contents.json b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..4a89182 --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,116 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x-1.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "ItunesArtwork@2x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..36fb1fb Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png new file mode 100644 index 0000000..2122925 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..2122925 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..2f07942 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..335f8e0 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png new file mode 100644 index 0000000..228204e Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..228204e Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..81d190d Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..2122925 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png new file mode 100644 index 0000000..8890f65 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..8890f65 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..13eded0 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..13eded0 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..a556e4d Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..b693d15 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..7a4ee2c Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..5984f5f Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png new file mode 100644 index 0000000..e903c76 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/Contents.json b/ArchTouch_Challenge/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/Tmdb.imageset/Contents.json b/ArchTouch_Challenge/Assets.xcassets/Tmdb.imageset/Contents.json new file mode 100644 index 0000000..b9122f4 --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/Tmdb.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Tmdb.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/Tmdb.imageset/Tmdb.jpg b/ArchTouch_Challenge/Assets.xcassets/Tmdb.imageset/Tmdb.jpg new file mode 100644 index 0000000..2729ba5 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/Tmdb.imageset/Tmdb.jpg differ diff --git a/ArchTouch_Challenge/Assets.xcassets/about_icon.imageset/Contents.json b/ArchTouch_Challenge/Assets.xcassets/about_icon.imageset/Contents.json new file mode 100644 index 0000000..1c6a083 --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/about_icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "about_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/about_icon.imageset/about_icon.png b/ArchTouch_Challenge/Assets.xcassets/about_icon.imageset/about_icon.png new file mode 100644 index 0000000..747f178 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/about_icon.imageset/about_icon.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/backTabBlack.imageset/Contents.json b/ArchTouch_Challenge/Assets.xcassets/backTabBlack.imageset/Contents.json new file mode 100644 index 0000000..9b546f1 --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/backTabBlack.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "backTabBlack.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/backTabBlack.imageset/backTabBlack.png b/ArchTouch_Challenge/Assets.xcassets/backTabBlack.imageset/backTabBlack.png new file mode 100644 index 0000000..ab223ac Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/backTabBlack.imageset/backTabBlack.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/base_background.imageset/Contents.json b/ArchTouch_Challenge/Assets.xcassets/base_background.imageset/Contents.json new file mode 100644 index 0000000..9390a95 --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/base_background.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "base_background.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/base_background.imageset/base_background.jpg b/ArchTouch_Challenge/Assets.xcassets/base_background.imageset/base_background.jpg new file mode 100644 index 0000000..c2c5895 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/base_background.imageset/base_background.jpg differ diff --git a/ArchTouch_Challenge/Assets.xcassets/movie_icon.imageset/Contents.json b/ArchTouch_Challenge/Assets.xcassets/movie_icon.imageset/Contents.json new file mode 100644 index 0000000..b90ca49 --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/movie_icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "movie_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/movie_icon.imageset/movie_icon.png b/ArchTouch_Challenge/Assets.xcassets/movie_icon.imageset/movie_icon.png new file mode 100644 index 0000000..2187a4f Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/movie_icon.imageset/movie_icon.png differ diff --git a/ArchTouch_Challenge/Assets.xcassets/theMovieDbLogo.imageset/Contents.json b/ArchTouch_Challenge/Assets.xcassets/theMovieDbLogo.imageset/Contents.json new file mode 100644 index 0000000..ee0f64c --- /dev/null +++ b/ArchTouch_Challenge/Assets.xcassets/theMovieDbLogo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "theMovieDbLogo.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ArchTouch_Challenge/Assets.xcassets/theMovieDbLogo.imageset/theMovieDbLogo.png b/ArchTouch_Challenge/Assets.xcassets/theMovieDbLogo.imageset/theMovieDbLogo.png new file mode 100644 index 0000000..bef0071 Binary files /dev/null and b/ArchTouch_Challenge/Assets.xcassets/theMovieDbLogo.imageset/theMovieDbLogo.png differ diff --git a/ArchTouch_Challenge/Controllers/MainViewController.swift b/ArchTouch_Challenge/Controllers/MainViewController.swift new file mode 100644 index 0000000..d00c91e --- /dev/null +++ b/ArchTouch_Challenge/Controllers/MainViewController.swift @@ -0,0 +1,217 @@ +// +// MainViewController.swift +// ArchTouch_Challenge +// +// Created by Felipe Mac on 03/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import UIKit +import Alamofire + +class MainViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UISearchBarDelegate { + + @IBOutlet weak var searchBox: UISearchBar! + @IBOutlet weak var searchBoxHeightConstraint: NSLayoutConstraint! + @IBOutlet weak var moviesCollectionView: UICollectionView! + var moviesArray = [Movie]() + var filteredMovieArray = [Movie]() + var baseMovieArray = [Movie]() + var page = 1 + + override func viewDidLoad() { + super.viewDidLoad() + configureDisplay() + setDelegates() + DispatchQueue.main.async { + self.getMovies(page: self.page) + } + } + + //MARK: -Functions + + func resetMovieArray() { + self.moviesArray = self.baseMovieArray + self.moviesCollectionView.reloadData() + } + + func setDelegates() { + moviesCollectionView.delegate = self + moviesCollectionView.dataSource = self + searchBox.delegate = self + } + + func configureDisplay() { + setNavigationTitleWithImage() + searchBoxHeightConstraint.constant = 0 + } + + func setNavigationTitleWithImage() { + let navView = UIView() + let label = UILabel() + label.text = "The Movie Data Base" + label.font = UIFont(name: "Pacifico-Regular", size: 20) + label.textColor = UIColor.white + label.sizeToFit() + label.center = navView.center + label.textAlignment = NSTextAlignment.center + + let image = UIImageView() + image.image = (#imageLiteral(resourceName: "Tmdb")) + image.layer.cornerRadius = 5 + let imageAspect = image.image!.size.width/image.image!.size.height + image.frame = CGRect(x: label.frame.origin.x-label.frame.size.height*imageAspect - 5, y: label.frame.origin.y, width: label.frame.size.height*imageAspect, height: label.frame.size.height) + image.contentMode = UIView.ContentMode.scaleAspectFit + + navView.addSubview(label) + navView.addSubview(image) + + self.navigationItem.titleView = navView + + navView.sizeToFit() + } + + func activateSearchBox() { + searchBox.text = "" + + UIView.animate(withDuration: 0.1, + delay: 0.1, + options: UIView.AnimationOptions.curveEaseIn, + animations: { () -> Void in + self.searchBoxHeightConstraint.constant = 56 + self.view.layoutIfNeeded() + self.resetMovieArray() + }, completion: { (finished) -> Void in + }) + } + + func desactivateSearchBox() { + + UIView.animate(withDuration: 0.1, + delay: 0.1, + options: UIView.AnimationOptions.curveEaseIn, + animations: { () -> Void in + self.searchBoxHeightConstraint.constant = 0 + self.view.layoutIfNeeded() + self.view.endEditing(true) + self.resetMovieArray() + }, completion: { (finished) -> Void in + }) + } + + //MARK: -IBActions + + @IBAction func checkSearchBoxState(_ sender: UIBarButtonItem) { + if searchBoxHeightConstraint.constant == 0 { + activateSearchBox() + }else{ + desactivateSearchBox() + } + } + + //MARK: -SearchBar Delegates + + func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { + view.endEditing(true) + } + + func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { + filterContentForSearchText(searchText: searchBox.text!) + moviesCollectionView.reloadData() + } + + func searchBarCancelButtonClicked(_ searchBar: UISearchBar) { + resetMovieArray() + } + + func filterContentForSearchText(searchText: String, scope: String = "All") { + if searchText != "" { + moviesArray = filteredMovieArray.filter {data in + + return data.original_title?.lowercased().contains(searchText.lowercased()) ?? false + + } + }else { self.moviesArray = self.baseMovieArray} + } + + //MARK: -CollectionView Delegates + + func numberOfSections(in collectionView: UICollectionView) -> Int { + return 1 + } + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return moviesArray.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + + if let cell = moviesCollectionView.dequeueReusableCell(withReuseIdentifier: "MovieCell", for: indexPath) as? MovieCollectionCell { + + let objects = moviesArray[indexPath.row] + cell.object = objects + return cell + } + return UICollectionViewCell() + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + guard let cell = moviesCollectionView.cellForItem(at: indexPath) as? MovieCollectionCell else {return} + if let vc = self.storyboard?.instantiateViewController(withIdentifier: "MovieDetailVC") as? MovieDetailViewController { + vc.movieID = cell.movieID + self.navigationController?.pushViewController(vc, animated: true) + } + } + + func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + let actualPosition = scrollView.contentOffset.y + let contentHeight = scrollView.contentSize.height - 1000 + if (actualPosition >= contentHeight) { + DispatchQueue.main.async { + self.page += 1 + self.getMovies(page: self.page) + } + } + } + + //MARK: -Api Call + + func getMovies(page:Int) { + + Utilities.setLoadingScreen(view: self.view) + + let manager = Alamofire.SessionManager.default + manager.session.configuration.timeoutIntervalForRequest = 10 + + let url = "https://api.themoviedb.org/3/movie/upcoming?api_key=\(Utilities.tmdb_key)&language=en-US&page=\(page)" + + manager.request("\(url)", method: .get, parameters: nil).responseJSON { response in + switch (response.result) { + case .success: + if let jsonDict = response.result.value as? [String:AnyObject] { + if let data = jsonDict["results"] as? [[String:AnyObject]] { + for item in data { + let object = Movie(dictionary: item) + self.moviesArray.append(object) + } + self.filteredMovieArray = self.moviesArray + self.baseMovieArray = self.moviesArray + } + } + case .failure(let error): + + if let errorMessage = response.response?.statusCode { + Utilities.createSimpleAlert(view: self, title: "The Movie DB", message: ErrorTreatment.jsonErrorTreatment(error: errorMessage)) + } + if error.localizedDescription == "The Internet connection appears to be offline." { + Utilities.createSimpleAlert(view: self, title: "The Movie DB", message: "The Internet connection appears to be offline, please check your connection and try again.") + }else{ + Utilities.createSimpleAlert(view: self, title: "The Movie DB", message: "Something went wrong, please try again later.") + } + break + } + Utilities.removeLoadingScreen(view: self.view) + self.moviesCollectionView.reloadData() + } + } +} diff --git a/ArchTouch_Challenge/Controllers/MovieDetailViewController.swift b/ArchTouch_Challenge/Controllers/MovieDetailViewController.swift new file mode 100644 index 0000000..7563c15 --- /dev/null +++ b/ArchTouch_Challenge/Controllers/MovieDetailViewController.swift @@ -0,0 +1,159 @@ +// +// MovieDetailViewController.swift +// ArchTouch_Challenge +// +// Created by Pedro Machado on 04/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import UIKit +import Alamofire +import Kingfisher + +class MovieDetailViewController: UIViewController { + + var movieID = Int() + + @IBOutlet weak var movie_poster: UIImageView! + @IBOutlet weak var movie_nameLbl: UILabel! + @IBOutlet weak var release_dateLbl: UILabel! + @IBOutlet weak var durationLbl: UILabel! + @IBOutlet weak var genresLbl: UILabel! + @IBOutlet weak var overviewTextView: UITextView! + + var movie : MovieDetail? + + override func viewDidLoad() { + super.viewDidLoad() + + DispatchQueue.main.async { + self.getMovieDetail(movieID: self.movieID) + } + } + + //MARK: Functions + + func setNavigationTitle() { + let navView = UIView() + let label = UILabel() + label.text = "Movie Detail" + label.font = UIFont(name: "Pacifico-Regular", size: 20) + label.textColor = UIColor.white + label.sizeToFit() + label.center = navView.center + label.textAlignment = NSTextAlignment.center + navView.addSubview(label) + self.navigationItem.titleView = navView + navView.sizeToFit() + } + + func configureLayout() { + + setNavigationTitle() + + self.movie_poster.image = nil + self.movie_poster.kf.indicatorType = .activity + self.movie_poster.kf.indicator?.startAnimatingView() + self.movie_poster.layer.borderWidth = 1 + self.movie_poster.layer.borderColor = UIColor.white.cgColor + + if let imageUrl = movie?.poster_path { + if let url = URL(string: "http://image.tmdb.org/t/p/original\(imageUrl)") { + DispatchQueue.main.async { + self.movie_poster.kf.setImage(with: url) + self.movie_poster.kf.indicator?.stopAnimatingView() + } + } + }else{ + self.movie_poster.image = #imageLiteral(resourceName: "Tmdb") + self.movie_poster.kf.indicator?.stopAnimatingView() + } + + if let movie_name = movie?.original_title { + movie_nameLbl.text = movie_name + } + + if let release_date = movie?.release_date { + release_dateLbl.attributedText = Utilities.addTwoColorsInLabel(string1: "Release date: ", sizeColorA: 20, sizeColorB: 18, string2: release_date) + }else{ + release_dateLbl.attributedText = Utilities.addTwoColorsInLabel(string1: "Release date: ", sizeColorA: 20, sizeColorB: 18, string2: "Unavailable") + } + + if let over_view = movie?.overview { + overviewTextView.text = over_view + }else{ + overviewTextView.text = "Unavailable" + } + + if let duration = movie?.runtime { + durationLbl.attributedText = Utilities.addTwoColorsInLabel(string1: "Duration: ", sizeColorA: 20, sizeColorB: 18, string2: "\(duration) Min.") + }else{ + durationLbl.attributedText = Utilities.addTwoColorsInLabel(string1: "Duration: ", sizeColorA: 20, sizeColorB: 18, string2: "Unavailable") + } + + if let genres = movie?.genres { + + var genresTypes = " " + var myMutableString = NSMutableAttributedString() + + let genre_count = genres.count + var count = 0 + + for item in genres { + count += 1 + if let name = item.name { + if count != genre_count { + genresTypes.append("\(name), ") + }else{ + genresTypes.append("\(name)") + } + } + } + genresLbl.text = genresTypes + let length = genresLbl.text?.count + myMutableString = NSMutableAttributedString(string: "Genres: \(genresTypes)", attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 20)]) + myMutableString.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.green, range: NSRange(location:7,length:length! + 1)) + genresLbl.attributedText = myMutableString + }else{ + genresLbl.attributedText = Utilities.addTwoColorsInLabel(string1: "Genres: ", sizeColorA: 20, sizeColorB: 18, string2: "Unavailable") + } + } + + //MARK: Api's Call + + func getMovieDetail(movieID:Int) { + + Utilities.setLoadingScreen(view: self.view) + + let manager = Alamofire.SessionManager.default + manager.session.configuration.timeoutIntervalForRequest = 10 + + let url = "https://api.themoviedb.org/3/movie/\(movieID)?api_key=\(Utilities.tmdb_key)&language=en-US" + + manager.request("\(url)", method: .get, parameters: nil).responseJSON { response in + switch (response.result) { + case .success: + if let jsonDict = response.result.value as? [String:AnyObject] { + let object = MovieDetail(dictionary: jsonDict) + self.movie = object + } + case .failure(let error): + + if let errorMessage = response.response?.statusCode { + Utilities.createSimpleAlert(view: self, title: "The Movie DB", message: ErrorTreatment.jsonErrorTreatment(error: errorMessage)) + } + if error.localizedDescription == "The Internet connection appears to be offline." { + Utilities.createSimpleAlert(view: self, title: "The Movie DB", message: "The Internet connection appears to be offline, please check your connection and try again.") + }else{ + Utilities.createSimpleAlert(view: self, title: "The Movie DB", message: "Something went wrong, please try again later.") + } + break + } + self.configureLayout() + Utilities.removeLoadingScreen(view: self.view) + } + } +} + + + diff --git a/ArchTouch_Challenge/Controllers/TabBarPrincipalViewController.swift b/ArchTouch_Challenge/Controllers/TabBarPrincipalViewController.swift new file mode 100644 index 0000000..b24e90a --- /dev/null +++ b/ArchTouch_Challenge/Controllers/TabBarPrincipalViewController.swift @@ -0,0 +1,26 @@ +// +// TabBarPrincipalViewController.swift +// ArchTouch_Challenge +// +// Created by Felipe Mac on 03/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import UIKit + +class TabBarPrincipalViewController: UITabBarController { + + override func viewDidLoad() { + super.viewDidLoad() + configurDisplay() + } + + //MARK: - Functions + + func configurDisplay() { + self.tabBar.backgroundImage = UIImage(named: "backTabBlack.png") + self.tabBar.tintColor = UIColor.white + self.tabBar.autoresizesSubviews = false + self.tabBar.clipsToBounds = true + } +} diff --git a/ArchTouch_Challenge/Files/AppDelegate.swift b/ArchTouch_Challenge/Files/AppDelegate.swift new file mode 100644 index 0000000..f5ac20c --- /dev/null +++ b/ArchTouch_Challenge/Files/AppDelegate.swift @@ -0,0 +1,47 @@ +// +// AppDelegate.swift +// ArchTouch_Challenge +// +// Created by Felipe Mac on 03/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + UINavigationBar.appearance().barTintColor = UIColor.black + UINavigationBar.appearance().tintColor = UIColor.white + UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white] + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } +} + diff --git a/ArchTouch_Challenge/Files/ErrorTreatment.swift b/ArchTouch_Challenge/Files/ErrorTreatment.swift new file mode 100644 index 0000000..9857a75 --- /dev/null +++ b/ArchTouch_Challenge/Files/ErrorTreatment.swift @@ -0,0 +1,25 @@ +// +// ErrorTreatment.swift +// ArchTouch_Challenge +// +// Created by Pedro Machado on 04/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import UIKit + +class ErrorTreatment: NSObject { + + static func jsonErrorTreatment(error:Int) -> String { + var message = String() + switch error { + case 401: + message = "Invalid API key: You must be granted a valid key." + case 404: + message = "The resource you requested could not be found." + default: + message = "Something went wrong, please try again later." + } + return message + } +} diff --git a/ArchTouch_Challenge/Files/Utilities.swift b/ArchTouch_Challenge/Files/Utilities.swift new file mode 100644 index 0000000..feaa421 --- /dev/null +++ b/ArchTouch_Challenge/Files/Utilities.swift @@ -0,0 +1,70 @@ +// +// Utilities.swift +// ArchTouch_Challenge +// +// Created by Felipe Mac on 03/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import UIKit + +class Utilities: NSObject { + + static let loadingView = UIView() + static let spinner = UIActivityIndicatorView() + static let tmdb_key = "1f54bd990f1cdfb230adb312546d765d" + + //MARK: -LoadingScreen + + static func setLoadingScreen(view: UIView) { + loadingView.isHidden = false + loadingView.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height) + loadingView.backgroundColor = UIColor.gray.withAlphaComponent(0.3) + + // Sets spinner + spinner.style = UIActivityIndicatorView.Style.gray + spinner.frame = CGRect(x: 0, y: 0, width: view.frame.maxX, height: view.frame.maxY) + spinner.startAnimating() + + view.addSubview(loadingView) + loadingView.addSubview(self.spinner) + } + + static func removeLoadingScreen(view: UIView) { + self.spinner.stopAnimating() + self.loadingView.isHidden = true + self.loadingView.removeFromSuperview() + } + + //MARK: -Alerts + + static func createSimpleAlert(view: UIViewController, title: String, message: String) { + + let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) + + let OKAction = UIAlertAction(title: "OK", style: .default) { (action) in + + } + alert.addAction(OKAction) + view.present(alert, animated: true, completion: nil) + } + + //MARK: - Add2ColorsLabel + + static func addTwoColorsInLabel(string1: String, sizeColorA: CGFloat, sizeColorB: CGFloat, string2:String) -> NSMutableAttributedString { + + let attrs1 = [NSAttributedString.Key.font : UIFont.systemFont(ofSize: sizeColorA), NSAttributedString.Key.foregroundColor : UIColor.white] + + let attrs2 = [NSAttributedString.Key.font : UIFont.systemFont(ofSize: sizeColorB), NSAttributedString.Key.foregroundColor : UIColor.green] + + let attributedString1 = NSMutableAttributedString(string:string1, attributes:attrs1) + + let attributedString2 = NSMutableAttributedString(string:string2, attributes:attrs2) + + attributedString1.append(attributedString2) + return attributedString1 + } + + +} + diff --git a/ArchTouch_Challenge/Info.plist b/ArchTouch_Challenge/Info.plist new file mode 100644 index 0000000..53bda49 --- /dev/null +++ b/ArchTouch_Challenge/Info.plist @@ -0,0 +1,64 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + TMDB App + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + example.com + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleLightContent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ArchTouch_Challenge/Model/Genres.swift b/ArchTouch_Challenge/Model/Genres.swift new file mode 100644 index 0000000..5b4e2b3 --- /dev/null +++ b/ArchTouch_Challenge/Model/Genres.swift @@ -0,0 +1,25 @@ +// +// Genres.swift +// ArchTouch_Challenge +// +// Created by Pedro Machado on 04/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import Foundation + +class Genres { + + var id: Int? + var name: String? + + init(dictionary: [String:AnyObject]) { + + if let value = dictionary["id"] as? Int? { + id = value + } + if let value = dictionary["name"] as? String { + name = value + } + } +} diff --git a/ArchTouch_Challenge/Model/Movie.swift b/ArchTouch_Challenge/Model/Movie.swift new file mode 100644 index 0000000..0d5d8fa --- /dev/null +++ b/ArchTouch_Challenge/Model/Movie.swift @@ -0,0 +1,73 @@ +// +// Movie.swift +// ArchTouch_Challenge +// +// Created by Pedro Machado on 04/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import Foundation + +class Movie { + + var vote_count: Int? + var id: Int? + var video: Bool? + var vote_average: Double? + var title: String? + var popularity: Double? + var poster_path: String? + var original_language: String? + var original_title: String? + var genre_ids: [Int]? + var backdrop_path: String? + var adult: Bool? + var overview: String? + var release_date: String? + + init(dictionary: [String:AnyObject]) { + + if let value = dictionary["vote_count"] as? Int { + vote_count = value + } + if let value = dictionary["id"] as? Int { + id = value + } + if let value = dictionary["video"] as? Bool { + video = value + } + if let value = dictionary["vote_average"] as? Double { + vote_average = value + } + if let value = dictionary["title"] as? String { + title = value + } + if let value = dictionary["popularity"] as? Double { + popularity = value + } + if let value = dictionary["poster_path"] as? String { + poster_path = value + } + if let value = dictionary["original_language"] as? String { + original_language = value + } + if let value = dictionary["original_title"] as? String { + original_title = value + } + if let value = dictionary["genre_ids"] as? [Int] { + genre_ids = value + } + if let value = dictionary["backdrop_path"] as? String { + backdrop_path = value + } + if let value = dictionary["adult"] as? Bool { + adult = value + } + if let value = dictionary["overview"] as? String { + overview = value + } + if let value = dictionary["release_date"] as? String { + release_date = value + } + } +} diff --git a/ArchTouch_Challenge/Model/MovieDetail.swift b/ArchTouch_Challenge/Model/MovieDetail.swift new file mode 100644 index 0000000..6a35bb4 --- /dev/null +++ b/ArchTouch_Challenge/Model/MovieDetail.swift @@ -0,0 +1,102 @@ +// +// MovieDetail.swift +// ArchTouch_Challenge +// +// Created by Pedro Machado on 04/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import Foundation + +class MovieDetail { + + var adult: Bool? + var backdrop_path: String? + var budget: Int? + var genres = [Genres]() + var homepage: String? + var id: Int? + var imdb_id: String? + var original_language: String? + var original_title: String? + var overview: String? + var popularity: Double? + var poster_path: String? + var release_date: String? + var revenue: Int? + var runtime: Int? + var status: String? + var tagline: String? + var title: String? + var video: Bool? + var vote_average: Double? + var vote_count: Int? + + init(dictionary: [String:AnyObject]) { + if let value = dictionary["adult"] as? Bool { + adult = value + } + if let value = dictionary["backdrop_path"] as? String { + backdrop_path = value + } + if let value = dictionary["budget"] as? Int { + budget = value + } + if let item = dictionary["genres"] as? [[String:AnyObject]] { + for value in item { + genres.append(Genres(dictionary: value)) + } + } + if let value = dictionary["homepage"] as? String { + homepage = value + } + if let value = dictionary["id"] as? Int { + id = value + } + if let value = dictionary["imdb_id"] as? String { + imdb_id = value + } + if let value = dictionary["original_language"] as? String { + original_language = value + } + if let value = dictionary["original_title"] as? String { + original_title = value + } + if let value = dictionary["overview"] as? String { + overview = value + } + if let value = dictionary["popularity"] as? Double { + popularity = value + } + if let value = dictionary["poster_path"] as? String { + poster_path = value + } + if let value = dictionary["release_date"] as? String { + release_date = value + } + if let value = dictionary["revenue"] as? Int { + revenue = value + } + if let value = dictionary["runtime"] as? Int { + runtime = value + } + if let value = dictionary["status"] as? String { + status = value + } + if let value = dictionary["tagline"] as? String { + tagline = value + } + if let value = dictionary["title"] as? String { + title = value + } + if let value = dictionary["video"] as? Bool { + video = value + } + if let value = dictionary["vote_average"] as? Double { + vote_average = value + } + if let value = dictionary["vote_count"] as? Int { + vote_count = value + } + } +} diff --git a/ArchTouch_Challenge/Storyboard/Base.lproj/LaunchScreen.storyboard b/ArchTouch_Challenge/Storyboard/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..6a29e8f --- /dev/null +++ b/ArchTouch_Challenge/Storyboard/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ArchTouch_Challenge/Storyboard/Base.lproj/Main.storyboard b/ArchTouch_Challenge/Storyboard/Base.lproj/Main.storyboard new file mode 100644 index 0000000..3f4cdf9 --- /dev/null +++ b/ArchTouch_Challenge/Storyboard/Base.lproj/Main.storyboard @@ -0,0 +1,406 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ArchTouch_Challenge/View/MovieCollectionCell.swift b/ArchTouch_Challenge/View/MovieCollectionCell.swift new file mode 100644 index 0000000..86284bf --- /dev/null +++ b/ArchTouch_Challenge/View/MovieCollectionCell.swift @@ -0,0 +1,60 @@ +// +// MovieCollectionCell.swift +// ArchTouch_Challenge +// +// Created by Pedro Machado on 04/02/19. +// Copyright © 2019 Felipe Mac. All rights reserved. +// + +import UIKit +import Kingfisher + +class MovieCollectionCell: UICollectionViewCell { + + @IBOutlet weak var movie_background: UIImageView! + @IBOutlet weak var movie_nameLbl: UILabel! + @IBOutlet weak var release_dateLbl: UILabel! + + var movieID = Int() + + func configureLayout() { + movie_background.layer.borderColor = UIColor.white.cgColor + movie_background.layer.borderWidth = 1 + } + + var object : Movie? { + didSet { + + configureLayout() + + if let data = object { + + self.movie_background.image = nil + self.movie_background.kf.indicatorType = .activity + self.movie_background.kf.indicator?.startAnimatingView() + + if let id = data.id { + movieID = id + } + + if let original_title = data.original_title { + movie_nameLbl.text = original_title + } + if let release_date = data.release_date { + release_dateLbl.text = "Release date: \(release_date)" + } + if let imageUrl = data.poster_path { + + if let url = URL(string: "http://image.tmdb.org/t/p/w185\(imageUrl)") { + DispatchQueue.main.async { + self.movie_background.kf.setImage(with: url) + self.movie_background.kf.indicator?.stopAnimatingView() + } + } + }else{ + self.movie_background.image = #imageLiteral(resourceName: "theMovieDbLogo") + } + } + } + } +} diff --git a/Default-568h@2x.png b/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/Default-568h@2x.png differ diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..0f2edb5 --- /dev/null +++ b/Podfile @@ -0,0 +1,13 @@ +# Uncomment the next line to define a global platform for your project + platform :ios, '9.0' + +target 'ArchTouch_Challenge' do + # Comment the next line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + + pod 'Alamofire' + pod 'Kingfisher' + + # Pods for ArchTouch_Challenge + +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..845a169 --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,20 @@ +PODS: + - Alamofire (4.8.1) + - Kingfisher (4.10.1) + +DEPENDENCIES: + - Alamofire + - Kingfisher + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + - Kingfisher + +SPEC CHECKSUMS: + Alamofire: 16ce2c353fb72865124ddae8a57c5942388f4f11 + Kingfisher: c148cd7b47ebde9989f6bc7c27dcaa79d81279a0 + +PODFILE CHECKSUM: 624fe4724c26b6bd03e60df18c129d01e888c369 + +COCOAPODS: 1.5.3 diff --git a/README.md b/README.md index 4f1d7cd..60c298b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,48 @@ # ArchTouch_Challenge -ArchTouch_Code_Challenge + +This is the App created for the MOBILE DEV CODE CHALLENGE By ArchTouch for iOS Development Position. + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. + +## Prerequisites + +It is important to have the latest version of Xcode. + +## Installing + +``` +Clone this repository and open the solution using Xcode, open terminal and run the command line (pod install) inside the app folder. +``` +## Some screens + +![alt text](https://github.com/FelipeMac01/ArchTouch_Challenge/blob/development/Screenshots/TMDB_Home.png) +![alt text](https://github.com/FelipeMac01/ArchTouch_Challenge/blob/development/Screenshots/TMDB_Movie.png) + +## Third-party components (via cocoapods) + +| Plug-ins| +| ------------------- | +|Alamofire| +|Kingfisher| + +### Alamofire + +Alamofire is an HTTP networking library written in Swift. +[For more information access here](https://github.com/Alamofire/Alamofire) + +### Kingfisher + +Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web. +[For more information access here](https://github.com/onevcat/Kingfisher) + +## Author + +* **Pedro Felipe Machado** + +## License + +This project is licensed under the MIT License + + diff --git a/Screenshots/TMDB_Home.png b/Screenshots/TMDB_Home.png new file mode 100644 index 0000000..8a0c63f Binary files /dev/null and b/Screenshots/TMDB_Home.png differ diff --git a/Screenshots/TMDB_Movie.png b/Screenshots/TMDB_Movie.png new file mode 100644 index 0000000..4a977a9 Binary files /dev/null and b/Screenshots/TMDB_Movie.png differ